场景:下载文件 比如apk包 我使用了flutter_downloader插件
错误:java.lang.IllegalArgumentException: Couldn’t find meta-data for provider with authority com.example.gyidle.flutter_downloader.provider
处理: 查询此错误发现需要添加AndroidManifest.xml文件的内容提供者配置
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="{$applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths_public" />
</provider>
添加完成后 退出flutter 重新进入 任然报错
java.lang.IllegalArgumentException: Couldn't find meta-data for provider with authority com.example.gyidle.flutter_downloader.provider
继续解决:索性我就直接用 com.example.gyidle.flutter_downloader.provider 给他写死
再次退出flutter 重新进入 成功了
然后我去目录下面看是否真的下载成功
Android/data/com.example.gyidle/files/downloads/app-release.apk
是存在的 那么终于成功了