【发布时间】:2018-09-03 14:39:00
【问题描述】:
我使用 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
【问题讨论】:
-
有一个类似的错误,不确定它是否与您的问题完全相关,但如果是,您是否尝试过从应用程序 res 文件夹中删除所有以 drawable* 开头的文件夹的修补程序? (不要完全删除它们,否则您的应用在开发时会缺少资源)
-
@AleksandrMedvedev 删除它们但不完全删除它们是什么意思?想保留文件的备份?在我的 res 文件夹中,我有 5 个文件夹,命名为; mipmap-hdpi、mipmap-mdpi、mipmap-xhdpi、mipmap-xxhdpi 和值
-
正确。由于您无论如何都没有它们,我认为我的建议是错误的。很抱歉造成混淆。
标签: android react-native gradlew