我正在使用This image picker library从图库/相机中选择图片,您可以在下面看到我的清单
我的包名是:com.vowpay.vowpay
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.vowpay.vowpay"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
获得错误:
java.lang.NullPointerException:尝试在null上调用虚方法'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager,java.lang.String)'对象参考
AT LINE
lifeCycleCallBackManager.onActivityResult(requestCode, resultCode, data);
答案 0 :(得分:0)
从
更改您的提供者 <provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.vowpay.vowpay"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
到
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.vowpay.vowpay.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
和provider_path.xml应该
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path
name="external_files"
path="." />
<root-path
name="external_files"
path="/storage/"/>
</paths>