Closed NickIliev closed 6 years ago
Hey @c350156378!
Sorry to hear that you're having troubles running your application. Could you please provide more context specific to your case?
Which versions of the CLI, and android runtime are you using? Do you have any nativescript plugins installed?
tns --version
to fetch it)node_modules/tns-core-modules/package.json
file in your project)"tns-android"
and "tns-ios"
properties in the
package.json
file of your project)package.json
file of your
project)Would you mind sharing the entire build log?
What are the steps that we need to make to reproduce the bug locally?
Please fill out the corresponding issue next time you are submitting an issue/PR.
Thank you!
hi @Pip3r4o below is the info, not sure how to reproduce the bug, as i just follow the official guide。 Later i'll try on my Ubuntu. $ tns --version 3.1.2
my package.json
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN "dependencies": { "@angular/animations": "~4.1.0", "@angular/common": "~4.1.0", "@angular/compiler": "~4.1.0", "@angular/core": "~4.1.0", "@angular/forms": "~4.1.0", "@angular/http": "~4.1.0", "@angular/platform-browser": "~4.1.0", "@angular/router": "~4.1.0", "nativescript-angular": "~3.0.0", "nativescript-theme-core": "~1.0.2", "reflect-metadata": "~0.1.8", "rxjs": "~5.3.0", "tns-core-modules": "^3.1.0", "zone.js": "~0.8.2" },
"devDependencies": {
"babel-traverse": "6.4.5",
"babel-types": "6.4.5",
"babylon": "6.4.5",
"lazy": "1.0.11",
"nativescript-dev-typescript": "^0.5.0",
"typescript": "^2.4.1"
}
}
i use win7 32bit i follow the official installation: http://docs.nativescript.org/start/quick-setup
$ tns doctor NOTE: You can develop for iOS only on Mac OS X systems. To be able to work with iOS devices and projects, you need Mac OS X Mavericks or later.
Your components are up-to-date.
No issues were detected.
and then follow the hello world guide http://docs.nativescript.org/angular/tutorial/ng-chapter-1#11-install-nativescript-and-configure-your-environment
$ tns run android
Searching for devices...
iTunes is not installed. Install it on your system and run this command again.
Executing before-liveSync hook from E:\sae\tns\HelloWorld\hooks\before-liveSync\nativescript-angular-sync.js
Skipping prepare.
Installing...
Successfully installed on device with identifier '38f70825'.
Successfully transferred all files.
Refreshing application...
Successfully synced application org.nativescript.HelloWorld on device 38f70825.
Executing before-watch hook from E:\sae\tns\HelloWorld\hooks\before-watch\nativescript-dev-typescript.js
Found peer TypeScript 2.4.1
07-08 09:21:27.720 9745 9760 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on a null object reference
FATAL ERROR: deserialize context Allocation failed - process out of memory
07-08 09:21:57.004 10821 10821 E KeepLiveService: KeepLiveService onCreate org.chromium.chrome.browser.service.KeepLiveService@f191325
07-08 09:21:57.042 10821 10821 E KeepLiveService: KeepLiveService onStartJob org.chromium.chrome.browser.service.KeepLiveService@f191325
07-08 09:21:57.056 10821 10821 E KeepLiveService: KeepLiveService onDestroy org.chromium.chrome.browser.service.KeepLiveService@f191325
sometimes only the FATAL ERROR info, no other error logs.
hope this help
attchment is the generated .apk file
You have .ts
tiles in the assets folder, which means you interrupted CLI with ctrl +C while it was preparing or there was another failure which forcefully interrupted the project.
Please try running the following commands and tell us if you encounter the same problem:
tns create MyApp
cd MyApp
tns run android
If you can provide us with the log, please do so.
`Project successfully created. Preparing project... Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --statu s for details
FAILURE: Build failed with an exception.
Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. Invalid maximum heap size: -Xmx16384M The specified size exceeds the maximum representable size.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Picked up _JAVA_OPTIONS: -Xmx512M Unable to apply changes on device: 38f70825. Error is: Processing node_modules f ailed. Error: Command gradlew.bat failed with exit code 1.
`
i change the gradle.properties to
org.gradle.jvmargs=-Xmx512M
and rerun and it works this time
it run on my android phone, but there is more log, please check.
BUILD SUCCESSFUL
Total time: 40.727 secs
Picked up _JAVA_OPTIONS: -Xmx512M
Project successfully built.
Installing...
Successfully installed on device with identifier '38f70825'.
Successfully transferred all files.
Refreshing application...
Successfully synced application org.nativescript.MyApp on device 38f70825.
07-15 17:30:13.207 14859 15305 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on a null object reference
07-15 17:30:13.214 14859 15306 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on a null object reference
07-15 17:30:13.214 14859 15305 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on a null object reference
07-15 17:30:15.335 14859 15306 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on a null object reference
07-15 17:30:17.624 15636 15680 I agoo.eoc: [ax]|[seq:reportMessages url [/A_R/23011413/130/Aj0ofroZZC8B90W6v1fW78R6ilpbUt-Uqh6f7wO05lj2?s=MDU1MDc3NjYxN25YSnRQR1p5UHl5V2lVTnNqWUJPRGZvSzJSMD0=&sv=0&ov=6.0.1&del_pack=com.autonavi.minimap&id=f__-orqk2OHkamca&&api_pro_agoo_lbpopen_618@0_MANUAL_EVENT_20170715&&WA3/efgAxAMDADHRDRlVywid&&00&&&pm=TGUgWDgyMA==&ec=14]] ChannelManager
07-15 17:32:43.746 17105 18821 W System.err: org.json.JSONException: Value [{"key":"from","value":"weibo","service":"com.igexin.sdk.PushService","type":"String"},{"key":"intent_come_from","value":"com.sina.weibo","service":"com.sina.news.push.GuardPushService","type":"String"},{"key":"CAMERA_FROM","value":"weibo","service":"com.sina.weibocamera.controller.service.CameraService","type":"String"},{"key":"","value":"","service":"com.yx.service.ConnectionService","type":""},{"key":"from","value":"weibo","service":"com.sina.app.weiboheadline.services.PushService","type":"String"}] of type org.json.JSONArray cannot be converted to JSONObject
07-15 17:32:43.755 17105 18821 W System.err: at org.json.JSON.typeMismatch(JSON.java:111)
07-15 17:32:43.755 17105 18821 W System.err: at org.json.JSONObject.
i try the below commands again and it fails... the same error as before. @Plamen5kov tns create HelloWorld --template nativescript-template-tutorial cd HelloWorld tns run Android
Hi @c350156378
As I understand now you are able to build the app with those steps:
tns create HelloWorld --template nativescript-template-tutorial
cd HelloWorld
tns run Android
but it crash on when deployed on your phone, am I right?
Is it ok on Android emulators? If it fails on real device only - please specify the model and android version.
If app build successfully, but crashes on startup I think adb logs can help us, you can get them in this way:
Open separate console and execute this before running the app:
%ANDROID_HOME%\platform-tools\adb logcat -c
and execute this after app crash:
%ANDROID_HOME%\platform-tools\adb logcat
@c350156378 I agree with @dtopuzov, if the app now builds but it crashes at run time, please open a new issue following the steps that @dtopuzov described.
@dtopuzov @Plamen5kov i try on my new window 7 64bit computer, and it works this time. i get the spinned apple image.
@c350156378 did you find out what the exact problem was? As I saw it there was a build issue that got fixed when you have java more memory to work with and then a runtime issue, that you obviously fixed.
no. maybe the 32bit or my pc's configurations concerns? never encounter the memory issue on my win7 64bit with 6GM ram. and i follow the official tutorial, it works all fine this time.
@c350156378 maybe, as you say, the machine is the problem, but unfortunately, we don't have a running physical or virtual machine that runs tests on 32bit. Thanks for reporting this, and we'll see if we can run tests on a 32bit virtual machine. Your feedback was very helpful, thank you!
Closing due to inactivity
From @c350156378 on July 7, 2017 9:28
encounter this problem, what should i do
https://discourse.nativescript.org/t/fatal-error-deserialize-context-allocation-failed-process-out-of-memory/1893
Copied from original issue: NativeScript/NativeScript#4529