NativeScriptException: Corrupted navigation stack - android

I'm creating my first application in NativeScript 1.7.0 (android platform for the moment) and I run into this error that crashes the application from time to time when pressing the back button on certain pages. I'm not sure what the exact conditions for this to occur are.
Has anyone else encountered this before? Any ideas why this could be happening and how to fix or avoid it?
NativeScript 1.7.0
tns-core-modules ^1.7.1
tns-android 1.7.1
Here is the information about the exception that is printed in the console:
com.tns.NativeScriptException:
Calling js method onBackPressed failed
Error: Corrupted navigation stack; page: undefined; currentNavigationPage: undefined
File: "/data/data/com.carteplay.consumer/files/app/tns_modules/ui/frame/frame.js, line: 664, column: 43
StackTrace:
Frame: function:'Frame._processNavigationQueue', file:'/data/data/com.carteplay.consumer/files/app/tns_modules/ui/frame/frame-common.js', line: 173, column: 19
Frame: function:'_completePageAddition', file:'/data/data/com.carteplay.consumer/files/app/tns_modules/ui/transition/transition.js', line: 228, column: 15
Frame: function:'_onFragmentShown', file:'/data/data/com.carteplay.consumer/files/app/tns_modules/ui/transition/transition.js', line: 197, column: 9
Frame: function:'onFragmentShown', file:'/data/data/com.carteplay.consumer/files/app/tns_modules/ui/frame/frame.js', line: 43, column: 22
Frame: function:'FragmentClass.onCreateView', file:'/data/data/com.carteplay.consumer/files/app/tns_modules/ui/frame/frame.js', line: 537, column: 13
Frame: function:'NativeScriptActivity.onBackPressed', file:'/data/data/com.carteplay.consumer/files/app/tns_modules/ui/frame/frame.js', line: 664, column: 44
at com.tns.Platform.callJSMethodNative(Native Method)
at com.tns.Platform.dispatchCallJSMethodNative(Platform.java:816)
at com.tns.Platform.callJSMethod(Platform.java:715)
at com.tns.Platform.callJSMethod(Platform.java:694)
at com.tns.Platform.callJSMethod(Platform.java:684)
at com.tns.NativeScriptActivity.onBackPressed(NativeScriptActivity.java:41)
at android.app.Activity.onKeyUp(Activity.java:2179)
at android.view.KeyEvent.dispatch(KeyEvent.java:2650)
at android.app.Activity.dispatchKeyEvent(Activity.java:2424)
at com.tns.NativeScriptActivity.dispatchKeyEvent(NativeScriptActivity.java)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1877)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:3884)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3867)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3463)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3513)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3482)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3567)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3490)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3624)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3463)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3513)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3482)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3490)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3463)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3513)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3482)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3600)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3752)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2022)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1738)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1729)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:1999)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:133)
at android.os.Looper.loop(Looper.java:124)
at android.app.ActivityThread.main(ActivityThread.java:5457)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:806)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
at dalvik.system.NativeStart.main(Native Method)

Please make sure you are using Android 1.7.1 or later of both the tns-core-modules and of the platform. Several versions of NS had some navigation issues. My understanding is they all should be solved in v1.7.1
To upgrade; change to your main project directory and do each of these simple commands:
npm install tns-core-modules#latest -s
tns platform remove android
tns platform add android
Then you can type a "cat package.json" or "type package.json" and you should see both the platform and core modules at v1.7.1 or greater.

Related

Android Emulator SDK--30 is not working with AR application [Google sceneform sdk]

We are developing an AR application with google-sceneform sdk, the app is getting crashed on Android 11 (Real Device) after the successful launch. we are able to identify the plane and place an object but after some time it will crash.
So we are trying it on emulator sdk-30. But after running the application it shows Failed to create AR Session.
I have followed the whole steps provided by Google in this Link but it didn't work.
Tried all the steps with android studio 4.1 and SDK-30 with emulator version 30.2.6 which is not worked.
The normal hand sign for scanning the surface is also not shown.
But with SDK-27 it worked. We need the sdk-30 to be worked.
Q1: is the emulator failing issue is a known issue? did anyone faced this before?
This is the log for Emulator.
2020-12-28 16:38:58.742 7153-7153/com.quintar.myapplication E/StandardArFragment: Error: Failed to create AR session
com.google.ar.core.exceptions.UnavailableException
at com.google.ar.sceneform.ux.BaseArFragment.initializeSession(BaseArFragment.java:391)
at com.google.ar.sceneform.ux.BaseArFragment.onResume(BaseArFragment.java:338)
#### SKIPPING SOME LINES HERE ####
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: com.google.ar.core.exceptions.FatalException: Failed to launch installer.
at com.google.ar.core.p.b(InstallService.java:53)
at com.google.ar.core.p.a(InstallService.java:40)
at com.google.ar.core.InstallActivity.startInstaller(InstallActivity.java:116)
at com.google.ar.core.InstallActivity.access$200(InstallActivity.java:125)
at com.google.ar.core.k.onClick(InstallActivity.java:3)
#### SKIPPING SOME LINES HERE ####
at android.app.ActivityThread.main(ActivityThread.java:7656) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.ar.core }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2067)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1727)
Q2: it is very much appreciatable if anyone can help me to fix the on Android 11 crash issue.
this is crash log on Android 11 (Real device)
2020-12-21 14:19:01.868 14629-14629/? A/DEBUG: Abort message: 'Scudo ERROR: invalid chunk state when
deallocating address 0x0073944b2ea0
'
2020-12-21 14:19:02.415 14629-14629/? A/DEBUG: #03 pc 00000000000431bc
/apex/com.android.runtime/lib64/bionic/libc.so
(scudo::reportInvalidChunkState(scudo::AllocatorAction, void*)+76) (BuildId:
95f68a34fdf7b31f42d3f811d5d88f58)
2020-12-21 14:19:03.665 1091-6178/? E/AudioSystem: invalid attributes { Content type:
AUDIO_CONTENT_TYPE_UNKNOWN Usage: AUDIO_USAGE_UNKNOWN Source: -1 Flags: 0x800 Tags: } when
converting to stream
2020-12-21 14:19:06.839 895-1615/? E/soundtrigger: audio_extn_sound_trigger_update_stream_status:
invalid input device 0x0, for event 2
In file 'YourProject/app/build.gradle' set the next dependecies for Android Target API 30 with the last of AR Sceneform Library:
android {
defaultConfig {
...
targetSdkVersion 30
...
}
}
dependencies {
...
api "com.google.ar.sceneform:core:1.17.1"
api "com.google.ar.sceneform.ux:sceneform-ux:1.17.1"
api "com.google.ar:core:1.22.0"
...
}

Errors show when I try to preview my app on my android devices

I'm trying to create an app using Nativescript Sidekick using angular/typescript.
When I try and preview the app on my android devices it only shows the errors below.
I have tried running the preview several times on multiple android devices.
As soon as I make changes to the app.component.ts file the nativescript preview app begins showing the below list of errors
This snippet works
import { Component } from "#angular/core";
#Component({
moduleId: module.id,
selector: "ns-app",
templateUrl: "app.component.html"
})
export class AppComponent { }
This snippet does not
import { Component } from "#angular/core";
#Component({
selector: "gr-login",
moduleId: module.id,
templateUrl: "./login/login.component.html"
})
export class AppComponent {}
LOG from device Marvin: Angular is running in the development mode. Call >enableProdMode() to enable the production mode.
LOG from device Marvin: HMR: Checking for updates to the bundle with hmr >hash 4a9d4dd775f015fffecd.
LOG from device Marvin: Angular is running in the development mode. Call >enableProdMode() to enable the production mode. LOG from device
Marvin: HMR: ↻ ./app/app.module.ts LOG from device Marvin:
HMR: Successfully applied update with hmr hash 4a9d4dd775f015fffecd.
App is up to date. LOG from device Marvin: HMR: ↻
./app/app.component.ts LOG from device Marvin: HMR: The following
modules were updated: LOG from device Marvin: HMR: Checking for
updates to the bundle with hmr hash c892cbd39be51a20e8ba. LOG from
device Marvin: HMR: The following modules were updated: LOG from
device Marvin: HMR: ↻ ./app/app.component.ts LOG from device
Marvin: HMR: ↻ ./app/app.component.html LOG from device
Marvin: HMR: ↻ ./app/login/login.component.html LOG from
device Marvin: HMR: ↻ ./app/app.module.ts LOG from device
Marvin: HMR: Successfully applied update with hmr hash
c892cbd39be51a20e8ba. App is up to date. LOG from device Marvin:
Angular is running in the development mode. Call enableProdMode() to
enable the production mode. LOG from device Marvin: An uncaught
Exception occurred on "main" thread. Calling js method run failed
Error: Failed to create View with entry.create() function.
StackTrace:
Frame: function:'ZoneAwareError', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 1298, column: 31
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js',
line: 45, column: 13
Frame: function:'ActivityCallbacksImplementation.setActivityContent',
file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js',
line: 985, column: 32
Frame: function:'ActivityCallbacksImplementation.resetActivityContent',
file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js',
line: 946, column: 10
Frame: function:'_resetRootView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/application/application.js',
line: 125, column: 13
Frame: function:'NativeScriptPlatformRef._livesync', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/platform-common.js',
line: 268, column: 19
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/platform-common.js',
line: 97, column: 80
Frame: function:'ZoneDelegate.invokeTask', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 421, column: 23
Frame: function:'Zone.runTask', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 188, column: 39
Frame: function:'ZoneTask.invokeTask', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 496, column: 28
Frame: function:'ZoneTask.invoke', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 485, column: 40
Frame: function:'timer', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 1561, column: 23
Frame: function:'invoke', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/timer/timer.js',
line: 19, column: 45
Frame: function:'ZoneDelegate.invoke', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 388, column: 18
Frame: function:'Zone.runGuarded', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 151, column: 39
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 129, column: 23
Frame: function:'run', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/timer/timer.js',
line: 23, column: 7
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1242)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:1122)
at com.tns.Runtime.callJSMethod(Runtime.java:1109)
at com.tns.Runtime.callJSMethod(Runtime.java:1089)
at com.tns.Runtime.callJSMethod(Runtime.java:1081)
at com.tns.gen.java.lang.Runnable.run(Runnable.java:17)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
LOG from device Marvin: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
LOG from device Marvin: HMR: Checking for updates to the bundle with hmr hash c0e7af62393125eaf0d7.
LOG from device Marvin: HMR: ↻ ./app/login/login.component.html
LOG from device Marvin: HMR: Successfully applied update with hmr hash c0e7af62393125eaf0d7. App is up to date.
LOG from device Marvin: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
LOG from device Marvin: HMR: ↻ ./app/app.component.html
LOG from device Marvin: HMR: ↻ ./app/app.module.ts
LOG from device Marvin: HMR: The following modules were updated:
LOG from device Marvin: HMR: ↻ ./app/app.component.ts
LOG from device Marvin: An uncaught Exception occurred on "main" thread.
Calling js method run failed
Error: Failed to create View with entry.create() function.
StackTrace:
Frame: function:'ZoneAwareError', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 1298, column: 31
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/builder/builder.js',
line: 45, column: 13
Frame: function:'ActivityCallbacksImplementation.setActivityContent',
file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js',
line: 985, column: 32
Frame: function:'ActivityCallbacksImplementation.resetActivityContent',
file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js',
line: 946, column: 10
Frame: function:'_resetRootView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/application/application.js',
line: 125, column: 13
Frame: function:'NativeScriptPlatformRef._livesync', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/platform-common.js',
line: 268, column: 19
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/platform-common.js',
line: 97, column: 80
Frame: function:'ZoneDelegate.invokeTask', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 421, column: 23
Frame: function:'Zone.runTask', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 188, column: 39
Frame: function:'ZoneTask.invokeTask', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 496, column: 28
Frame: function:'ZoneTask.invoke', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 485, column: 40
Frame: function:'timer', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 1561, column: 23
Frame: function:'invoke', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/timer/timer.js',
line: 19, column: 45
Frame: function:'ZoneDelegate.invoke', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 388, column: 18
Frame: function:'Zone.runGuarded', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 151, column: 39
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js',
line: 129, column: 23
Frame: function:'run', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/timer/timer.js',
line: 23, column: 7
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1242)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:1122)
at com.tns.Runtime.callJSMethod(Runtime.java:1109)
at com.tns.Runtime.callJSMethod(Runtime.java:1089)
at com.tns.Runtime.callJSMethod(Runtime.java:1081)
at com.tns.gen.java.lang.Runnable.run(Runnable.java:17)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
LOG from device Marvin: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
LOG from device Marvin: An uncaught Exception occurred on "main" thread.
Unable to start activity ComponentInfo{org.nativescript.preview/com.tns.NativeScriptActivity}:
com.tns.NativeScriptException: Calling js method onCreate failed
Error: Main entry is missing. App cannot be started. Verify app bootstrap.
StackTrace:
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.preview/com.tns.NativeScriptActivity}:
com.tns.NativeScriptException: Calling js method onCreate failed
Error: Main entry is missing. App cannot be started. Verify app bootstrap.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3037)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: com.tns.NativeScriptException: Calling js method onCreate failed
Error: Main entry is missing. App cannot be started. Verify app bootstrap.
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1242)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:1122)
at com.tns.Runtime.callJSMethod(Runtime.java:1109)
at com.tns.Runtime.callJSMethod(Runtime.java:1089)
at com.tns.Runtime.callJSMethod(Runtime.java:1081)
at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:20)
at android.app.Activity.performCreate(Activity.java:7149)
at android.app.Activity.performCreate(Activity.java:7140)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1288)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3017)
... 11 more
Add enableProdMode() in main.ts file in the project.
Like:-
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
import { AppModule } from "./app/app.module";
import { enableProdMode } from "#angular/core";
enableProdMode();
platformNativeScriptDynamic().bootstrapModule(AppModule);
app.component.ts:-
import { Component } from "#angular/core";
#Component({
moduleId: module.id,
selector: "ns-app",
templateUrl: "app.component.html"
})
export class AppComponent { }
login.component.ts:-
import { Component } from "#angular/core";
#Component({
moduleId: module.id,
selector: "ns-login",
templateUrl: "./login.component.html"
})
export class LoginComponent { }

Nativescript: Strange error after app gets deployed

I created a very basic Nativescript Android app that uses the nativescript-barcodescanner plugin. The app builds successfully but when it gets deployed on the emulator I get the following error. Any idea what I can do to resolve this or what could be causing this?
error:
java.lang.RuntimeException: Unable to resume activity {org.nativescript.barcodescanner/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreateView failed
Error: File /data/data/org.nativescript.barcodescanner/files/app/.components/information/information.component.html does not exist. Resolved from: .components/information/information.component.html.
File: "/data/data/org.nativescript.barcodescanner/files/app/tns_modules/nativescript-angular/resource-loader.js, line: 22, column: 12
StackTrace:
Frame: function:'FileSystemResourceLoader.get', file:'/data/data/org.nativescript.barcodescanner/files/app/tns_modules/nativescript-angular/resource-loader.js', line: 22, column: 19
Frame: function:'DirectiveNormalizer._fetch', file:'/data/data/org.nativescript.barcodescanner/files/app/tns_modules/#angular/compiler/bundles/compiler.umd.js', line: 13661, column: 45
Frame: function:'DirectiveNormalizer.normalizeTemplateAsync', file:'/data/data/org.nativescript.barcodescanner/files/
And the last few lines of my command prompt:
BUILD SUCCESSFUL
Total time: 1 mins 9.45 secs
Project successfully built
Successfully deployed on device with identifier '192.168.8.101:5555'.
W/System.err( 2258): at com.tns.Runtime.callJSMethodNative(Native Method)
W/System.err( 2258): at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:865)
W/System.err( 2258): at com.tns.Runtime.callJSMethodImpl(Runtime.java:730)
W/System.err( 2258): at com.tns.Runtime.callJSMethod(Runtime.java:716)
W/System.err( 2258): at com.tns.Runtime.callJSMethod(Runtime.java:697)
W/System.err( 2258): at com.tns.Runtime.callJSMethod(Runtime.java:687)
It seems that it can not find .components/information/information.component.html and prevents from resuming
the activity , maybe there is a problem with you relative path or something(like components instead of .components)

Building Android AOSP fails after adding new API as there are new APIs than the previous SDK release. How to fix this?

I am adding a new API in Android input layer. I am getting an error while building aosp due to new API available than the previous SDK release. How to fix this?
I have copied the error below:
Checking API: checkpublicapi-last
java -Xmx1024m -classpath /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin//javac:out/host/linux-x86/framework/doclava.jar:out/host/linux-x86/framework/jsilver.jar com.google.doclava.apicheck.ApiCheck -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 prebuilts/sdk/api/22.txt out/target/common/obj/PACKAGING/public_api.txt frameworks/base/api/removed.txt out/target/common/obj/PACKAGING/removed.txt
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/javadoc/ClassDoc
at com.google.doclava.apicheck.ApiFile.parsePackage(ApiFile.java:97)
at com.google.doclava.apicheck.ApiFile.parseApi(ApiFile.java:76)
at com.google.doclava.apicheck.ApiCheck.parseApi(ApiCheck.java:144)
at com.google.doclava.apicheck.ApiCheck.checkApi(ApiCheck.java:112)
at com.google.doclava.apicheck.ApiCheck.main(ApiCheck.java:67)
Caused by: java.lang.ClassNotFoundException: com.sun.javadoc.ClassDoc
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 5 more
You have tried to change the API from what has been previously released in
an SDK. Please fix the errors listed above.
make: *** [out/target/common/obj/PACKAGING/checkpublicapi-last-timestamp] Error 38
If you are not rebuilding the entire AOSP by doing a make clean and make -j8, then this error may crop up. Try doing a clean build of AOSP as building without cleaning will not rebuild any previously built objects and intermediates, which do not have to built again after your modifications.
Switching from OpenJDK to Oracle Java solved the issue.

How to analyse stack trace of the exceptions which comes in the case of crashes in android

I am using crittercism tool to get crash reports.I receive mails when there is a crash but I am not getting the meaning of the stack trace which shows the logs for the crashes.
for eg :
0 java.util.ConcurrentModificationException
1 at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:607)
2 at com.webaroo.replyall.utils.ah.d(Unknown Source)
3 at com.webaroo.replyall.utils.ah.b(Unknown Source)
4 at com.webaroo.privatechat.ui.f.getView(Unknown Source)
5 at android.widget.AbsListView.obtainView(AbsListView.java:1448)
6 at android.widget.ListView.makeAndAddView(ListView.java:1786)
7 at android.widget.ListView.fillSpecific(ListView.java:1325)
8 at android.widget.ListView.layoutChildren(ListView.java:1617)
9 at com.webaroo.replyall.controls.CustomListView.layoutChildren(Unknown Source)
10 at android.widget.AbsListView.onLayout(AbsListView.java:1299)
11 at com.webaroo.replyall.controls.CustomListView.onLayout(Unknown Source)
12 at android.view.View.layout(View.java:7225)
13 at android.widget.RelativeLayout.onLayout(RelativeLayout.java:943)
14 at android.view.View.layout(View.java:7225)
15 at android.widget.FrameLayout.onLayout(FrameLayout.java:369)
16 at android.view.View.layout(View.java:7225)
17 at android.widget.FrameLayout.onLayout(FrameLayout.java:369)
18 at android.view.View.layout(View.java:7225)
19 at android.view.ViewRoot.performTraversals(ViewRoot.java:1189)
20 at android.view.ViewRoot.handleMessage(ViewRoot.java:1914)
21 at android.os.Handler.dispatchMessage(Handler.java:130)
22 at android.os.Looper.loop(SourceFile:351)
23 at android.app.ActivityThread.main(ActivityThread.java:3833)
24 at java.lang.reflect.Method.invokeNative(Native Method)
25 at java.lang.reflect.Method.invoke(Method.java:538)
26 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
27 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:659)
28 at dalvik.system.NativeStart.main(Native Method)
In the above logs I am not able to get which of the above line is exactly causing crash or throwing the exception.What exactly all those lines points at?Also what written in the brackets() at the end of each line means?
Scan the trace up to down and try to see something you recognize as your code. In this case it seems android.widget.AbsListView.obtainView throws a ConcurrentModificationException at line 1448.
Your exception is "ConcurrentModificationException" which means there is two or more threads trying to use an ArrayList.... your code is obfuscated, but it seems like an error at a ListAdapter.
The written in "brackets()" are the source:codeLine ... but "Unknown Source" means he can't specify or found the source, maybe cause obfuscation you used.
Trace it line by line and you will see what class of your application has a problem and with the line number where the crash actually occurs.

Categories

Resources