Hello guys, this is becoming a serious problem for me. I have been trying to create release apk file from last 2 weeks but I’m unable to do that due to this issue. It works fine on creating bundle i.e. gradlew bundleRelease. It does not throw any error on creating bundle but it failed to create release apk.
package.json file
Here is my package.json file where all my dependencies are located
{
"name": "edesign",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"build": "npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/",
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/cameraroll": "^4.1.2",
"@react-navigation/drawer": "^6.4.1",
"@react-navigation/native": "^6.0.10",
"@react-navigation/native-stack": "^6.6.1",
"react": "17.0.2",
"react-devtools": "^4.24.4",
"react-native": "0.67.3",
"react-native-admob-next": "^1.2.0",
"react-native-device-info": "^9.0.2",
"react-native-fetch-blob": "^0.10.8",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.4.1",
"react-native-image-crop-picker": "^0.37.3",
"react-native-push-notification": "^8.1.1",
"react-native-reanimated": "^2.8.0",
"react-native-safe-area-context": "3.4.1",
"react-native-screens": "^3.13.1",
"react-native-share": "^7.4.0",
"react-native-vector-icons": "^9.1.0",
"react-native-version-check": "^3.4.3",
"react-native-view-shot": "^3.1.2"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-async-storage/async-storage": "^1.17.3",
"@react-native-community/eslint-config": "^2.0.0",
"@react-native-community/slider": "^4.2.2",
"@react-native-firebase/app": "^14.9.1",
"@react-native-firebase/firestore": "^14.9.1",
"@react-native-firebase/messaging": "^14.9.1",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-native-image-picker": "^4.8.1",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}
android/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
googlePlayServicesVersion = "+" // default: "+"
firebaseVersion = "+" // default: "+"
androidXCore = "1.6.0"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath 'com.google.gms:google-services:4.3.12'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
maven { url 'https://www.jitpack.io' }
}
}
Error 👇
This is the error when I run /android – gradlew assembleRelease 🥺
* What went wrong:
Execution failed for task ':react-native-fetch-blob:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
> Android resource linking failed
ERROR:C:Userslylde.gradlecachestransforms-3aee9ee05966214edc1879619afacf3e1transformedappcompat-1.0.2resvalues-v26values-v26.xml:5:5-8:13: AAPT: error: resource android:attr/colorError not found.
ERROR:C:Userslylde.gradlecachestransforms-3aee9ee05966214edc1879619afacf3e1transformedappcompat-1.0.2resvalues-v26values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.
ERROR:C:Userslylde.gradlecachestransforms-3aee9ee05966214edc1879619afacf3e1transformedappcompat-1.0.2resvalues-v26values-v26.xml:13:5-16:13: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
ERROR:C:Userslylde.gradlecachestransforms-3aee9ee05966214edc1879619afacf3e1transformedappcompat-1.0.2resvalues-v28values-v28.xml:5:5-8:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
ERROR:C:Userslylde.gradlecachestransforms-3aee9ee05966214edc1879619afacf3e1transformedappcompat-1.0.2resvalues-v28values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
ERROR:C:Userslylde.gradlecachestransforms-36659f15da30f261a037980a726c1722dtransformedcore-1.1.0resvaluesvalues.xml:142:5-173:25: AAPT: error: resource android:attr/fontStyle not found.
ERROR:C:Userslylde.gradlecachestransforms-36659f15da30f261a037980a726c1722dtransformedcore-1.1.0resvaluesvalues.xml:142:5-173:25: AAPT: error: resource android:attr/font not found.
ERROR:C:Userslylde.gradlecachestransforms-36659f15da30f261a037980a726c1722dtransformedcore-1.1.0resvaluesvalues.xml:142:5-173:25: AAPT: error: resource android:attr/fontWeight not found.
ERROR:C:Userslylde.gradlecachestransforms-36659f15da30f261a037980a726c1722dtransformedcore-1.1.0resvaluesvalues.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
ERROR:C:Userslylde.gradlecachestransforms-36659f15da30f261a037980a726c1722dtransformedcore-1.1.0resvaluesvalues.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
ERROR:C:Userslylde.gradlecachestransforms-36659f15da30f261a037980a726c1722dtransformedcore-1.1.0resvaluesvalues.xml:174:5-210:25: AAPT: error: resource android:attr/startX not found.
ERROR:C:Userslylde.gradlecachestransforms-36659f15da30f261a037980a726c1722dtransformedcore-1.1.0resvaluesvalues.xml:174:5-210:25: AAPT: error: resource android:attr/startY not found.
ERROR:C:Userslylde.gradlecachestransforms-36659f15da30f261a037980a726c1722dtransformedcore-1.1.0resvaluesvalues.xml:174:5-210:25: AAPT: error: resource android:attr/endX not found.
ERROR:C:Userslylde.gradlecachestransforms-36659f15da30f261a037980a726c1722dtransformedcore-1.1.0resvaluesvalues.xml:174:5-210:25: AAPT: error: resource android:attr/endY not found.
ERROR:C:Userslylde.gradlecachestransforms-36659f15da30f261a037980a726c1722dtransformedcore-1.1.0resvaluesvalues.xml:211:5-217:25: AAPT: error: resource android:attr/offset not found.
2
Answers
Please go to react-native-fetch-blob/android/build.gradle and update these values
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
to these
compileSdkVersion 26
buildToolsVersion "26.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
react-native-fetch-blob
has moved torn-fetch-blob
, Please update your package from here.