Titanium Appcelerator longjohn.js:185 error - android

When I am trying to run my Android application using Titanium Studio, I got error like this..
[INFO] : Making sure the adb server is running
[ERROR] Application Installer abnormal process termination. Process exit value was 1
C:\Users\Ganeshk\AppData\Roaming\npm\node_modules\titanium\node_modules\longjohn\dist\longjohn.js:185
throw e;
^
patchedLog [as log] (C:\ProgramData\Titanium\mobilesdk\win32\3.5.1.GA\cli\commands\build.js:299:22),target.(anonymous function) [as error] (C:\Users\Ganeshk\AppData\Roaming\npm\node_modules\titanium\node_modules\winston\lib\winston\common.js:45:21),C:\ProgramData\Titanium\mobilesdk\win32\3.5.1.GA\android\cli\hooks\run.js:399:13,C:\ProgramData\Titanium\mobilesdk\win32\3.5.1.GA\node_modules\async\lib\async.js:232:13,C:\ProgramData\Titanium\mobilesdk\win32\3.5.1.GA\node_modules\async\lib\async.js:136:21,C:\ProgramData\Titanium\mobilesdk\win32\3.5.1.GA\node_modules\async\lib\async.js:229:17,C:\ProgramData\Titanium\mobilesdk\win32\3.5.1.GA\node_modules\async\lib\async.js:556:34,C:\ProgramData\Titanium\mobilesdk\win32\3.5.1.GA\node_modules\titanium-sdk\lib\adb.js:455:4,ChildProcess.<anonymous> (C:\ProgramData\Titanium\mobilesdk\win32\3.5.1.GA\node_modules\node-appc\lib\subprocess.js:60:3)
I am using:
OS: Windows 8,
npm: 2.7.4,
Titanium: 3.4.2

Option-1:
Confirm that you have 0.10.X version of node.js
Option-2
Can you try the following change. This involves modifying a file, so would request you to keep a backup of the file.
Go to the following folder:
C:\ProgramData\Titanium\mobilesdk\win32\3.5.0.GA\node_modules\titanium-sdk\lib\
Open the file windows.js and edit the following line (should be near the end)
if (!selectedVisualStudio) return next();
and change it to:
return next();
Let us know if either of this two approach worked for you. For me, option-2 worked in one of our windows machine.

Related

Errors when building : no source map reference + remove sentry-cordova exited with exit code 1

I'm trying to build my ionic app for android and most users have a white screen after the splashscreen. I've past the past week to try to determine where it could come but got no idea... So I'm trying to get rid of all the errors I have when building. (it still succed to build with the errors and worked on almost half phones).
First one is here :
Building for Android...
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd plugin remove sentry-cordova exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
> cordova.cmd plugin remove sentry-cordova Sentry: running before_plugin_rm - set SENTRY_SKIP_WIZARD=true to skip this angular.json build.json build_android.sh build-extras.gradle CertificateSigningRequest.certSigningRequest
...
tslint.json www Uninstalling sentry-cordova from android Subproject Path: CordovaLib Subproject Path: app Uninstalling sentry-cordova from browser js-module uninstall called : plugins\sentry-cordova\dist\js\sentry-cordova.bundle.js Uninstalling sentry-cordova from ios Removing "sentry-cordova" Removing sentry-cordova from package.json doc.find is not a function
Second one is after, there is multiples lines like this :
- warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/1-es5.1922
I'm pretty sure I miss some informations. Don't hesitate to ask if necessary but I'm sure I forget to do something, but i'm kinda desperate now...
EDIT : Here is the begining of the script I'm using for build :
echo "Building for Android..."
#npm run android:build:prod
sentryRemove=$(ionic cordova plugin remove sentry-cordova)
echo $sentryRemove
sentryAdd=$(cordova plugin add sentry-cordova)
echo $sentryAdd
echo "successfully added the sentry. \n Performing build now."
appBuildOut=$(ionic cordova build android --prod --release --source-map)
echo $appBuildOut
BUILD_MESSAGE='BUILD SUCCESSFUL'
Thanks for your help
The first question is why are you running a plugin remove command when building your app, if I understand correctly. I would check what is calling this command because the script that is erroring before_plugin_rm should only be called when the plugin is being removed.
To get this script to just work, try running with the environment variable SENTRY_SKIP_WIZARD=true and see if the build works. I don't think the reason for the white screen is related to Sentry as the step that is failing looks to be related to source map uploading.

Unable to apply changes on device: DEVICE####. Error is: Cannot read property 'env' of undefined

I get this issue after my first android build; then, before that, the project run in development in the device and even in an emulator. Also the error happens in the emulator too.
I has been researching about that. Update to the current last versions of NativeScript tns-android: 5.4.0 tns-core-modules: 5.4.3 nativescript-vue: 2.2.2, also update the firebase plugin nativescript-plugin-firebase: 9.0.1. And this doesn’t allows me to continue the project. I am so frustrated in this moment about this issue.
Unable to apply changes on device: DEVICE####.
Error is: Cannot read property 'env' of undefined.
Using the --log trace this is shown
Will emit event liveSyncError with data { error:
{ Error: Command ./gradlew failed with exit code 1
at Errors.fail (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/common/errors.js:126:28)
at Errors.failWithoutHelp (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/common/errors.js:136:21)
at AndroidProjectService.<anonymous> (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/services/android-project-service.js:666:34)
at Generator.throw (<anonymous>)
at rejected (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/services/android-project-service.js:11:65)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
name: 'Exception',
message: 'Command ./gradlew failed with exit code 1',
stack: 'Error: Command ./gradlew failed with exit code 1\n at Errors.fail (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/common/errors.js:126:28)\n at Errors.failWithoutHelp (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/common/errors.js:136:21)\n at AndroidProjectService.<anonymous> (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/services/android-project-service.js:666:34)\n at Generator.throw (<anonymous>)\n at rejected (/Users/user/.nvm/versions/node/v8.14.1/lib/node_modules/nativescript/lib/services/android-project-service.js:11:65)\n at <anonymous>\n at process._tickCallback (internal/process/next_tick.js:189:7)',
errorCode: 127,
suppressCommandHelp: true,
proxyAuthenticationRequired: false,
printOnStdout: undefined },
.
.
.
Thanks in advance for any help, this has totally block the development of the project.
this error is expected if you are trying to use nativescript-dev-webpack#next with latest official version of NativeScript CLI (5.4.2) as they are not compatible with one another (preparing for NativeScript 6.0 release).
If you would like to use nativescript-dev-webpack#next you will need to install nativescript#next as well.
Hope this helps!

Can't install jxcore-cordova

I want to host a Node.js server on my Android device. So when looking around i stumbled over jxcore-cordova...especially this site Sitepoint How to run Node.js on Mobile
Following this tutorial i got the bat and also the sh and ran it. First i got the eror that the command jx can not be found. So i installed JXCore for Windows from here: JXCore Github Releases
Afterwards i get these errors:
module.js:2098
throw err;
^
Error: Package is either corrupted or not compatible with this JX binary. (....\.jx\npmjxv311.jx)
at Object.Module._extensions..jx (module.js:2095:15)
at Module.load (module.js:440:36)
at Function.Module._load (module.js:405:12)
at Function.Module.runMain (module.js:878:12)
at startup (node.js:485:18)
at node.js:1604:3
Downloading the file. Please wait...
module.js:802
throw err;
^
Error: Cannot find module '....\jxcore-cord
ova\hello\node_modules\download-cli\cli.js'
at Function.Module._oldRes (module.js:800:15)
at Function.Module._resolveFilename (module.js:1768:19)
at Function.Module._load (module.js:360:25)
at Function.Module.runMain (module.js:878:12)
at startup (node.js:485:18)
at node.js:1604:3
Der Befehl "rm" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
module.js:802
throw err;
^
Error: Cannot find module '....\jxcore-cord
ova\hello\io.jxcore.node.jx'
at Function.Module._oldRes (module.js:800:15)
at Function.Module._resolveFilename (module.js:1768:19)
at Function.Module._load (module.js:360:25)
at Function.Module.runMain (module.js:878:12)
at startup (node.js:485:18)
at node.js:1604:3
Incorrect sample folder 'io.jxcore.node\sample\express_sample\www'.
Thinking that maybe you have to go through the "Installation" steps on the JXCore-Cordova Github page i started doing that but when executing android_compile.sh with the path to the downloaded Android NPK i get the out_android folder and some other folders but they are all empty.
Now my questions are:
Am I missing something or am i doing something wrong?
And is jxcore-cordova still the best (and only) way to run a node.js app on Android?
Btw: I looked through stackoverflow and found no other questions with this error. The ones that sound similar solved it with one of the things i tried and failed with. I also tried a different 2 different PCs with the install_and_run file but no difference.

Deploy Apps with Ionic Package

I figured i would try the 'new' CLI tool for Ionic, Package, but i am getting some weird errors that i haven't seen before.
When running the command :
ionic package build android --profile release
The error i am getting
undefined:0
^
SyntaxError: Unexpected end of input
at Object.parse (native)
at /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/io-config.js:179:28
at fs.js:271:14
at Object.oncomplete (fs.js:107:15)
After some research i found that this can happen when a command is run without sudo, but when running the command with sudo i am getting the dam error message.
Hopefully i am lucky and ill find an Ionic enthusiast who might help me with the matter. Couldn't find any Ionic related topics where this error was mentioned.
Any help appreciated!
I had to add [] to the .io-config.json file in the root directory of my ionic app.
Btw. dont forget to install ionic add ionic-platform-web-client
The solution for me was annoyingly simple. In the file mentioned, find the line where CONFIG_BACKUP is defined and change it. You should see that it is:
var CONFIG_BACKUP = './.io-config.json'
It should actually be:
var CONFIG_BACKUP = './io-config.json'
I was building for iOS but had the same error as you which disappeared after the above.
For me the error resulted from the config.xml file. I would open all ionic files to make sure there are no formatting errors. The rebuild

react-native running tutorial 'AwesomeProject' on Android results in 'Unable to download JS Bundle' red screen

I am following this Facebook tutorial, and when running react-native run-android from AwesomeProject dir, I am getting a red screen on the android emulator, with the following text:
Unable to download JS bundle. Did you forget to start the development server or connect your device?
onResponse
DevServerHelper.java:175
run
NamedRunnable.java:33
runWorker
ThreadPoolExecutor.java:1113
run
ThreadPoolExecutor.java:588
run
Thread.java:818
I don't know if it's related, but I'm also getting a bunch of SyntaxErrors on the server regarding const not being valid in strict mode (I did not change anything in the original code) and getting the following error on START:
< START> request:/index.android.bundle?platform=android
TypeError: Cannot read property 'root' of null
at /Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/packager/react-packager/src/DependencyResolver/crawlers/index.js:16:84
at tryCallOne (/Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
at /Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/node_modules/promise/lib/core.js:103:15
at flush (/Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
at process._tickCallback (node.js:355:11)
Update
Upgrading to Node v4.1.1 got rid of the const syntax error, but I still get the same result with the following error on React Packager:
TypeError: Cannot read property 'root' of null
at /Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/packager/react-packager/src/DependencyResolver/crawlers/index.js:16:84
at tryCallOne (/Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
at /Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/node_modules/promise/lib/core.js:103:15
at flush (/Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
at process._tickCallback (node.js:355:11)
[5:02:20 PM] request:/index.android.bundle?platform=android
[5:02:20 PM] find dependencies
TypeError: Cannot read property 'root' of null
at /Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/packager/react-packager/src/DependencyResolver/crawlers/index.js:16:84
at tryCallOne (/Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
at /Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/node_modules/promise/lib/core.js:103:15
at flush (/Users/tome/projects/reactNative/AwesomeProject/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
at process._tickCallback (node.js:355:11)
[5:02:26 PM] request:/index.android.bundle?platform=android
I managed to solve the issue. To anyone else who encounters the issue, re-installing watchman did the trick for me:
brew uninstall watchman
brew install watchman
My app is now running
Also, I tried the Wathman install/uninstall route, with not much luck. What did work was making sure I updated and changed the version of node as used by nvm.
e.g. nvm install 4.1.1

Categories

Resources