gpt4 book ai didi

android - 无法从 React Native 构建发布 APK

转载 作者:行者123 更新时间:2023-11-29 23:48:25 25 4
gpt4 key购买 nike

我使用 React Native 开发了一个应用程序,我对原生 iOS 或 Android 了解不多。我已经为 iOS 发布了我的应用程序,但是,现在我正在尝试为 Google Play 商店做同样的事情,我面临一些我不知道如何解决的问题。我正在按照 the official react native website 中的说明进行操作,但无法通过 $ ./gradlew assembleRelease 步骤。我修复了一些错误,但现在我在使用 --info 运行命令时得到以下信息:

> Task :react-native-braintree-xplat:verifyReleaseResources FAILED
Putting task artifact state for task ':react-native-braintree-xplat:verifyReleaseResources' into context took 0.0 secs.
Up-to-date check for task ':react-native-braintree-xplat:verifyReleaseResources' took 0.0 secs. It is not up-to-date because:
Task has failed previously.
All input files are considered out-of-date for incremental task ':react-native-braintree-xplat:verifyReleaseResources'.
Unable do incremental execution: full task run
QueuedCruncher is using /Users/miguel/Library/Android/sdk/build-tools/27.0.3/aapt

Shutdown finished in 0ms

:react-native-braintree-xplat:verifyReleaseResources (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.7 secs.
:react-native-svg:platformAttrExtractor (Thread[Task worker for ':',5,main]) completed. Took 10.698 secs.
:react-native-vector-icons:platformAttrExtractor (Thread[Daemon worker Thread 23,5,main]) completed. Took 10.461 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-braintree-xplat:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --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 5m 19s
173 actionable tasks: 152 executed, 21 up-to-date

我不知道问题是否直接与 braintree xplat library 有关或其他东西。

如有任何帮助,我们将不胜感激。

编辑1:

这是我对 ./gradlew clean assembleRelease 的输出:

Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :app
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Configure project :react-native-braintree-xplat
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.3.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :react-native-fast-image
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.3.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :react-native-fcm
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.3.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :react-native-image-crop-picker
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (27.0.0) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.3.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

Download https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml

> Configure project :react-native-image-picker
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation' and 'testApi'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.3.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :react-native-linear-gradient
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
WARNING: Configuration 'provided' is obsolete and has been replaced with 'compileOnly'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.3.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :react-native-svg
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.3.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :react-native-vector-icons
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.3.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :react-native-fast-image:processReleaseManifest
/Users/miguel/Projects/main/app/node_modules/react-native-fast-image/android/src/main/AndroidManifest.xml:11:9-15:15 Warning:
meta-data#com.bumptech.glide.integration.okhttp.OkHttpGlideModule was tagged at AndroidManifest.xml:11 to remove other declarations but no other declaration present

Download https://jcenter.bintray.com/com/braintreepayments/api/braintree/maven-metadata.xml
Download https://jcenter.bintray.com/com/braintreepayments/api/drop-in/maven-metadata.xml

> Task :app:processReleaseGoogleServices
Parsing json file: /Users/miguel/Projects/main/app/android/app/google-services.json

> Task :app:bundleReleaseJsAndAssets
Scanning folders for symlinks in /Users/miguel/Projects/main/app/node_modules (20ms)
Scanning folders for symlinks in /Users/miguel/Projects/main/app/node_modules (15ms)
Loading dependency graph, done.
warning: the transform cache was reset.
bundle: Writing bundle output to: /Users/miguel/Projects/main/app/android/app/build/intermediates/assets/release/index.android.bundle
bundle: Done writing bundle output
bundle: Copying 73 asset files
bundle: Done copying assets

> Task :app:processReleaseManifest
/Users/miguel/Projects/main/app/android/app/src/main/AndroidManifest.xml:16:9-19:35 Warning:
meta-data#com.bumptech.glide.integration.okhttp.OkHttpGlideModule was tagged at AndroidManifest.xml:16 to remove other declarations but no other declaration present

> Task :react-native-braintree-xplat:compileReleaseJavaWithJavac
Note: /Users/miguel/Projects/main/app/node_modules/react-native-braintree-xplat/android/src/main/java/com/pw/droplet/braintree/Braintree.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :react-native-fcm:compileReleaseJavaWithJavac
Note: /Users/miguel/Projects/main/app/node_modules/react-native-fcm/android/src/main/java/com/evollu/react/fcm/SendNotificationTask.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :react-native-image-crop-picker:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :react-native-svg:compileReleaseJavaWithJavac
Note: /Users/miguel/Projects/main/app/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RenderableShadowNode.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

/Users/miguel/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.0.aar/4d424ba56bd7e2658a57959457dfb2f2/res/values-v24/values-v24.xml:3:5-157: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

/Users/miguel/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.0.aar/4d424ba56bd7e2658a57959457dfb2f2/res/values-v24/values-v24.xml:4:5-135: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

/Users/miguel/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.0.aar/4d424ba56bd7e2658a57959457dfb2f2/res/values-v26/values-v26.xml:13:5-16:13: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-braintree-xplat:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

* 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 6m 36s
185 actionable tasks: 175 executed, 10 up-to-date

最佳答案

好的,我终于通过更新 braintree xplat 库的 build.gradle 解决了这个问题。然后其他库显示相同的错误,所以我不得不手动更新每个库的 build.gradle 文件。

这只会暂时解决我的问题,因为如果我删除我的 node_modules 文件夹并运行 npm install,它将被覆盖。或者,如果其他人克隆了该项目。

关于android - 无法从 React Native 构建发布 APK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51163043/

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