react-native run-android failed M1 - android

~/RNSTAMPY  react-native run-android  1 ✘ ╱ took 41s ╱ at 10:24:15 PM
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
(node:4459) 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 1119 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
Task :app:compileDebugJavaWithJavac FAILED
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.3.3/userguide/command_line_interface.html#sec:command_line_warnings
93 actionable tasks: 2 executed, 91 up-to-date
/Users/leeseungsup/RNSTAMPY/android/app/src/main/java/com/rnstampy/MainActivity.java:2: error: class, interface, or enum expected
package com.rnstampy;
^
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
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 3s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/leeseungsup/RNSTAMPY/android/app/src/main/java/com/rnstampy/MainActivity.java:2: error: class, interface, or enum expected
package com.rnstampy;
^
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
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 3s
at makeError (/Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
at /Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.
run-ios is ok
run-android => android emulator opens but can't install my app.
When I ran android emulator in EXPO cli, it worked well!
but in react-native-cli environment, it doesn't work!!
react-native-cli: 2.0.1
react-native: 0.69.3
please help me~~

I solved my problem.
/Users/leeseungsup/RNSTAMPY/android/app/src/main/java/com/rnstampy/MainActivity.java:2: error: class, interface, or enum expected package com.rnstampy; ^ 1 error
this was my problem.
I moved [package com.rnstampy;] on the TOP. that's all.
It worked.

Related

React Native v0.68 - A problem occurred configuring project ':react-native-async-storage_async-storage'

I had tried everything mentioned in same error question asked earlier but it didn't worked for me.
Please help what is the problem here ?
Thankyou
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flagdid.
Jetifier found 1058 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
Configure project :app
Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
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.3.3/userguide/command_line_interface.html#sec:command_line_warnings
6 actionable tasks: 6 up-to-date
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':react-native-async-storage_async-storage'.
Could not load compiled classes for build file 'D:\aditya\pplwork\1-aditya-training\react-native\rn-igclone\node_modules#react-native-async-storage\async-storage\android\build.gradle' from cache.
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 26s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':react-native-async-storage_async-storage'.
Could not load compiled classes for build file 'D:\aditya\pplwork\1-aditya-training\react-native\rn-igclone\node_modules#react-native-async-storage\async-storage\android\build.gradle' from cache.
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 26s
at makeError (D:\aditya\pplwork\1-aditya-training\react-native\rn-igclone\node_modules\execa\index.js:174:9)
at D:\aditya\pplwork\1-aditya-training\react-native\rn-igclone\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\aditya\pplwork\1-aditya-training\react-native\rn-igclone\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\aditya\pplwork\1-aditya-training\react-native\rn-igclone\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Javadoc generation failed when I try to run React Native on Android Emulator

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':rn-indy-sdk:androidJavadoc'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): '/Users/.../MyProject/node_modules/rn-indy-sdk/android/build/tmp/androidJavadoc/javadoc.options'
* 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 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3m 58s
2306 actionable tasks: 2107 executed, 199 up-to-date
error Failed to build the app.
Error: Command failed: ./gradlew build -x lint
at makeError (/Users/.../MyProject/node_modules/execa/index.js:174:9)
at Function.module.exports.sync (/Users/.../MyProject/node_modules/execa/index.js:338:15)
at buildApk (/Users/.../MyProject/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:181:22)
at runOnSpecificDevice (/Users/.../MyProject/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:162:7)
at buildAndRun (/Users/.../MyProject/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:147:12)
at /Users/.../MyProject/ItdotMobile/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:132:12
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Command.handleAction (/Users/.../MyProject/node_modules/#react-native-community/cli/build/index.js:186:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
When I run yarn run android on a terminal, the build is failed for task ...androidJavadoc.
rn-indy-sdk is a library that I use in my project, so it seems that rn-indy-sdk library cannot be built because of something related to Javadoc.
Where should I start to look at for solving this problem? Thanks.
I also ran into this problem while using a different react native library. The solution is to open the build.gradle file located at node_modules/rn-indy-sdk/android/build.gradle and add this code:
tasks.withType(Javadoc) {
failOnError false
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}

Can't start react-native as app:processDebugMainManifest FAILED

I was following the tutorial from Setting up the development environment configuring the React Native CLI Quickstart of Windows and Android.
Whenever I run the command react-native run-android Metro starts in another CMD and Android Studios opens up, but this error appears in the original CMD.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
(node:12644) 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 896 file(s) to forward-jetify. Using 12 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
> Task :app:processDebugMainManifest FAILED
Error 'C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\outputs\logs\manifest-merger-debug-report.txt (Access is denied)' while writing the merger report file, build can continue but merging activities will not be documented
11 actionable tasks: 2 executed, 9 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> java.io.FileNotFoundException: C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\intermediates\manifest_merge_blame_file\debug\manifest-merger-blame-debug-report.txt (Access is denied)
* 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 2s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> java.io.FileNotFoundException: C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\intermediates\manifest_merge_blame_file\debug\manifest-merger-blame-debug-report.txt (Access is denied)
* 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 2s
at makeError (C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\execa\index.js:174:9)
at C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\#react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.
I used this post and the answer as a reference because I thought it was similar, but I got a similar error from what I got before.
> Task :app:processDebugMainManifest FAILED
Error 'C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\outputs\logs\manifest-merger-debug-report.txt (Access is denied)' while writing the merger report file, build can continue but merging activities will not be documented
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> java.io.FileNotFoundException: C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\intermediates\manifest_merge_blame_file\debug\manifest-merger-blame-debug-report.txt (Access is denied)
* 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 2s
11 actionable tasks: 2 executed, 9 up-to-date
I also want to say that I already ran the command gradlew clean and same error.
Is there something wrong with the gradlew.bat?
It's mentioning as access denied, try to change permission to android folder and see.

Trying to run react-native on real device but error occurred with installDebug

I am trying ro run react native on my android phone but this error occured . I have used react-native-cli.And i have not yet changed the code of the react-native provide.Please help . Thanks in advance
error is here =>
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 8 workers...
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.0.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
What went wrong:
Task 'installDebug' not found in project ':app'.
Try:
Run gradlew tasks to get a list of available tasks. 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 3s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/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:
Task 'installDebug' not found in project ':app'.
Try:
Run gradlew tasks to get a list of available tasks. 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 3s
at makeError (C:\Users\Buntu\Documents\projects\Contactapp\node_modules\execa\index.js:174:9)
at C:\Users\Buntu\Documents\projects\Contactapp\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\Buntu\Documents\projects\Contactapp\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\Buntu\Documents\projects\Contactapp\node_modules\#react-native-community\cli\build\index.js:186:9)
C:\Users\Buntu\Documents\projects\Contactapp>

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