Task :app:bundleDevReleaseJsAndAssets FAILED - android

When i try to run
cd android
./gradlew assemleRelease
This is terminal output
Task :app:bundleDevReleaseJsAndAssets
warning: the transform cache was reset.
Welcome to Metro v0.72.3
Fast - Scalable - Integrated
info Writing bundle output to:, C:\Users\CABBAR\Documents\github repo\TarifistClient\android\app\build\generated\assets\react\dev\release\index.android.bundle
info Writing sourcemap output to:, C:\Users\CABBAR\Documents\github repo\TarifistClient\android\app\build\intermediates\sourcemaps\react\dev\release\index.android.bundle.packager.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 286 asset files
info Done copying assets
'C:\Users\CABBAR\Documents\github' is not recognized as an internal or external command,
operable program or batch file.
Task :app:bundleDevReleaseJsAndAssets FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Script 'C:\Users\CABBAR\Documents\github repo\TarifistClient\node_modules\react-native\react.gradle' line: 286
What went wrong:
Execution failed for task ':app:bundleDevReleaseJsAndAssets'.
Process 'command 'cmd'' finished with non-zero exit value 1
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.
==============================================================================
2: Task failed with an exception.
What went wrong:
java.lang.StackOverflowError (no error message)
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUĀ¦LD FAILED in 1m 29s
6 actionable tasks: 1 executed, 5 up-to-date
PS C:\Users\CABBAR\Documents\github repo\TarifistClient\android>
i have tried :
`cd android` `./gradlew --stop` `./gradlew clean` and
also deleted node_modules and loaded again with `yarn install`
after that when i run `cd android `
`./gradlew assemleRelease` it still same problem.
// also i tried this command `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` but terminal gibing this error:
react-native: The term 'react-native' is not recognized as a name of a cmdlet, function, script file, or
executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Related

React native bundleRelease task fails with error "The resource `index.js` was not found on a monorepo after upgrade from react-native 0.66.0 to 0.68.2

I have a mobile app and a web app for the same application and I use yarn workspaces monorepo to manage the two and the shared code in various packages. I have running this setup for a few months now successfully. I needed to make changes to same config files to get it work but it has been working very well till now.
Today, I updated from react-native 0.66.0 to 0.68.2. I made all the required changes and I am able to run the app in debug mode on iOS and Android. I am also able to build the iOS app successfully. But on Android, I am running into the following error:
warning: the transform cache was reset.
error The resource `/Users/username/Projects/myapp-monorepo/index.js` was not found.
Error: The resource `/Users/username/Projects/myapp-monorepo/index.js` was not found.
at /Users/username/Projects/myapp-monorepo/node_modules/metro/src/IncrementalBundler.js:297:24
at gotStat (node:fs:2654:21)
at FSReqCallback.oncomplete (node:fs:198:21)
info Run CLI with --verbose flag for more details.
> Task :app:bundleReleaseJsAndAssets FAILED
> Task :app:bundleReleaseJsAndAssets_SentryUpload_com.myappapp#7.0.0+7340962_7340962 FAILED
INFO 2022-05-30 19:23:40.400504 +05:30 Loaded config from /Users/username/.sentryclirc
DEBUG 2022-05-30 19:23:40.401302 +05:30 sentry-cli version: 1.74.4, platform: "darwin", architecture: "x86_64"
INFO 2022-05-30 19:23:40.401310 +05:30 sentry-cli was invoked with the following command line: "/Users/username/Projects/myapp-monorepo/node_modules/#sentry/cli/sentry-cli" "--log-level" "debug" "react-native" "gradle" "--bundle" "/Users/username/Projects/myapp-monorepo/packages/GalarmApp/android/app/build/generated/assets/react/release/index.android.bundle" "--sourcemap" "/Users/username/Projects/myapp-monorepo/packages/GalarmApp/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map" "--release" "com.myappapp#7.0.0+7340962" "--dist" "7340962"
error: An organization slug is required (provide with --org)
DEBUG 2022-05-30 19:23:40.401360 +05:30 skipping update nagger because session is not attended
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 1
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload_com.myappapp#7.0.0+7340962_7340962'.
> Process 'command '/Users/username/Projects/myapp-monorepo/node_modules/#sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1
* 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.
As you can see, it is trying to access /Users/username/Projects/myapp-monorepo/index.js and not finding it which of course the file is not there. The file is located in the app monorepo at location /Users/username/Projects/myapp-monorepo/packages/myapp/index.js.
I am not sure where is this coming from so I can fix the corresponding config file. It seems to be related to metro, Sentry and the release build task.
I am totally stuck due to this problem. If you have any pointers, please share.
if anyone is still looking for this answer
the error is
index.js file not found
this happens when we change the index.js file name to index.jsx or index.tsx
to resolve just change the name back to index.js

I got problem because of android enviroment

When I tried to
react-native run-android
I get this error. I don't understand why?? Everything was working fine. I installed all android environment variables
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
(node:7516) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
Jetifier found 1367 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\furkan\FirstProject\FirstProject\node_modules\react-native-navigation\lib\android\app\build.gradle' line: 4
* What went wrong:
A problem occurred evaluating project ':react-native-navigation'.
> Plugin with id 'kotlin-android' not found.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-navigation'.
> compileSdkVersion is not specified.
* 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 7s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

Could not be generated release apk for the react-native project

I am getting these errors
Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
info Writing bundle output to:, C:\KLS
info Writing sourcemap output to:, C:\KLS
error EPERM: operation not permitted, open 'C:\KLS'. Run CLI with --verbose flag for more details.
Error: EPERM: operation not permitted, open 'C:\KLS'
Task :app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
Process 'command 'npx.cmd'' finished with non-zero exit value 1
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 4m 9s
42 actionable tasks: 2 executed, 40 up-to-date
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/
Run this command into the terminal into your project Dir. It will create the assets and adding the drawable files into the assets dir and then
clean Project & Rebuild
Now try to make the release build from android studio.
May be you will get the duplicate resource error. In that case,
remove the drawables folder && raw folder in res dir
Hope it will work.

getting error while creating release apk from react native with gradlew assembleRelease

i want to release the apk but im getting error -file already exists, mkdir 'D:\mobile'.its generating file nameed mobile in the d drive. after deleting the file , executing gradlew assembleRelease again creating this file and throwing error.
Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
info Writing bundle output to:, D:\mobile
info Writing sourcemap output to:, D:\mobile
info Done writing bundle output
info Done writing sourcemap output
info Copying 24 asset files
error EEXIST: file already exists, mkdir 'D:\mobile'. Run CLI with --verbose flag for more details.
Error: EEXIST: file already exists, mkdir 'D:\mobile'
Task :app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
Process 'command 'npx.cmd'' finished with non-zero exit value 1
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
In your scenario I think you haven't made a js bundle so please make a bundle first by using command
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
After that move in to your project's android directory using cd android
Before make release build make sure to clean your gradle using ./gradlew clean
And finally run this command ./gradlew assembleRelease -x bundleReleaseJsAndAssets

ReactNative error: Execution failed for task ':react-native-reanimated:checkDebugManifest'

I started to work on a react native project. But I have a problem now. I built a simple project and execute react-native run-android. But error occurred.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 954 file(s) to forward-jetify. Using 6 workers...
info Starting JS server...
info Installing the app...
> Task :app:createDebugCompatibleScreenManifests FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
40 actionable tasks: 12 executed, 28 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:createDebugCompatibleScreenManifests'.
> Failed to create directory 'E:\web_project\fcManager\app\svn_prj\02_source\fcmanager\android\app\build\intermediates\compatible_screen_manifest\debug\createDebugCompatibleScreenManifests\out'
* 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 7s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run
CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:createDebugCompatibleScreenManifests'.
> Failed to create directory 'E:\web_project\fcManager\app\svn_prj\02_source\fcmanager\android\app\build\intermediates\compatible_screen_manifest\debug\createDebugCompatibleScreenManifests\out'
* 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
And then I cleared the cache by yarn start --reset-cache, and execute again react-native run-android. Error again. But the latter errors are different from the former errors.
What could be a problem?
Wow. I solve the problem.
>cd android
android>./gradlew clean
And then apk is successfully installed on the emulator.

Categories

Resources