如何解决添加到清单中的 AndroidX androidx.core.content.FileProvider 在清单上给出错误;清单合并失败并出现多个错误,请参阅日志
上面的代码是我的 provider_paths.xml
然后我将其添加到我的清单中
/// registers a type so that a new instance will be created on each call of [getAsync]
/// on that type based on up to two parameters provided to [getAsync()]
/// the creation function is executed asynchronously and has to be accessed with [getAsync]
/// [T] type to register
/// [P1] type of param1
/// [P2] type of param2
/// if you use only one parameter pass void here
/// [func] factory function for this type that accepts two parameters
/// [instanceName] if you provide a value here your factory gets registered with that
/// name instead of a type. This should only be necessary if you need to register more
/// than one instance of one type. Its highly not recommended
///
/// example:
/// getIt.registerFactoryParam<TestClassParam,String,int>((s,i) async
/// => TestClassParam(param1:s,param2: i));
///
/// if you only use one parameter:
///
/// getIt.registerFactoryParam<TestClassParam,void>((s,_) async
/// => TestClassParam(param1:s);
@override
void registerFactoryParamAsync<T,P1,P2>(
FactoryFuncParamAsync<T,P2> func,{String instanceName}) {
_register<T,P2>(
type: _ServiceFactoryType.alwaysNew,instanceName: instanceName,factoryFuncParamAsync: func,isAsync: true,shouldSignalReady: false);
}
然后当我尝试运行该应用程序时,它给了我错误 清单合并因多个错误而失败,请参阅日志
谁能帮我解决这个问题?我目前使用的是 android X。
解决方法
由于错误信息建议您这样做,
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.packagename.package.provider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"
tools:replace="android:resource"
/>
</provider>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。