React-Native assembleRelease failed for task ":app:bundleReleaseJsAndAssets" (2023)

React-Native assembleRelease failed for task ":app:bundleReleaseJsAndAssets"– Even if we have a good project plan and a logical concept, we will spend most of our time fixing bugs in javascript and android. Our application can also run without obvious JavaScript errors, we have to use several methods to make sure everything works correctly. Generally speaking, there are two types of errors you can encounter if you do something wrong in your code:Syntax errors and logical errors.To facilitate troubleshooting, any JavaScript error is caught with a full string trace and a specific line of source code highlighted. To help you fix the JavaScript error, see the discussion below to fix the React-Native assembleRelease error for the ":app:bundleReleaseJsAndAssets" task.

Problem:

when I run./gradlew assemblerenReleasethe build failed with this error:

wrong:ExecutionlostRadetask':app:bundleReleaseJsAndAssets. > There was a problem starting the process'Teams'knot'

I've searched the internet and found some threads about it, but I haven't been able to solve my problem.

Wersja React native: 0.54.0

EDIT:
I'm running now./gradlew assembleRelease --infofrom terminal instead of Android Studio and I get another error.
Here are the results:

>Task:application:procesReleaseResourcesto makejob artifact statusRadetask":app:procesReleaseResources"in context0,007secs.datoteka karte"**/android/application/libraries"and no file or folder found„**/node_modules/appcenter-crashes/android/libs”and no file or folder found„**/node_modules/appcenter-analytics/android/libs”and no file or folder found„**/node_modules/appcenter/android/libs”and no file or folder found„**/node_modules/react-native-interactable/lib/android/libs”and no file or folder found„**/node_modules/react-native-navigation/android/app/libs”and no file or folder found"**/android/application/libraries"and no file or folder found„**/node_modules/appcenter-crashes/android/libs”and no file or folder found„**/appcenter-analytics/android/libs”and no file or folder found„**/node_modules/appcenter/android/libs”and no file or folder found„**/node_modules/react-native-interactable/lib/android/libs”and no file or folder found„**/node_modules/react-native-navigation/android/app/libs”, not foundExecutiontask":app:procesReleaseResources"(Check0,035seconds).Rade:Taskpreviously failed.alreadyinput files are taken into accountz- the factsRadeincremental work":app:procesReleaseResources".He is not capable of Radeincreasingexecution: The entire file or folder to start the job"**/android/application/libraries"and no file or folder found„**/node_modules/appcenter-crashes/android/libs”and no file or folder found„**/node_modules/appcenter-analytics/android/libs”and no file or folder found„**/node_modules/appcenter/android/libs”and no file or folder found„**/node_modules/react-native-interactable/lib/android/libs”and no file or folder found„**/node_modules/react-native-navigation/android/app/libs”and no file or folder found"**/android/application/libraries"and no file or folder found„**/node_modules/appcenter-crashes/android/libs”and no file or folder found„**/node_modules/appcenter-analytics/android/libs”and no file or folder found„**/node_modules/appcenter/android/libs”and no file or folder found„**/node_modules/react-native-interactable/lib/android/libs”and no file or folder found„**/node_modules/react-native-navigation/android/app/libs”, not foundAapt2QueuedResourceProcessoruse **/Android/sdk/buildtools/26.0.2/aapt2lostrun aaptcom.android.idea.Ordinary.trial.Process exception:lostaapt*** runningKEEPING:Buildlostzexception.*Coimportmalicious:ExecutionlostRadetask":app:procesReleaseResources".>lostperform in an appropriate manner

It seems that gradle is looking for a libs folder in all modules, but there is no libs folder in the node modules. That's true, but I don't know why Gradle is looking for the libs folder.

Solution:

First:

reactiepakket original --Android-platform --devLIE--index of input file.js-- izlaz paketa Android/app/src/main/assets/index.android.package--assets-dest android/app/src/main/res

finally build:

./gradlew assembleRelease -x bundelReleaseJsAndAssets

It seems you have not created a js bundle, so first create a bundle using the command:-

reactiepakket original --Android-platform --devLIE--index of input file.js-- izlaz paketa Android/app/src/main/assets/index.android.package--assets-dest android/app/src/main/res

then in the project folder

cd puts android

Delete your degree

(Video) Android : React-Native assembleRelease fails for task ':app:bundleReleaseJsAndAssets'

./rated clean

and finally wake up

./gradlew compileDebug

Try it.
I hope it helps you.

The package creation failed for me, but I noticed this commentSahin Elidemir:

upravo me ./gradlew assembleRelease -x bundleReleaseJsAndAssets spasio.

It almost worked for me. What finally worked was (note theapplication:, without which I cannot succeed, and abeautifulJust so you know):

./rated cleanapplication:assembleRelease -x bundelReleaseJsAndAssets

Just use it./gradlew --stopand then./gradlew assemblerenReleaseworked for me.

I had the same problem, the solution was:

CDRadeYour app/Androidduration

Run it

./gradlew --stop

and then

./gradlew assemblerenRelease

This will build your app.

Once the build is complete go to your app (apk).

(Video) error message : Task :app:installDebug FAILED | React Native Errors | Fixed!

androidappbuildoutputsapkrelease

It works for me, follow the steps below:-

1) Gradually stop running

$cdRectNatoveProjectName& cd-android (openyour project and go to the Android folder) $ ./gradlew --stop (Start Tiencommand to stop the old activityDegreesjob)

2) Update the build number of your Android app

Project.int.answer= [ nodeExecutableAndArgs : ["/usr/local/bin/node"]];

3) Get node details

$ which node

> (The result will be similar to "/usr/username/.nvm/versions/node/v10.7.0/bin/node")

4) Connecting node (very simp step copy above the result in step 3)

- ln -s /usr/username/.her/versions/node/v10.7.0/bin/čvor /usr/local/bin/čvor

5) If there is a recovery file step-4
– then go to the /usr/local/bin/ folder and delete the "node" file and repeat step -4.

6) If step - 4 is successful, the node problem is solved.

Now it is late. maybe it will help someone.

As for me, I had to update to the latest versionnative sentinel response.

usez:"../../node_modules/react-native-sentry/sentry.gradle"

was a problem

The above steps really helped.

(Video) Android : React Native Failed to capture snapshot of input files for task 'bundleReleaseJsAndAssets

These are the scripts we work withoriginal answer 0.55.3.

LoopAndroid-madelocal or CI command to generate APK file.

/pakketten.json(answers originally):

"Android Packed":„react-native bundel --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","android patch releases":"node ./android-release-gradle-fix.js","Android Version":"killbin yarn && android-clean yarn && android-release-fix yarn && android-bundle yarn && cd android && ./gradlew assembleRelease -x bundleReleaseJsAndAssets --info","Clean Android":"cd android && ./gradlew clean","kill container":"rm -rf ./node_modules/.bin",

android-release-gradle-fix.js:

artf =need("FS")// Fix problems with Android resources such as duplicate files// CI: run the install with --unsafe-perm// https://stackoverflow.com/questions/47084810/react-native-android-duplicate-file-error-when-generating-apkto attempt{he wascurDir = __nazwakcatalogushe wasroot = process .cwd()he wasstock =`${root directory}/node_modules/react-native/react.gradle` he wasDataFix = fs.file reading synchronization(`${curDir}/android-reageer-gradle-fix`,'utf8')he wasto = fs.file reading synchronization(duration,'utf8')he wasmakeLast ="last {" I(daan.Content(last) !== -1) {throw "Already settled."}he wasresult = data .to replace(/ // Configure inputs and outputs to allow gradle to cache the /g result, DataFix); fs.write FileSync(file, result,'utf8')console.log('done')}to catch(wrong) {console.wrong(wrong) }

android-react-gradle-fix

toLast { def moveFunc = { resSuffix ->Durationsource directory =duration("${resourcesDir}/drawable-${resSuffix}")I(original directionconsists of()) {DurationstartDir =duration("${resourcesDir}/drawable-${resSuffix}-v4") More.to wear(duration: original direction,to a file: startDir) } } moveFunc.kerrie(„ldpi”).phone call() scroll function.kerrie("mdpi").phone call() scroll function.kerrie(„HDPI”).phone call() scroll function.kerrie("xhdpi").phone call() scroll function.kerrie("xxhdpi").phone call() scroll function.kerrie(„xxxhdpi”).phone call()}// Configure inputs and outputs to allow gradle to cache the result

/android/build.gradle:

buildscript { ext { buildToolsVersion =„27.0.3”minSdkVersion =21buildSdkVersie =27target SDK version =27supportLibVersie ="27.1.1"googlePlayServicesVersion ="15.0.1"androidMapsUtilsVersion =„0,5+”}...subprojecten { afterEvaluate {project ->I(Project.has property("Android")) { android { kompilacjaSdkVersion27buildToolsVersion„27.0.3”} } }}

/android/app/build.gradle:

dependencies { implementationProject(":amazon-recognized-identity-js") implementationProject(':appcenter-push') implementationProject(':reageer-native-fbsdk')implementation(Project(':react-native-google-signin')) { excludingGroup:„com.google.android.gms” // very important} implementationProject(":react-native-photopicker") implementationProject(':react-native-vector-icons') implementationProject(':reageer-native-wartownik') implementationProject(':react-native-cards') implementation„com.google.android.gms:play-services-auth:$googlePlayServicesVersion” // Sign in with GoogleimplementationProject(':reageer-native-wartownik')implementation(Project(':react-native-cards')) { excludingGroup:„com.google.android.gms”,module:'play-service-basis'to turn it offGroup:„com.google.android.gms”,module:"play-services-maps"} implementation„com.google.android.gms:play-services-base:$googlePlayServicesVersion”implementation„com.google.android.gms:play-services-maps:$googlePlayServicesVersion”implementation„com.google.firebase:firebase-core:15.0.2”implementation„com.google.firebase:comunikaty-firebase:15.0.2”implementationProject(':react-native-vector-icons') implementationfileTree(clutch: ['*.capable'],richt:"libraries") implementation„com.android.support:appcompat-v7:$supportLibVersion”implementation„com.facebook.react:react-native:+” // implementation of "com.android.support:$supportLibVersion"}

if you're on macOS and responding natively, try this:

  1. brewer's native-cli installation response

  2. ./gradlew --stop

  3. ./rated clean

  4. ./gradlew aRLub./gradlew assemblerenRelease

I did it like this and it works:

  • Removed node modules (you can do this by running this commandrm -rf node_modules)
  • Startinstallation aslLubyarn installation
  • Ren Dan./rated clean&&./gradlew app:assembleReleaseLubApplication ./gradlew:assembleDebug

As of RN 0.58, the CI build commands are:

First create the folders:

mkdir -p app/build/generated/assets/react/production/release/ && mkdir -p app/build/generated/res/react/production/release

the following:

knooppunt ../node_modules/react-native/local-cli/cli.js bundel --platforma android --dev false --entry-file index.android.js --bundle-output app/build/generated/assets/react /productie/release/index.android.bundle --assets-dest app/build/generated/res/react/production/release --max-workers 1 --reset-cache

You may also want to add to your build production according toTien;

--minification true

Comes fromRN-bron

NOTE: We have added--max-employees 1in order not to exhaust CI resources as they are limited to smaller numbers (mem&cpu).

(Video) Android : Error Execution failed for task ':app:mergeReleaseResources' building APK

Consider checking all JS (react native). I ran into this problem because I have a coding error in my JS file (React native).

For me:

  • Operation system:ramen.
  • I just copied the .keystore file into the Android app.
  • cd android && gradlew --stopIrelease of the progressive assembly.

if you run these commands in VS Code,
Just open the project in cmd (admin mode) in the android folder
$clean gradually
$ Progressive release circuit

I had the same problem. In my case, after a few hours I saw this on GitHub:https://github.com/getsentry/sentry-react-native/issues/578#issuecomment-503428032.
I renamed the project to Sentry. If you renamed the project to , update the fileandroid/sentry.propertiesandios/sentry.propertiesduration.

standard.URL=https://sentry.io/standard.org= your organization's default values.Project= new name of the project aut.sign=

And that's all

(Video) how to generate release apk and aab file in react native | React Native | Mr DevGeek | Malik Aamir

Videos

1. Could not find method compile() for arguments [com.facebook.react:react-native:+] on object
(Technical Rajni)
2. How to create Signed apk in react native
(Krishna Ojha)
3. Android : Error:Execution failed for task ':app:packageRelease'. Unable to compute hash of /../And
(Knowledge Base)
4. React Native - Generating APK & Android App Bundle for Google Play Store
(JAS ACADAMY)
5. Installing React Native and Running First React Native App
(Jatinder Verma)
6. 07-Deploying the App in React Native | Generating signed APK for Android
(KickStart)

References

Top Articles
Latest Posts
Article information

Author: Stevie Stamm

Last Updated: 24/09/2023

Views: 5425

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Stevie Stamm

Birthday: 1996-06-22

Address: Apt. 419 4200 Sipes Estate, East Delmerview, WY 05617

Phone: +342332224300

Job: Future Advertising Analyst

Hobby: Leather crafting, Puzzles, Leather crafting, scrapbook, Urban exploration, Cabaret, Skateboarding

Introduction: My name is Stevie Stamm, I am a colorful, sparkling, splendid, vast, open, hilarious, tender person who loves writing and wants to share my knowledge and understanding with you.