Android 更新 android.support.v4.content 到 androidx.core.content.FileProvider 不会保留

发布于 2025-01-14 13:21:37 字数 810 浏览 6 评论 0原文

我正在尝试将 FileProvider 类从 android.support.v4.content.FileProvider 更新为 androidx.core.content.FileProvider 这使我能够成功构建。

当我运行ionic capsync时,它会恢复到android.support.v4.content.FileProvider...

我有cordova-plugin-androidx-adapter代码>已安装。

如何使其保持为 androidx.core.content.FileProvider 或使适配器正常工作?

在我的 AndroidManifest.xml 中:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths"></meta-data>
</provider>

I am trying to update the FileProvider class from android.support.v4.content.FileProvider to androidx.core.content.FileProvider which allows me to build successfully.

When I run ionic cap sync it reverts back to android.support.v4.content.FileProvider...

I have cordova-plugin-androidx-adapter installed.

How can I make it stay as androidx.core.content.FileProvider or make the adapter work?

In my AndroidManifest.xml:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths"></meta-data>
</provider>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

墨离汐 2025-01-21 13:21:37

@MishaMashina 的上述评论是明确的答案。我只是在这里回答,因为我能够让我的项目在不使用 cordova-plugin-androidx-adapter 的情况下编译运行 jetify。

The above comment from @MishaMashina is the definitive answer. I am only answering here as I was able to get my project to compile running jetify without using the cordova-plugin-androidx-adapter.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文