npx react-native run-android does not work. "java.io.IOException: The filename, directory name, or volume label syntax is incorrect" - react-native

Just recently ejected expo and I'm trying to run my app on an android device. I followed the instructions (hopefuly right) but I keep getting this error when I try to run my 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.0.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
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. 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:
A problem occurred configuring project ':app'.
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
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 (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\execa\index.js:174:9)
at C:\Users\User\Documents\jad for eject\jad\jad\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\#react-native-community\cli\build\index.js:186:9)

i am just using windows 7 32 bit i am also faced the same problem i solved like
you have local.properties file in your android folder or create one
in that file you have give sdk dir path like
give like this
sdk.dir=C:\\Users\\yourusername\\AppData\\Local\\Android\\Sdk
dont give like
sdk.dir=C:\Users\yourusername\AppData\Local\Android\Sdk
windows does not allow

Related

Build failed with an exception error in react-native-community/cli

i got error after i install npm i #react-native-community/cli-platform-android and uninstall it
i am using the latest react native 0.7.1
$ npx react-native run-android
info Starting JS server...
info Installing the app...
FAILURE: Build failed with an exception.
Where:
Settings file 'C:\Users\ASUS\Documents\contra\android\settings.gradle' line: 2
What went wrong:
A problem occurred evaluating settings 'contra'.
Could not read script 'C:\Users\ASUS\Documents\contra\node_modules#react-native-community\cli-platform-android\native_modules.gradle' as it does not exist.
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 989ms
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.
Where:
Settings file 'C:\Users\ASUS\Documents\contra\android\settings.gradle' line: 2
What went wrong:
A problem occurred evaluating settings 'contra'.
Could not read script 'C:\Users\ASUS\Documents\contra\node_modules#react-native-community\cli-platform-android\native_modules.gradle' as it does not exist.
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 989ms
at makeError (C:\Users\ASUS\Documents\contra\node_modules\execa\index.js:174:9)
at C:\Users\ASUS\Documents\contra\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\ASUS\Documents\contra\node_modules\react-native\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\ASUS\Documents\contra\node_modules\#react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.
i try install it and uninstall it still cant run

macbook m1: error Failed to launch emulator

I use macbook m1 and set sdk in android studio.
I follow all the process: https://reactnative.dev/docs/environment-setup.
But I couldn't understand above process.
when I run this command line from terminal. It says
zsh: command not found: sdkmanager
So I pass that process.
Except for that, I installed all as doc says.
But when I run npx react-native run-android.
Error message below appears.
what is the problem?
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/hayat/Documents/AwesomeProject/android/local.properties'.
* 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
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/hayat/Documents/AwesomeProject/android/local.properties'.
* 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/hayat/Documents/AwesomeProject/node_modules/execa/index.js:174:9)
at /Users/hayat/Documents/AwesomeProject/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/hayat/Documents/AwesomeProject/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/hayat/Documents/AwesomeProject/node_modules/#react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.
Running android emulator on m1 chip requires extra installation steps.
I recommend you to watch this video which might be helpful to your situation.
See this also.

How to run with --stracktrace option so that I can run react-native-cli project

I have a question about running React-native-cli project. When I ran this command: npx react-native run-android , it returned this result:
info Installing the app...
> Task :app:generatePackageList 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.1.1/userguide/command_line_interface.html#sec:command_line_warnings
1 actionable task: 1 executed
FAILURE: Build failed with an exception.
* Where:
Script 'D:\IT\React.js\JAMK\e06Movies\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 131
* What went wrong:
Execution failed for task ':app:generatePackageList'.
> argument type mismatch
* 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 6s
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.
* Where:
Script 'D:\IT\React.js\JAMK\e06Movies\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 131
* What went wrong:
Execution failed for task ':app:generatePackageList'.
> argument type mismatch
* 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 6s
at makeError (D:\IT\React.js\JAMK\e06Movies\node_modules\execa\index.js:174:9)
at D:\IT\React.js\JAMK\e06Movies\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async runOnAllDevices (D:\IT\React.js\JAMK\e06Movies\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (D:\IT\React.js\JAMK\e06Movies\node_modules\#react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.
I have added --stacktrace in Android Studio by this instruction: "https://stackoverflow.com/questions/21674091/how-to-add-stacktrace-or-debug-option-when-building-android-studio-project" but it didn't work at all.
Can someone suggest to me some solutions for this problem? Thank you very much!!
npx react-native run-android --verbose

i just installed react native using choco and i keep getting this error everytime i run "npx react-native run-android" on cmd

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 10s
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
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 10s
at makeError (C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\execa\index.js:174:9)
at C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)

Task: installdebug not found in the project app

I got this error I can't able to fix that
enter image description here
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
Any one pls help me...