我运行一个 React Native 项目,该项目使用第三方库,如
react-native-biometrics
、react-native-blob-utils
等等。
我正在尝试将 react-native
库从 0.72 升级到 0.73。版本 0.73 取决于 Android Gradle Plugin (AGP) 版本 8。AGP v.8 要求我的应用程序不应在 AndroidManifest.xml
文件(package
标签中的 application
属性)中定义包名称,而是在 android/build.gradle
中定义为 android { namespace: 'com.example' }
.
此外,所有包含的第三方库也应该遵循这个“命名空间”规则,但是其中很多库仍然没有获得更新设置命名空间而不是包名称,并且不确定其中一些是否会获得。这就是为什么我在构建过程中遇到错误。
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
有关“规则”的更多详细信息,请参见此处: https://github.com/react-native-community/discussions-and-proposals/issues/671
我的问题是,是否有一个解决方案可以让我使用
react-native
v.0.73 + AGP v.8 和不满足上述规则的第三方库,即:命名空间未在 android/build.gradle
中定义,但在 AndroidManifest.xml
中定义为 package
application
标签的属性?