Android N使用Cordova camera plug-in相机的额外步骤
java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider
java.lang.ClassNotFoundException: Didn’t find class “android.support.v4.content.FileProvider”
如果报以上的错误的话,先导入android.support.v4的包,版本不能高于sdk的版本,
导入android.support.v4包进去后如果报错的话,AndroidManifest.xml文件application标签中加上
《provider android:authorities=“com.ZLJ.provider” android:exported=“false”
android:grantUriPermissions=“true” android:name=“android.support.v4.content.FileProvider”>
《meta-data android:name=“android.support.FILE_PROVIDER_PATHS” android:resource="@xml/provider_paths" />
《provider>
android:authorities 里面的值com.ZLJ改成 自己 AndroidManifest.xml文件manifest标签里面的package属性值
然后打开res文件夹再打开xml文件夹,再打开config.xml文件,如果该文件中有《platform name=“android”》的话,就在该标签中加入《preference name=“applicationId” value=“com.ZLJ”》,value值同样为AndroidManifest.xml文件manifest标签里面的package属性值,没有该标签,就直接
《platform name=“android”》
《preference name=“applicationId” value=“com.ZLJ”/》
《/platform>