Nativescript: Strange error after app gets deployed - android

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)

Related

Update Gradle to Version 7.0.2

Updating Gradle from version 4.2.0 to 7.0.2. ended up in an error during minifying with R8. (Using Java 1.8)
Unfortunately, the error message is not very telling (see below).
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at Version.fakeStackEntry(Version_3.0.69.java:0)
at com.android.tools.r8.utils.w.a(SourceFile:68)
at com.android.tools.r8.utils.w.a(SourceFile:28)
at com.android.tools.r8.utils.w.a(SourceFile:27)
at com.android.tools.r8.R8.a(R8.java:29)
at com.android.tools.r8.R8.run(R8.java:3)
at com.android.builder.dexing.R8Tool.runR8(r8Tool.kt:301)
at com.android.build.gradle.internal.tasks.R8Task$Companion.shrink(R8Task.kt:592)
at com.android.build.gradle.internal.tasks.R8Task.doTaskAction(R8Task.kt:443)
at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(BaseTask.kt:63)
at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:51)
at com.android.build.gradle.internal.tasks.NonIncrementalTask.taskAction(NonIncrementalTask.kt:94)
at jdk.internal.reflect.GeneratedMethodAccessor512.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
... 118 more
Caused by: java.lang.NullPointerException: Cannot invoke "com.android.tools.r8.graph.B.F()" because "<parameter1>" is null
Did anybody face / solve the same problem?

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 { }

NativeScriptException: Corrupted navigation stack

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.

Cordova App breaks on Android 5.0

Cordova App breaks on Android lollipop, During app installation this is what i see in the logcat, though i am not sure if these are the actual cause of the error. (app installs/works fine on versions < 5.0)
using cordova v-5.1.1 & cordova-android#4.0.2
I/PersonaManagerService( 3485): PersonaId don't exist
I/ActivityManager( 3485): do not start freezing screen for locked container getKeyguardshowstate = false
E/Parcel ( 3485): Class not found when unmarshalling: com.android.packageinstaller.InstallFlowAnalytics
E/Parcel ( 3485): java.lang.ClassNotFoundException: com.android.packageinstaller.InstallFlowAnalytics
further downword in the logs i see this
D/ApplicationPolicy( 3485): isStatusBarNotificationAllowedAsUser: packageName = com.android.providers.downloads,userId = 0
V/ApplicationPolicy( 3485): isApplicationStateBlocked userId 0 pkgname com.android.providers.downloads
W/NotificationService( 3485): Pray mode not found android.content.pm.PackageManager$NameNotFoundException: Application package com.sec.android.settings.praymodewidget not found
I/PackageManager( 3485): do mInstaller.dexopt : 0
D/PackageManager( 3485): Time to dexopt: 1.389 seconds
W/System.err( 3485): java.io.FileNotFoundException: /data/app/com.TestApp.Test-1: open failed: EISDIR (Is a directory)
W/System.err( 3485): at libcore.io.IoBridge.open(IoBridge.java:456)
W/System.err( 3485): at java.io.FileInputStream.<init>(FileInputStream.java:76)
W/System.err( 3485): at android.content.pm.PackageParser.getHashValueOfPackage(PackageParser.java:5170)
W/System.err( 3485): at com.android.server.pm.PackageManagerService.saveHash(PackageManagerService.java:19974)
W/System.err( 3485): at com.android.server.pm.PackageManagerService.access$5800(PackageManagerService.java:352)
W/System.err( 3485): at com.android.server.pm.PackageManagerService$21.run(PackageManagerService.java:19959)
W/System.err( 3485): Caused by: android.system.ErrnoException: open failed: EISDIR (Is a directory)
W/System.err( 3485): at libcore.io.IoBridge.open(IoBridge.java:446)
W/System.err( 3485): ... 5 more
W/System.err( 3485): remove failed: ENOENT (No such file or directory) : /data/system/packages.xml.bak
W/System.err( 3485): remove failed: ENOENT (No such file or directory) : /data/system/users/0/package-restrictions.xml.bak
D/PackageManager( 3485): New package installed
Though the application then installs successfully but there are rendering issue's when i start the app.
In-case you need some other information on the error let me know.

Categories

Resources