Bootstrap

android studio 3.0版本,在raw文件夹下使用.mp4/.mp3文件出现的错误和解决办法

使用raw文件夹下的资源的方式如下:

String uriStr = "android.resource://"+getPackageName()+"/"+ R.raw.abc;

我遇到的问题是,android studio会报错:

The file is not associated with any file type.Please define the association;

解决办法是:

在gradle.properties中,添加一行代码:

android.enableAapt2 = false

 

;