gpt4 book ai didi

firebase - 安装 admob 模块后 react-native build 失败

转载 作者:行者123 更新时间:2023-12-05 02:45:30 28 4
gpt4 key购买 nike

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1001 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...

> Configure project :react-native-firebase_admob
:react-native-firebase_admob package.json found at /home/muhamed-kveshkshaano/suck/node_modules/@react-native-firebase/admob/package.json
:react-native-firebase_app package.json found at /home/muhamed-kveshkshaano/suck/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_admob:firebase.bom using default value: 26.3.0
:react-native-firebase_admob:ads.consent using default value: 1.0.6
:react-native-firebase_admob package.json found at /home/muhamed-kveshkshaano/suck/node_modules/@react-native-firebase/admob/package.json
:react-native-firebase_admob:version set from package.json: 10.5.1 (10,5,1 - 10005001)
:react-native-firebase_admob:android.compileSdk using custom value: 29
:react-native-firebase_admob:android.targetSdk using custom value: 29
:react-native-firebase_admob:android.minSdk using custom value: 16
:react-native-firebase_admob:reactNativeAndroidDir /home/muhamed-kveshkshaano/suck/node_modules/react-native/android

> Configure project :react-native-firebase_app
:react-native-firebase_app package.json found at /home/muhamed-kveshkshaano/suck/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:firebase.bom using default value: 26.3.0
:react-native-firebase_app:play.play-services-auth using default value: 19.0.0
:react-native-firebase_app package.json found at /home/muhamed-kveshkshaano/suck/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:version set from package.json: 10.5.0 (10,5,0 - 10005000)
:react-native-firebase_app:android.compileSdk using custom value: 29
:react-native-firebase_app:android.targetSdk using custom value: 29
:react-native-firebase_app:android.minSdk using custom value: 16
:react-native-firebase_app:reactNativeAndroidDir /home/muhamed-kveshkshaano/suck/node_modules/react-native/android

> Task :react-native-firebase_app:compileDebugJavaWithJavac

> Task :app:processDebugResources FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
37 actionable tasks: 29 executed, 8 up-to-date
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/home/muhamed-kveshkshaano/.gradle/caches/transforms-2/files-2.1/820765fbb4c63d086027395fb7f0dacc/play-services-ads-lite-19.6.0/AndroidManifest.xml:27:5-38:15: AAPT: error: unexpected element <queries> found in <manifest>.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 32s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Note: Some input files use or override a deprecated API.

这是错误,主要问题是每次我安装 admob 模块@react-native-firebase/admob,它在尝试了很多之后抛出这个错误我找不到任何解决方案,它只发生在安装 admob 模块之后,除了它构建良好,任何人都知道那个模块出了什么问题

最佳答案

我遇到了同样的问题,它对我有用

在android/app/build.gradle

defaultConfig {
...
multiDexEnabled true // added for admob problem
}

...
dependencies {
...
implementation "androidx.multidex:multidex:2.0.1" // fix firebaseAdmob
}

在 android/build.gradle 中

dependencies {
classpath('com.android.tools.build:gradle:4.1.2')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.3.3'
}

现在在 Android Studio 中打开 android 文件夹并等待 gradle 更新

完成 gradle 更新后运行 npx react-native run-android

关于firebase - 安装 admob 模块后 react-native build 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65982313/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com