I want to build Android release but I keep getting the same error no matter what I try.
Here is the error output
/app/build/generated/assets/react/release/index.android.bundle
bundle: Done writing bundle output
bundle: Copying 9 asset files
bundle: Done copying assets
> Task :app:bundleReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:bundleReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
Output: /Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:19: error: resource mipmap/ic_launcher (aka com.characters:mipmap/ic_launcher) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:19: error: resource string/app_name (aka com.characters:string/app_name) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:19: error: resource mipmap/ic_launcher (aka com.characters:mipmap/ic_launcher) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:19: error: resource style/AppTheme (aka com.characters:style/AppTheme) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:27: error: resource string/app_name (aka com.characters:string/app_name) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:54: error: resource xml/provider_paths (aka com.characters:xml/provider_paths) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:59: error: resource style/Theme.AppCompat.Light.NoActionBar (aka com.characters:style/Theme.AppCompat.Light.NoActionBar) not found.
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml:67: error: resource integer/google_play_services_version (aka com.characters:integer/google_play_services_version) not found.
error: failed processing manifest.
Command: /Users/abdul-elah/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/5141019c42220d362e7004555d4c86c4/aapt2-3.2.1-4818971-osx/aapt2 link --proto-format\
-I\
/usr/local/share/android-sdk/platforms/android-28/android.jar\
--manifest\
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/merged_manifests/release/processReleaseManifest/merged/AndroidManifest.xml\
-o\
/Users/abdul-elah/Projects/characters/characters/android/app/build/intermediates/linked_res_for_bundle/release/bundleReleaseResources/bundled-res.ap_\
--auto-add-overlay\
-0\
apk\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0
* 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 1m 35s
46 actionable tasks: 3 executed, 43 up-to-date
here is my manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.characters">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
I tried editing the compilesdkversion and the react-native-device-info; I tried several solutions, the app is working perfectly on debug mode, but not when I try to run ./gradlew bundleRelease