facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.4k stars 24.25k forks source link

Execution failed for task ':app:mergeReleaseResources #27805

Closed rajupushpad closed 4 years ago

rajupushpad commented 4 years ago

i am getting error when making release build for my app. error is -> `Task :app:processReleaseGoogleServices Parsing json file: /home/raju/Desktop/Work/Completed/abms/Upgraded/akhil_bhartiya_mali_samaj_sangh_social_app/android/app/google-services.json

Task :app:mergeReleaseResources FAILED

FAILURE: Build failed with an exception.

BUILD FAILED in 3m 4s 47 actionable tasks: 47 executed ` React Native version: "dependencies": { "@react-native-community/async-storage": "^1.7.1", "@react-native-community/masked-view": "^0.1.6", "@react-native-community/netinfo": "^5.3.3", "axios": "^0.19.1", "moment": "^2.24.0", "react": "^16.9.0", "react-native": "^0.61.5", "react-native-firebase": "^5.6.0", "react-native-gesture-handler": "^1.5.3", "react-native-image-crop-picker": "^0.26.2", "react-native-picker-select": "^6.3.3", "react-native-reanimated": "^1.7.0", "react-native-safe-area-context": "^0.6.2", "react-native-spinkit": "^1.5.0", "react-native-vector-icons": "^6.6.0", "react-navigation": "^4.0.10", "react-navigation-drawer": "^2.3.3", "react-navigation-stack": "^2.0.15", "react-redux": "^7.1.3", "redux": "^4.0.5", "redux-form": "^8.2.6", "redux-logger": "^3.0.6", "redux-thunk": "^2.3.0" },

Steps To Reproduce

  1. project directory/cd android
    2../gradlew bundleRelease

react-native run-android working fine, means dev apk is working on device but, release apk is not build and failed with above statemets.

How i can solve this issue ? raju

AmrAbdalrahman commented 4 years ago

also with me, I tried ./gradlew bundleRelease i get image

rajupushpad commented 4 years ago

Hi @AmrAlmagic, I had found the solution of this issue.

There may be some images in your source file which is not readable. so just delete it and re build your project.

Thanks

AmrAbdalrahman commented 4 years ago

@rajupushpad please, what's the paths that I have to check and delete?

Spencillian commented 4 years ago

@AmrAlmagic you seem to have a different problem. It seems like your issue has to do with :app:bundleReleaseJsAndAssets

You should try asking for help on StackOverflow.

zieglerphilipp commented 4 years ago

You have to put this as the beginning tag of your config.xml if you use this: https://www.npmjs.com/package/vue-cli-plugin-cordova

<widget id="com.demo.app" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android">

zieglerphilipp commented 4 years ago
<widget id="com.demo.app" 
    version="1.0.0" 
    xmlns="http://www.w3.org/ns/widgets" 
    xmlns:cdv="http://cordova.apache.org/ns/1.0" 
    xmlns:android="http://schemas.android.com/apk/res/android">
MussadiqAli commented 3 years ago

Hi @AmrAlmagic, I had found the solution of this issue.

There may be some images in your source file which is not readable. so just delete it and re build your project.

Thanks

Thanks. It's working. There was an image file that was not readable, I changed it, now it's working perfectly.

anditorx commented 3 years ago

Try this :

  1. Delete build inside android/app folder

  2. Delete build inside android folder

  3. run rm -rf $HOME/.gradle/caches/

  4. Open build.gradle --> android/app/build.gradle

  5. comment this line //apply from: "../../node_modules/react-native/react.gradle"

  6. Delete index.android.bundle file from assets folder and re-create using 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

  7. run react-native run-android Or run react-native run-android --variant=release