Build (React native) Android app and generate .apk file by using turtle cli from azure devops pipeline - react-native

I am trying to build Android app by using turtle cli for this i am using below script.
![258988-image.png][1]
npm install -g turtle-cli
turtle cli has installed and build also started but failing at building section, i am getting below error.
I am stuck guys, Could you please guide me where i am doing mistake. Let me know if you need more information.
error:
Nov 9 13:06:46 turtle[19222] ERROR: Failed to build standalone app
err: Error: ./gradlew exited with non-zero code: 1
at ChildProcess.completionListener (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-cli/node_modules/#expo/xdl/node_modules/#expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:520:26)
at ChildProcess.emit (events.js:400:28)
at ChildProcess.emit (domain.js:475:12)
at maybeClose (internal/child_process.js:1088:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
...
at spawnAsync (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-
cli/node_modules/#expo/xdl/node_modules/#expo/spawn-async/src/spawnAsync.ts:26:19)
at spawn Async Throw Error (/#expo/xdl#59.2.1/src/detach/ExponentTools.ts:111:19)
at build Shell App sync (/#expo/xdl#59.2.1/src/detach/AndroidShellApp.js:1494:11)
at Object.create Android Shell AppAsync (/#expo/xdl#59.2.1/src/detach/AndroidShellApp.js:382:5)
at runShellAppBuilder (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/builders/android.ts:99:5)
at buildAndroid (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/builders/android.ts:31:26)
at /Users/runner/hosted tool cache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/bin/utils/builder.ts:87:7
at Command. (/Users/runner/hosted tool cache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/bin/index.ts:23:12)
platform: "android"

Related

Running npx create-expo-module results in "Error: npm exited with non-zero code: 1"

I'm trying to create my own Expo module following the instructions in the Expo documentation.
When I run the command npx create-expo-module and I fill out the information that it asks me for (name of npm package, module name, GitHub profile, etc.), it manages to do the first two steps of the module creation:
✔ Downloaded module template from npm
✔ Created the module from template files
But then it gives me this error in the 3rd step:
✖ Installing module dependencies
Error: npm exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\#expo\spawn-async\build\spawnAsync.js:41:23)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.cp.emit (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
...
at spawnAsync (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\#expo\spawn-async\build\spawnAsync.js:7:23)
at installDependencies (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\packageManager.js:9:37)
at C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:49:56
at newStep (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\utils.js:21:22)
at Command.main (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:48:31) {
pid: 23924,
output: [ '', '' ],
stdout: '',
stderr: '',
status: 1,
signal: null
}
I'm able to create new Expo projects with expo init without an issue and run them with expo start, so I don't know what the issue could be. My version of the Expo CLI is 6.0.6 and npm is 8.19.2.

Getting error when installing Bugsnag 'Error: spawn npm ENOENT'

this is the first time I post here so apologies if I don't follow some rules or incorrect formatting.
I'm making an app using React Native and Expo and when I try to install bugsnag I get this error.
$ npx bugsnag-expo-cli init
√ #bugsnag/expo does not appear to be installed, do you want to install it? ... yes
√ If you want the latest version of #bugsnag/expo hit enter, otherwise type the version you want ... latest
√ Using yarn or npm? » npm
> Installing #bugsnag/expo with npm. This could take a while!
Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Are you attempting to run the bugsnag-expo-cli on Windows? The Expo CLI currently only supports MacOS and Linux:
https://docs.bugsnag.com/platforms/react-native/expo/#installation-and-configuration
As an alternative to the CLI, you can follow the manual integration guide:
https://docs.bugsnag.com/platforms/react-native/expo/manual-setup/

How do I compile react-native android?

I have created a react-native app. I did it according to the instructions from the official "React" website. but my react-native android project won't start.
Console:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1289 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\Кирилл\Desktop\helloWorld\MyReactNative\node_modules\#react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\Кирилл\Desktop\helloWorld\MyReactNative\node_modules\#react-native-community\cli\build\bin.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\������\Desktop\helloWorld\MyReactNative\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 195
* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:903 throw err; ^Error: Cannot find module 'C:\Users\Кирилл\Desktop\helloWorld\MyReactNative\node_modules\#react-native-community\cli\build\bin.js' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:900:15) at Function.Module._load (node:internal/modules/cjs/loader:745:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:72:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []}
* 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 9s
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
:ReactNative:Unexpected empty result of running '[node, C:\Users\Кирилл\Desktop\helloWorld\MyReactNative\node_modules\#react-native-community\cli\build\bin.js, config]' command.
npm ERR! code 1
npm ERR! path C:\Users\Кирилл\Desktop\helloWorld\MyReactNative
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c "react-native run-android"
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Кирилл\AppData\Local\npm-cache\_logs\2020-11-13T08_19_01_474Z-debug.log
What should I do?
I have android sdk on drive D and jdk on drive C. Because of this, nothing worked. I have reinstalled android studio, sdk and jdk. Everything worked.
I have also faced this same issue in a React-Native project version 0.61.
I am now able to solve this issue by changing to Gradle version to 6.9.
My previous Gradle version was 6.4.1

React Native Application error at installing npx bugsnag

Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
at onErrorNT (internal/child_process.js:464:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Hello,
Anas Ahmed here, I was installing bugsnag-expo-cli-init in my react native app at first it asked me 3 ques and then at the time of installing it gave me this error can anyone help me in this. Installing in npm
Are you attempting to run the bugsnag-expo-cli on Windows? Bugsnag's Expo CLI currently only supports Linux and Mac:
https://docs.bugsnag.com/platforms/react-native/expo/#installation-and-configuration
As an alternative to the CLI, you could follow the manual integration guide:
https://docs.bugsnag.com/platforms/react-native/expo/manual-setup/

mobilefirst-cli ERR! Error: ry.npmjs.org/cordova-plugin-compat

I am using the MFP 7.1 with cordova project (mfp cordova).
I am able to add the iOS environment successfully (mfp cordova platform add iOS), but I got error when I try to add Android environment.
Following the exception:
mobilefirst-cli ERR! Error: ry.npmjs.org/cordova-plugin-compat
npm http 304 http://registry.npmjs.org/cordova-plugin-compat
at ChildProcess.<anonymous> (/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/cordovacmd/lib/cordova-cli.js:251:41)
at ChildProcess.emit (events.js:117:20)
at maybeClose (child_process.js:766:16)
at Socket.<anonymous> (child_process.js:979:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
I cannot confirm this...
Using 7.1.0.00.20160401-2108 I've tried the following: mfp cordova create
I then provided the name and version for the app, and selected the two supported platforms: iOS and Android. The app was then created, with both platforms.
I would try to perhaps update your npm installation.