for some reason my App wont start up on my AS Emulator. Yesterday everything was working great but today it doenst work - might be because I moved npm and npm-cache folder but they are set correctly with npm config.
Metro server starts OK and if I just selected the app it would load it up but now it insta crashes..
If I try to run npm android I am getting the error below:
PS C:\Dev\Programmierung\FitnessApp\FitnessApp> npm run android
> FitnessApp#0.0.1 android C:\Dev\Programmierung\FitnessApp\FitnessApp
> react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1158 file(s) to forward-jetify. Using 6 workers...
info Starting JS server...
Der Befehl "adb" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
info Launching emulator...
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...
> Task :app:transformClassesWithDexBuilderForDebug FAILED
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
147 actionable tasks: 3 executed, 144 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> Unable to delete directory 'C:\Dev\Programmierung\FitnessApp\FitnessApp\android\app\build\intermediates\transforms\dexBuilder\debug\0\androidx\appcompat' after 10 attempts
* 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 17s
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:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> Unable to delete directory 'C:\Dev\Programmierung\FitnessApp\FitnessApp\android\app\build\intermediates\transforms\dexBuilder\debug\0\androidx\appcompat' after 10 attempts
* 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 17s
at makeError (C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\execa\index.js:174:9)
at C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async runOnAllDevices (C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! FitnessApp#0.0.1 android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the FitnessApp#0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Dev\npm\npm-cache\_logs\2020-04-24T08_01_58_811Z-debug.log
The fixx for me was to:
cd android
./gradlew clean
and rebuild app twice
Related
I'm trying to create a web application using React JS that has a push-to-talk (PTT) feature on it.
One of the technologies that we will use is Mumble.
The demo https://voice.johni0702.de/?address=voice.johni0702.de&port=443/demo on this https://github.com/Johni0702/mumble-web repository is working fine.
I tried to run the repository on my local computer but got some different errors.
Installation Errors
I cloned and tried to install all of the libraries on the root folder of the repository using the npm install command on my local computer with Windows OS and Node JS v16 but I got this error below.
verbose stack Error: command failed
verbose stack at ChildProcess.<anonymous> (C:\Users\LENOVO\AppData\Roaming\nvm\v16.18.0\node_modules\npm\node_modules\#npmcli\promise-spawn\lib\index.js:63:27)
verbose stack at ChildProcess.emit (node:events:513:28)
verbose stack at maybeClose (node:internal/child_process:1100:16)
verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
verbose pkgid mumble-client-websocket#1.0.0
verbose cwd C:\Users\LENOVO\AppData\Local\npm-cache\_cacache\tmp\git-cloneZtPlJ2
verbose Windows_NT 10.0.22621
verbose node v16.18.0
verbose npm v8.19.2
error code 1
error path C:\Users\LENOVO\AppData\Local\npm-cache\_cacache\tmp\git-cloneZtPlJ2
error command failed
error command C:\WINDOWS\system32\cmd.exe /d /s /c npm run compile
verbose exit 1
timing npm Completed in 8638ms
verbose code 1
Then I switched the Node JS version using the NVM from v16 to v14.
I tried to install all of the libraries on the repository using the npm install command again but then got another different error.
verbose stack Error: mumble-web#0.5.1 prepare: `rm -rf dist && npm run build`
verbose stack Exit status 1
verbose stack at EventEmitter.<anonymous> (C:\Users\LENOVO\AppData\Roaming\nvm\v14.21.2\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
verbose stack at EventEmitter.emit (events.js:400:28)
verbose stack at ChildProcess.<anonymous> (C:\Users\LENOVO\AppData\Roaming\nvm\v14.21.2\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
verbose stack at ChildProcess.emit (events.js:400:28)
verbose stack at maybeClose (internal/child_process.js:1088:16)
verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
verbose pkgid mumble-web#0.5.1
verbose cwd D:\A.ing\Works\Others\Lacak-and-Valid\Exercises\React-Js\mumble-web-2
verbose Windows_NT 10.0.22621
verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
verbose node v14.21.2
verbose npm v6.14.17
error code ELIFECYCLE
error errno 1
error mumble-web#0.5.1 prepare: `rm -rf dist && npm run build`
error Exit status 1
error Failed at the mumble-web#0.5.1 prepare script.
error This is probably not a problem with npm. There is likely additional logging output above.
verbose exit [ 1, true ]
I tried to delete the "prepare": "rm -rf dist && npm run build", code (line 45) on the package.json file.
I didn't know whether deleting the code would have an impact on running the app later or not.
I also searched on the internet and found this answer https://stackoverflow.com/a/62744648/8339172 to clear the npm cache, regenerate the package-lock.json file, and delete the node_modules folder.
I did all of them then I ran the "npm install" command again.
This time, there was no error.
Runtime Errors
Continuing the previous section, I tried to run the root of the repository by running the npm run watch command.
I didn't know whether this was correct or not because I usually enter the npm start command to run a React JS locally.
I didn't see any port configured on the package.json file so I opened the localhost:8080 address on my browser.
Unfortunately, there was nothing there. The browser said This site can’t be reached. localhost refused to connect.
The App Folder
Continuing the previous section, I tried to run the index.html file on the app folder by double-clicking on the file.
It seemed that the app crashed because I saw there was an error on the browser console as seen in this screenshot below.
Here is the error message:
Uncaught SyntaxError: Cannot use import statement outside a module (at index.js:1:1)
Questions
I want to learn how to create the demo (https://voice.johni0702.de/?address=voice.johni0702.de&port=443/demo) on the repository https://github.com/Johni0702/mumble-web. My questions are:
Which one is the source code of the demo app? Is it from the root folder of the repository or the app folder?
Continuing the first question, how to install all of the required dependencies for the demo app locally?
Continuing the first and second questions, how to run the demo app locally?
Environment
OS: Windows 11
Node: 14.21.2, 16.18.0, and 18.13.0 (switchable)
Finally, I could run the app (root level) on my computer.
From the installation error section, we could see that this error verbose stack Error: mumble-web#0.5.1 prepare: `rm -rf dist && npm run build` happened when a Windows-based computer tried to run a Unix-based command. There is no rm command on the Windows computer.
So I tried to install the WSL on my Windows computer https://techcommunity.microsoft.com/t5/windows-11/how-to-install-the-linux-windows-subsystem-in-windows-11/td-p/2701207.
After strugling with the WSL installation, I could run the npm install command on the app and no error message appeared.
But then I didn't know how to run the app. Fortunately, we found another similar repository that has the start script here https://github.com/Theofilos-Chamalis/mumble-web. Using the npm install and npm start, I finally could run a mumble implementation the frontend app.
Note: the app from the https://github.com/Theofilos-Chamalis/mumble-web was not updated like the https://github.com/Johni0702/mumble-web one but I think that's another issue from this question.
Installing wdio packages:
- #wdio/local-runner
- #wdio/mocha-framework
- #wdio/spec-reporter
- wdio-chromedriver-service
- chromedriver
npm WARN deprecated #types/easy-table#1.2.0: This is a stub types definition. easy-table provides its own type definitions, so you do not need this installed.
added 115 packages, and audited 459 packages in 13s
92 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Packages installed successfully, creating configuration file...
Config file installed successfully, creating test files...
Configuration file was created successfully!
To run your tests, execute:
$ npx wdio run wdio.conf.js
Adding "wdio" script to package.json.
Unknown command: "set-script"
Did you mean this?
npm run-script # Run arbitrary package scripts
To see a list of supported npm commands, run:
npm help
file:///C:/Users/User/AppData/Local/npm-cache/_npx/46b5fbaa5aefb2df/node_modules/create-wdio/build/utils.js:19
return reject(new Error((error && error.message) ||
^
Error: Error calling: npm set-script wdio wdio run wdio.conf.js
at ChildProcess.<anonymous> (file:///C:/Users/User/AppData/Local/npm-cache/_npx/46b5fbaa5aefb2df/node_modules/create-wdio/build/utils.js:19:31)
at ChildProcess.emit (node:events:513:28)
at cp.emit (C:\Users\User\AppData\Local\npm-cache\_npx\46b5fbaa5aefb2df\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5)
Node.js v18.12.1
npm ERR! code 1
npm ERR! path C:\Users\User\Downloads\webdriverio
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c create-wdio .
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2022-11-26T14_16_31_932Z-debug-0.log
I don't understand why did I get such errors? Now I'll try to describe you detailed what I did I made several steps:
Download the latest node.js version via https://nodejs.org/en/download/
I set NODE_HOME in system variables
Created empty folder
Opened empty folder in command prompt, (cd 'path to this empty folder')
Wrote 'npm init wdio .' into the command prompt
Then I just chose the default options
I was waiting and such errors appeared
I tried to update npm to the latest version. It doesn't help.
i am new to react-native cli
any time i run npm run android in my react-native project after opening the emulator and js server
while it throws an error saying
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\HP\Desktop\native1\node_modules\react-native-gradle-plugin\build.gradle.kts' line: 11
in full
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\HP\Desktop\native1\node_modules\react-native-gradle-plugin\build.gradle.kts' line: 11
* What went wrong:
Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.6.10'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (None of the included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.10')
Searched in the following repositories:
MavenRepo
Google
Gradle Central Plugin Repository
* 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 11m 1s
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:
Build file 'C:\Users\HP\Desktop\native1\node_modules\react-native-gradle-plugin\build.gradle.kts' line: 11
* What went wrong:
Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.6.10'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (None of the included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.10')
Searched in the following repositories:
MavenRepo
Google
Gradle Central Plugin Repository
* 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 11m 1s
at makeError (C:\Users\HP\Desktop\native1\node_modules\execa\index.js:174:9)
at C:\Users\HP\Desktop\native1\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async runOnAllDevices (C:\Users\HP\Desktop\native1\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\HP\Desktop\native1\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! native1#0.0.1 android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the native1#0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Roaming\npm-cache\_logs\2022-06-01T14_25_45_278Z-debug.log
any sugestion will be highly appreciated
This part is the interesting:
Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.6.10'] was not found in any of the following sources:
The same question here.
In your project gradle file,
change
org.jetbrains.kotlin.jvm
to
org.jetbrains.kotlin.android
Maybe this will help.
Basically, gradle could not find the kotlin plugin dependency in any of the sources.
If you're like me trying to get Android/Google TV development with React Native running. Make sure you add this "Android TV ARM 64 v8a System Image (if you chose a Android TV as emulator). That seemed to do the trick for me.
So I am trying to run a simple react-native app on an iPhone 11 - 13.2.2 emulator.
I type npm run ios but I get this back.
** BUILD FAILED **
The following build commands failed:
CompileC /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/build/confusion/Build/Intermediates.noindex/confusion.build/Debug-iphonesimulator/confusion.build/Objects-normal/x86_64/AppDelegate.o /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/confusion/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/build/confusion/Build/Intermediates.noindex/confusion.build/Debug-iphonesimulator/confusion.build/Objects-normal/x86_64/main.o /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/confusion/main.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # ios: `react-native run-ios`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # ios script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/theodosiostziomakas/.npm/_logs/2019-11-16T12_38_06_754Z-debug.log
I used npm install but still nothing. How to fix that error?
Thanks,
Theo.
alternatively you can run from the workspace file, sometimes running from npm in ios will not give you the exact error.
You have to run the following file in your workspace and select the simulator/iphone and finally launch the project.
Path to the workspace :- ProjectFolder/ios/projectname.xcworkspace
I have a node app that has been live on Heroku for a year, but the last update is now crashing on build. I haven't seen this error before and can't find any help.
Here is the error log:
yarn run v1.12.3
$ react-scripts build
Creating an optimized production build...
Failed to compile.
./src/components/Admin_Navigation/navigation.css
Module build failed: Error: Unexpected "space" found.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sonar#1.0.0 heroku-postbuild: `yarn build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sonar#1.0.0 heroku-postbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.22xgq/_logs/2018-11-22T00_36_38_522Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Dangerous semver range (>) in engines.node
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
I've tried the following:
Update Yarn Lock
Update package.JSON
Updated Yarn & Node versions
Any of your thoughts are appreciated. Thanks
Update: this is caused by an unnecessary space in CSS. You can manually look through the CSS for the space, or a less optimal solution is to roll back Node to a version that is less syntax-rigid.
I faced a similar problem to this, what helped me was to go line by line in searching for the problem, and in the end it was an unintended space between : and hover in the CSS file that was causing the problem.
It was surprising since that code I never changed and it was working before but the solution was to actually find the space being talked about in my CSS file.