Search code examples
androidandroid-studioreact-nativeapk

React Native release Stuck at app:mergeReleaseResources


I am trying to build release apk for a react native app. I have created keystore and also added the info in the build.gradle file as suggested in the docs.

But It is getting stuck at app:mergeReleaseResources for 30-40 mins no results. I have tried with different apps, the one's which used to built in the past but its not working now. I even tried reinstalling Android Studio and SDK but its still stuck.

Please help.

here is the log -

```

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

Solution

  • android {
    // ...
    aaptOptions.cruncherEnabled = false
    aaptOptions.useNewCruncher = false
    // ...
    }
    

    Try using this code on your app module build.gradle: