我正在尝试为React Native应用程序构建发行版APK。我已经创建了密钥库,并且还按照文档中的建议在build.gradle
文件中添加了信息。
但是它在app:mergeReleaseResources
处停留30-40分钟,没有结果。我尝试使用其他应用程序,这些应用程序过去曾经构建过,但现在无法正常工作。
我什至尝试重新安装Android Studio和SDK,但仍然失败。
请帮忙。
这是日志-
```
gradlew.bat assembleRelease
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.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 '25.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
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..
downloadRobolectricDependencies F:\Projects\react-native\Zest\android\build/robolectric-dependencies
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 (26.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 '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
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 (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.
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.
:app:preBuild UP-TO-DATE
:react-native-navigation:preBuild UP-TO-DATE
:react-native-navigation:preReleaseBuild UP-TO-DATE
:react-native-navigation:checkReleaseManifest
:react-native-navigation:processReleaseManifest
:react-native-splash-screen:preBuild UP-TO-DATE
:react-native-splash-screen:preReleaseBuild UP-TO-DATE
:react-native-splash-screen:checkReleaseManifest
:react-native-splash-screen:processReleaseManifest
:react-native-vector-icons:preBuild UP-TO-DATE
:react-native-vector-icons:preReleaseBuild UP-TO-DATE
:react-native-vector-icons:checkReleaseManifest
:react-native-vector-icons:processReleaseManifest
:app:preReleaseBuild
:react-native-navigation:compileReleaseAidl
:react-native-splash-screen:compileReleaseAidl
:react-native-vector-icons:compileReleaseAidl
:app:compileReleaseAidl
:react-native-navigation:packageReleaseRenderscript NO-SOURCE
:react-native-splash-screen:packageReleaseRenderscript NO-SOURCE
:react-native-vector-icons:packageReleaseRenderscript NO-SOURCE
:app:compileReleaseRenderscript
:app:checkReleaseManifest
:app:generateReleaseBuildConfig
:app:prepareLintJar UP-TO-DATE
:app:mergeReleaseShaders
:app:compileReleaseShaders
:app:generateReleaseAssets
:react-native-navigation:mergeReleaseShaders
:react-native-navigation:compileReleaseShaders
:react-native-navigation:generateReleaseAssets
:react-native-navigation:packageReleaseAssets
:react-native-splash-screen:mergeReleaseShaders
:react-native-splash-screen:compileReleaseShaders
:react-native-splash-screen:generateReleaseAssets
:react-native-splash-screen:packageReleaseAssets
:react-native-vector-icons:mergeReleaseShaders
:react-native-vector-icons:compileReleaseShaders
:react-native-vector-icons:generateReleaseAssets
:react-native-vector-icons:packageReleaseAssets
:app:mergeReleaseAssets
:app:generateReleaseResValues
:app:generateReleaseResources
:react-native-navigation:compileReleaseRenderscript
:react-native-navigation:generateReleaseResValues
:react-native-navigation:generateReleaseResources
:react-native-navigation:packageReleaseResources
:react-native-splash-screen:compileReleaseRenderscript
:react-native-splash-screen:generateReleaseResValues
:react-native-splash-screen:generateReleaseResources
:react-native-splash-screen:packageReleaseResources
:react-native-vector-icons:compileReleaseRenderscript
:react-native-vector-icons:generateReleaseResValues
:react-native-vector-icons:generateReleaseResources
:react-native-vector-icons:packageReleaseResources
:app:mergeReleaseResources
最佳答案
android {
// ...
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
// ...
}
尝试在您的应用模块
build.gradle:
上使用此代码