Appcelerator CLI throwing exception when build - android

I'd been using appcelerator CLI for a while and everything is working, until today.
Suddenly when i try to run the following command, an error occur:
appc ti build --platform android -T device
C:\Users\User\.appcelerator\install\5.0.2\package\node_modules\appc-cli-titanium\node_modules\titanium\node_modules\longjohn\dist\longjohn.js:185
throw e;
^
TypeError: Invalid Version: build.0.0
I tried to search and found that there are a lot of post regarding the longjohn.js throwing e as error, but none of them is having the error message Invalid Version: build.0.0
I'm running this from Windows 7, using appcelerator 5.0.2. Targetted android platform
Anyone encountered this issue before? Any suggestion or steps to fix this?
Thank you
UPDATE
Tried to run appc info and got the following error:
Appcelerator Command-Line Interface, version 5.0.2
Copyright (c) 2014-2015, Appcelerator, Inc. All Rights Reserved.
[PLUGIN-LOAD] 0ms C:\Users\User\.appcelerator\install\5.0.2\package\appc.js
[PLUGIN-LOAD] 776ms C:\Users\User\.appcelerator\install\5.0.2\package\node_modules\appc-cli-titanium\appc.js
[PLUGIN-LOAD] 0ms C:\Users\User\.appcelerator\install\5.0.2\package\node_modules\arrow\appc.js
ERROR | titanium exited with exit code 8. re-run with -l trace to get detailed output
I tried appc ti clean but it doesn't help as well.
UPDATE with -l trace
Below is the result i got running appc info -l trace:
Appcelerator Command-Line Interface, version 5.0.2 Copyright (c) 2014-2015, Appcelerator, Inc. All Rights Reserved.
__command__ search paths: [ "C:\\Users\\User\\.appcelerator\\install\\5.0.2\\package", "C:\\Users\\User\\.appcelerator\\install\\5.0.2\\package\\node_modules", "D:\\appcelerator_workspace\\BlackButton\\modules", "D:\\appcelerator_workspace\\BlackButton\\plugins", "D:\\appcelerator_workspace\\BlackButton\\node_modules", "D:\\appcelerator_workspace\\node_modules", "D:\\node_modules", "C:\\Users\\User\\.appcelerator\\.npm\\lib\\node_modules" ] [PLUGIN-LOAD] 0ms C:\Users\User\.appcelerator\install\5.0.2\package\appc.js [PLUGIN-LOAD] 718ms C:\Users\User\.appcelerator\install\5.0.2\package\node_modules\appc-cli-titanium\appc.js [PLUGIN-LOAD] 1ms C:\Users\User\.appcelerator\install\5.0.2\package\node_modules\arrow\appc.js log level set to "trace" executing command "info" set environment to {"registry":"https://software.appcelerator.com","security":"https://security.appcelerator.com","baseurl":"https://platform.appcelerator.com"}
checking credentials for existing session Attempting to load session info from config file check if session is invalidated session expiry 1449554288096 false Arrow Cloud config file: C:\Users\User\.acs found Arrow Cloud login { mid: 'ce9aca6f8de18937ab3063f00c6ea0c8e194c0ef', publishPort: 443, publishHost: 'https://admin.cloudapp-enterprise.appcelerator.com', username: 'williamtan89#hotmail.com', cookie: [ 'connect.sid=s%3A96v7wP3oaYbdV%2BLKu8IdiE3d.cjDf28RzrGOHQbxcd5507u4R STiRnGEO2SvwCG0zNtw; Path=/; Expires=Tue, 15 Dec 2015 05:58:21 GMT; HttpOnly' ],
defaultEP: { publishHost: 'https://admin.cloudapp-enterprise.appcelerator.com',
publishPort: 443 } } , checking nodeACSEndpoint= https://admin.cloudapp-enterprise.appcelerator.com Arrow Cloud cookie expiry [ 1450159101000 ] session already loaded in opts.session getCredentials() session: { "ipaddress": "10.238.179.133", "username": "williamtan89#hotmail.com", "password": "<OMITTED>", "session": "<OMITTED>", "nonce": "<OMITTED>", "environment": {
"name": "production",
"isProduction": true,
"acsBaseUrl": "https://api.cloud.appcelerator.com",
"acsAuthBaseUrl": "https://secure-identity.cloud.appcelerator.com",
"nodeACSEndpoint": "https://admin.cloudapp-enterprise.appcelerator.com" }, "token": "<OMITTED>", "fingerprint": "ce9aca6f8de18937ab3063f00c6ea0c8e194c0ef", "fingerprint_description": "Windows Machine ID: b250f9d4-0356-48cd-b9fb-d67ac86e7802", "org_id": 100032901, "expiry": 1449554288096 } noPlugins set for command "info" executing command "info" with no plugins "C:\Program Files\nodejs\node.exe" "C:\Users\User\.appcelerator\install\5.0.2\package\node_modules\appc-cli-titanium\node_modules\titanium\bin\titanium" sdk -o json checking for titanium, result: { activeSDK: '5.0.2.GA', defaultInstallLocation: 'C:\\ProgramData\\Titanium', installLocations: [ 'C:\\ProgramData\\Titanium',
'C:\\Users\\User\\AppData\\Roaming\\Titanium',
'C:\\ProgramData\\Application Data\\Titanium' ], installed: { '5.0.2.GA': 'C:\\ProgramData\\Titanium\\mobilesdk\\win32\\5.0.2.GA',
'5.0.0.v20150920231514': 'C:\\ProgramData\\Titanium\\mobilesdk\\win32\\5.0.0.v20150920231514',
'4.1.1.v20150816214206': 'C:\\ProgramData\\Titanium\\mobilesdk\\win32\\4.1.1.v20150816214206',
'3.2.3.GA': 'C:\\Users\\User\\AppData\\Roaming\\Titanium\\mobilesdk\\win32\\3.2.3.GA' }, sdks: { '5.0.2.GA':
{ name: '5.0.2.GA',
manifest: [Object],
path: 'C:\\ProgramData\\Titanium\\mobilesdk\\win32\\5.0.2.GA' },
'5.0.0.v20150920231514':
{ name: '5.0.0.v20150920231514',
manifest: [Object],
path: 'C:\\ProgramData\\Titanium\\mobilesdk\\win32\\5.0.0.v20150920231514' },
'4.1.1.v20150816214206':
{ name: '4.1.1.v20150816214206',
manifest: [Object],
path: 'C:\\ProgramData\\Titanium\\mobilesdk\\win32\\4.1.1.v20150816214206' },
'3.2.3.GA':
{ name: '3.2.3.GA',
manifest: [Object],
path: 'C:\\Users\\User\\AppData\\Roaming\\Titanium\\mobilesdk\\win32\\3.2.3.GA' } } } cmd [ '/s', '/c', 'node', 'C:\\Users\\User\\.appcelerator\\install\\5.0.2\\package\\node_modules\\appc-cli-titanium\\node_modules\\titanium\\bin\\titanium', 'info', '--color', '--config', '{"cli":{"colors":true}}' ] Titanium Command-Line Interface, CLI version 5.0.4, Titanium SDK version 5.0.2.GA Copyright (c) 2012-2015, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
8
ERROR | Error: titanium exited with exit code 8. re-run with -l trace to get detailed output
at ChildProcess.<anonymous> (C:\Users\User\.appcelerator\install\5.0.2\package\lib\commands\info.js:35:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)

Please clean your project and build it again.

Related

The app has not responded to the network requests below

Hi I am getting below error when I run from bitrise to do the detox testing with Android Emulator. Pasted partials codes below along with error. I tried to add --debug-synchronization with detox test command and expo helpers and hook in package json. Nothing seems to be working. Pls let me know if you need more information. Thanks
Error:
07:54:07.058 detox[4843] WARN: [PENDING_REQUESTS] The app has not responded to the network requests below:
(id = 1) currentStatus: {}
(id = -1000) isReady: {}
Unresponded network requests might result in timeout errors in Detox tests.
07:54:12.101 detox[4843] ERROR: [Client.js/ERROR] The pending request #-49642 ("cleanup") has been rejected due to the following error:
The tester has not received a response within 5000ms timeout to the message:
Cleanup {
type: 'cleanup',
params: [Object],
messageId: -49642
}
FAIL e2e/onboarding.e2e.js (329.38 s)
Onboarding
✕ should have welcome screen (1 ms)
✕ should show login screen after tap
✕ should show signup screen after tap (1 ms)
✕ should show forgot password screen after tap (1 ms)
● Onboarding › should have welcome screen
thrown: "Exceeded timeout of 120000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
1 | describe('Onboarding', () => {
> 2 | beforeAll(async () => {
| ^
3 | await device.launchApp();
4 | });
5 |
at onboarding.e2e.js:2:3
at Object.<anonymous> (onboarding.e2e.js:1:1)
package.json
"detox": "^19.3.1",
"expo-detox-hook": "^1.0.10",
"detox-expo-helpers": "^0.6.0",
Bitrise.yml
format_version: '11'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: react-native
trigger_map:
- push_branch: MBI-7610
workflow: tests
workflows:
tests:
steps:
- activate-ssh-key#4: {}
- git-clone#6: {}
- npm:
inputs:
- command: install
- npm:
inputs:
- command: install -g detox-cli
title: Install Detox CLI
- npm:
inputs:
- command: install -g react-native-cli
title: Install React Native CLI
- script:
inputs:
- is_debug: 'yes'
- content: |-
#!/bin/bash
detox build --configuration android24 --debug-synchronization 500 --cleanup
title: Detox - Build Release App (Android)
- avd-manager#1:
inputs:
- name: "$EMULATOR_NAME"
- api_level: '24'
- wait-for-android-emulator#1:
inputs:
- boot_timeout: '800'
- script:
inputs:
- is_debug: 'yes'
- content: |-
#!/bin/bash
/usr/local/share/android-sdk/emulator/emulator -list-avds
title: Print Device
- script:
inputs:
- is_debug: 'yes'
- content: |-
#!/bin/bash
detox test --configuration android24 --cleanup --debug-synchronization
title: Detox - Run E2E Tests (android)
meta:
bitrise.io:
stack: osx-xcode-13.1.x
app:
envs:
- opts:
is_expand: false
WORKDIR: "."
- opts:
is_expand: false
PROJECT_LOCATION: android
- opts:
is_expand: false
MODULE: Buddy
- opts:
is_expand: false
VARIANT: Debug
- opts:
is_expand: false
BITRISE_PROJECT_PATH: ios/Buddy.xcworkspace
- opts:
is_expand: false
BITRISE_SCHEME: Buddy-Alpha
- opts:
is_expand: false
BITRISE_DISTRIBUTION_METHOD: development
- EMULATOR_NAME: pixel_3a_API_24
outputs:
- BITRISE_APK_PATH: android/App/build/outputs/apk/alpha/debug/App-alpha-debug.apk
opts:
title: Path of the generated APK
summary: Path of the generated (and copied) APK - after filtering.
description: |-
This output will include the path of the generated APK
after filtering based on the filter inputs.
If the build generates more than one APK which fulfills the
filter inputs, this output will contain the last one's path.
.detoxrc.json
"emulator24": {
"type": "android.emulator",
"device": {
"avdName": "emulator"
}
},
"android.alpha.debug": {
"type": "android.apk",
"binaryPath": "android/App/build/outputs/apk/alpha/debug/App-alpha-debug.apk",
"build": "cd android && ./gradlew -Dorg.gradle.jvmargs=-Xmx1536m assembleAlphaDebug assembleAndroidTest -DtestBuildType=debug && cd .."
},
"android24": {
"device": "emulator24",
"app": "android.alpha.debug"
},

react-native can't find gradle wrapper when building the android app

I'm in a process of upgrading React Native from 0.61.5 to 0.64.2 and I have a problem running the Android app.
This is the output I get when trying to start it:
$ react-native run-android --verbose
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
(node:14959) 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 1313 file(s) to forward-jetify. Using 12 workers...
info JS server already running.
info Installing the app...
debug Running command "cd android && ./gradlew installDebug -PreactNativeDevServerPort=8081"
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: spawn ./gradlew 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)
My Android environment is configured, and I can actually run the exact same command that react-native runs, and it works without the issue:
$ cd android && ./gradlew installDebug -PreactNativeDevServerPort=8081
<-------------> 0% CONFIGURING [7s]
> root project > Resolve dependencies of :classpath > maven-metadata.xml
(gradle eventually finishes the build with a success).
Permissions for gradlew seem ok:
$ ls -la ./android/gradlew
-rwxr-xr-x 1 mateusz 139652859 5766 20 Jul 13:44 ./android/gradlew
gradle-wrapper.properties looks as follows:
$ cat android/gradle/wrapper/gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
React Native CLI is up-to-date:
$ react-native --version
react-native-cli: 2.0.1
react-native: 0.64.2
I found several people had a similar problem but none of them to be exactly the same.
Things work fine on the main branch which still uses 0.61.5. I suspect it may be just me not updating some config file, however I have no idea how to get some more verbose hint on what exactly I have to change.
Any ideas? Thanks!
Turns out react-native was looking for gradlew in a wrong directory!
It looked for it in android/myApp, whereas it should be just android/.
What fixed the issue was a config change in react-native.config.js:
What I had before:
const android = require('#react-native-community/cli-platform-android');
module.exports = {
platforms: {
android: {
linkConfig: android.linkConfig,
projectConfig: android.projectConfig,
dependencyConfig: android.dependencyConfig,
},
},
project: {
android: {
sourceDir: './android/myApp',
stringsPath: './src/main/res/values/strings.xml',
manifestPath: './src/main/AndroidManifest.xml',
buildGradlePath: './build.gradle',
settingsGradlePath: '../settings.gradle',
assetsPath: './src/main/assets',
mainFilePath: './src/main/java/com/company/myapp/MyApp.java',
},
},
};
What I have now (it works):
const android = require('#react-native-community/cli-platform-android');
module.exports = {
platforms: {
android: {
linkConfig: android.linkConfig,
projectConfig: android.projectConfig,
dependencyConfig: android.dependencyConfig,
},
},
project: {
android: {
sourceDir: './android',
stringsPath: './myApp/src/main/res/values/strings.xml',
manifestPath: './myApp/src/main/AndroidManifest.xml',
buildGradlePath: './build.gradle',
settingsGradlePath: './settings.gradle',
assetsPath: './myApp/src/main/assets',
mainFilePath: './myApp/src/main/java/com/company/myapp/MyApp.java',
},
},
};

problem trying to build my app in ionic cordova

I have tried to build my app and I am receiving an error. I am using:
ionic cordova build android
node version: 12.13.0
Error Below
C:\Users\ville\Documents\gobus-hibrido>ionic cordova build android --verbose
ionic:lib Terminal info: { ci: false, shell: 'C:\\WINDOWS\\system32\\cmd.exe', tty: true, windows: true } +0ms
ionic:lib CLI global options: { _: [ 'cordova', 'build', 'android' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +4ms
ionic:lib:project Project type from config: Ionic 1 (ionic1) +0ms
ionic:lib:project Project details: { configPath: 'C:\\Users\\ville\\Documents\\gobus-hibrido\\ionic.config.json', errors: [], context: 'app', type: 'ionic1' } +1ms
ionic Context: { binPath: 'C:\\Users\\ville\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath: 'C:\\Users\\ville\\AppData\\Roaming\\npm\\node_modules\\ionic', execPath: 'C:\\Users\\ville\\Documents\\gobus-hibrido', version: '5.4.4' } +0ms
ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: 'C:\\Users\\ville\\Documents\\gobus-hibrido\\config.xml', package.json: 'C:\\Users\\ville\\Documents\\gobus-hibrido\\package.json') +0ms
ionic:lib:build build options: {
ionic:lib:build '--': [],
ionic:lib:build engine: 'cordova',
ionic:lib:build platform: 'android',
ionic:lib:build project: undefined,
ionic:lib:build verbose: false,
ionic:lib:build type: 'ionic1'
ionic:lib:build } +0ms
ionic:lib:telemetry Sending telemetry for command: 'ionic cordova build' [ 'android', '--verbose', '--interactive', '--color' ] +0ms
ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
ionic:lib:build Looking for ionic:build npm script. +8ms
ionic-v1.cmd build
ionic:v1-toolkit:lib:gulp Using gulpfile: C:\Users\ville\Documents\gobus-hibrido\gulpfile.js +0ms
ionic:v1-toolkit:lib:gulp Using gulp: C:\Users\ville\Documents\gobus-hibrido\node_modules\gulp\index.js +4ms
[11:20:02] Cannot load gulp: ReferenceError: primordials is not defined
ionic:v1-toolkit:lib:gulp Using gulpfile: C:\Users\ville\Documents\gobus-hibrido\gulpfile.js +155ms
ionic:v1-toolkit:lib:gulp Using gulp: C:\Users\ville\Documents\gobus-hibrido\node_modules\gulp\index.js +1ms
[11:20:02] Cannot load gulp: ReferenceError: primordials is not defined
[11:20:02] Cannot run sass task: missing in gulpfile.js
ionic:v1-toolkit:lib:gulp Using gulpfile: C:\Users\ville\Documents\gobus-hibrido\gulpfile.js +4ms
ionic:v1-toolkit:lib:gulp Using gulp: C:\Users\ville\Documents\gobus-hibrido\node_modules\gulp\index.js +1ms
[11:20:02] Cannot load gulp: ReferenceError: primordials is not defined
ionic:lib:hooks Looking for ionic:build:after npm script. +461ms
cordova.cmd build android --verbose
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --verbose exited with exit code 1.
Please downgrade / switch to NodeJS 10, this is a known issue with NodeJS 12 and specific dependencies. Or dleete the lockfile (package-lock.json) and try it again.

react native app crash after splash screen

I am new to React Native. I am created a new blank project in Expo XDE and when I'm trying to run it on my Android device every time it crash after splash screen. It's just a simple blank app.
There is no logs or errors. Expo app just return to first page.
Device: Android 7
XDE: Expo version 2.21.00
app.js
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Updated
npm start log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Pfn\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#5.5.1
3 info using node#v6.11.3
4 verbose stack Error: missing script: start
4 verbose stack at run (C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:151:19)
4 verbose stack at C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:61:5
4 verbose stack at C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:115:5
4 verbose stack at C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:402:5
4 verbose stack at checkBinReferences_ (C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:357:45)
4 verbose stack at final (C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:400:3)
4 verbose stack at then (C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:160:5)
4 verbose stack at ReadFileContext.<anonymous> (C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:332:20)
4 verbose stack at ReadFileContext.callback (C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16)
4 verbose stack at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:367:13)
5 verbose cwd F:\react\my-new-project
6 verbose Windows_NT 10.0.15063
7 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Pfn\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
8 verbose node v6.11.3
9 verbose npm v5.5.1
10 error missing script: start
11 verbose exit [ 1, true ]
after adding this:
"scripts": {
"start": "node app.js"
}
to package.json log :
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Pfn\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#5.5.1
3 info using node#v6.11.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle my-new-project#0.0.0~prestart: my-new-project#0.0.0
6 info lifecycle my-new-project#0.0.0~start: my-new-project#0.0.0
7 verbose lifecycle my-new-project#0.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle my-new-project#0.0.0~start: PATH: C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;F:\react\my-new-project\node_modules\.bin;C:\Program Files\Expo XDE\resources\app\node_modules\xdl\binaries\windows\adb;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Smart Projects\IsoBuster;C:\Program Files\PuTTY\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\xampp\php;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs\;C:\Users\Pfn\AppData\Roaming\npm;C:\Users\Pfn\AppData\Local\Microsoft\WindowsApps;C:\Users\Pfn\AppData\Roaming\Composer\vendor\bin;C:\Users\Pfn\AppData\Roaming\npm
9 verbose lifecycle my-new-project#0.0.0~start: CWD: F:\react\my-new-project
10 silly lifecycle my-new-project#0.0.0~start: Args: [ '/d /s /c', 'node app.js' ]
11 silly lifecycle my-new-project#0.0.0~start: Returned: code: 1 signal: null
12 info lifecycle my-new-project#0.0.0~start: Failed to exec start script
13 verbose stack Error: my-new-project#0.0.0 start: `node app.js`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:280:16)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at EventEmitter.emit (events.js:191:7)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Pfn\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at ChildProcess.emit (events.js:191:7)
13 verbose stack at maybeClose (internal/child_process.js:920:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
14 verbose pkgid my-new-project#0.0.0
15 verbose cwd F:\react\my-new-project
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Pfn\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v6.11.3
19 verbose npm v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error my-new-project#0.0.0 start: `node app.js`
22 error Exit status 1
23 error Failed at the my-new-project#0.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
update2:
npm install warnings :
npm WARN react-native-branch#2.0.0-beta.3 requires a peer of react#>=15.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-gesture-handler#1.0.0-alpha.28 requires a peer of react#> 15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sshpk#1.13.0 (node_modules\fsevents\node_modules\sshpk):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'F:\react\my-new-project\node_modules\fsevents\node_modules\sshpk' -> 'F:\react\my-new-project\node_modules\fsevents\node_modules\.sshpk.DELETE'
added 5 packages and updated 2 packages in 70.53s
Which OS? Mac, Win, or Linux? If you're on Linux, did you open the XDE client using this command?
On Linux, open with chmod a+x xde*.AppImage and ./xde*.AppImage
Regardless of your OS, are you sure you have...
the latest version of node installed?
the latest version of watchman installed?
A shot in the dark, but once you've updated the above, I would start a new project and try again.
UPDATE: Looking more closely at your logs, I can see you're on Windows since the paths are "C:\...", so ignore the linux comment above. I still think your environment isn't setup correctly though. Reinstalling node and/or watchman may help (most likely node). You might also try installing yarn and see if that makes a difference. Sometimes it does for me.

"android list targets" launches emulator

I am trying to create new project using
cordova platform add android
But running this command launches android emulator and after I close the emulator I get the message
C:\devCenter\project\new_app>cordova platform add android
Creating android project...
C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:126
throw e;
^
Error: Please install Android target "android-19".
Hint: Run "android" from your command-line to open the SDK manager.
at C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\lib\check_reqs.js:174:19
at _fulfilled (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:798:54)
at self.promiseDispatch.done (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:827:30)
at Promise.promise.promiseDispatch (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:7
at C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:574:44
at flush (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:442:13)
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\think ahead\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
I have installed API-19 in SDK manager. So I checked check_reqs.js and found command that finds the API version number is
android list targets
When I execute this command, android emulator launches and dont get the list which is expected, here the output:
C:\devCenter\project\new_app>android list targets
OSALSockMap::init: sock_map=0x003F0000
start /SocketeQ/windowsandroid_root//system/bin/plogd ... 2528
C:\devCenter\project\new_app>start /SocketeQ/windowsandroid_root//system/bin/socketbinder ... 5648
add (socketbinder, 0) to sockmap ok
start /SocketeQ/windowsandroid_root//system/bin/servicemanager ... 10164
[ on init ]
[ on boot ]
[ service netd ]
[ service vold ]
[ service surfaceflinger ]
[ service ril-daemon ]
[ service zygote ]
[ service media ]
[ service drm ]
[ service installd ]
reference-ril requires: -p <tcp port> or -d /dev/tty_device
android-start was killed
app_process was killed
servicemanager was killed
socketbinder was killed
Could not open pipe: 2 second wait timed out.Could not open pipe: 2 second wait timed out.Could not open pipe: 2 second wait timed out.Cou
surfaceflinger was killed
instld was killed
no process 'alogd' was killed
plogd was killed
netd was killed
vold was killed
bootanimation was killed
rild was killed
no process 'drmserver' was killed
It seems like I have messed up my environment show how. Do anyone know what the problem might be?
Here is the solution, check if there is any other android development tool. Like in my case I had appcelerator installed which was in a way messing up the environment. Once removed whole thing worked like a charm. If there is any need to user multiple development platform, my suggestion is to use different partitions.

Categories

Resources