Yes
If you have a device running the Android P Beta, the app doesn't start anymore.
Android P (Beta)
Run the app (In my case Nativescript Angular) on a Android P device. The app crashes immediately.
I tried to create a new angular project (tns create sampleProj --ng
), a new typescript project (tns create sampleProjTSC --tsc
) and a plain ns project (tns create sampleProjPLAIN
). Got the same error.
(The Examples Nativescript App from the play store works).
05-09 08:00:36.465 2894 2894 E AndroidRuntime: com.tns.Runtime.callJSMethodNative(Native Method)
05-09 08:00:36.465 2894 2894 E AndroidRuntime: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
05-09 08:00:36.465 2894 2894 E AndroidRuntime: com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
05-09 08:00:36.465 2894 2894 E AndroidRuntime: com.tns.Runtime.callJSMethod(Runtime.java:957)
05-09 08:00:36.465 2894 2894 E AndroidRuntime: com.tns.Runtime.callJSMethod(Runtime.java:941)
05-09 08:00:36.465 2894 2894 E AndroidRuntime: com.tns.Runtime.callJSMethod(Runtime.java:933)
05-09 08:00:36.465 2894 2894 E AndroidRuntime: at com.tns.Runtime.callJSMethodNative(Native Method)
05-09 08:00:36.465 2894 2894 E AndroidRuntime: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
05-09 08:00:36.465 2894 2894 E AndroidRuntime: at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
05-09 08:00:36.465 2894 2894 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:957)
05-09 08:00:36.465 2894 2894 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:941)
05-09 08:00:36.465 2894 2894 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: com.tns.NativeScriptException:
System.err: Calling js method onViewAttachedToWindow failed
System.err:
System.err: Error: java.lang.NoSuchMethodException: loadAnimator [class android.app.Fragment, int, boolean, int]
System.err: java.lang.Class.getMethod(Class.java:2068)
System.err: java.lang.Class.getDeclaredMethod(Class.java:2047)
System.err: com.tns.Runtime.callJSMethodNative(Native Method)
System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: com.tns.gen.java.lang.Object_frame_29_36_AttachListener.onViewAttachedToWindow(Object_frame_29_36_AttachListener.java:12)
System.err: android.view.View.dispatchAttachedToWindow(View.java:18356)
System.err: android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397)
System.err: android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
System.err: android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
System.err: android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1732)
System.err: android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1443)
System.err: android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7125)
System.err: android.view.Choreographer$CallbackRecord.run(Choreographer.java:935)
System.err: android.view.Choreographer.doCallbacks(Choreographer.java:747)
System.err: android.view.Choreographer.doFrame(Choreographer.java:682)
System.err: android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:921)
System.err: android.os.Handler.handleCallback(Handler.java:873)
System.err: android.os.Handler.dispatchMessage(Handler.java:99)
System.err: android.os.Looper.loop(Looper.java:164)
System.err: android.app.ActivityThread.main(ActivityThread.java:6649)
System.err: java.lang.reflect.Method.invoke(Native Method)
System.err: com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
System.err: File: "file:///data/data/com.company.APPCode/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js, line: 595, column: 44
System.err:
System.err: StackTrace:
System.err: Frame: function:'initDefaultAnimations', file:'file:///data/data/com.company.APPCode/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 595, column: 45
System.err: Frame: function:'_setAndroidFragmentTransitions', file:'file:///data/data/com.company.APPCode/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 28, column: 5
System.err: Frame: function:'Frame._navigateCore', file:'file:///data/data/com.company.APPCode/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 237, column: 32
System.err: Frame: function:'FrameBase.performNavigation', file:'file:///data/data/com.company.APPCode/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 235, column: 14
System.err: Frame: function:'FrameBase._processNextNavigationEntry', file:'file:///data/data/com.company.APPCode/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 227, column: 22
System.err: Frame: function:'Frame._processNextNavigationEntry', file:'file:///data/data/com.company.APPCode/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 135, column: 58
System.err: Frame: function:'Frame._onAttachedToWindow', file:'file:///data/data/com.company.APPCode/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 111, column: 14
System.err: Frame: function:'AttachListener.onViewAttachedToWindow', file:'file:///data/data/com.company.APPCode/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 35, column: 27
System.err:
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: at com.tns.gen.java.lang.Object_frame_29_36_AttachListener.onViewAttachedToWindow(Object_frame_29_36_AttachListener.java:12)
System.err: at android.view.View.dispatchAttachedToWindow(View.java:18356)
System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397)
System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1732)
System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1443)
System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7125)
System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:935)
System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:747)
System.err: at android.view.Choreographer.doFrame(Choreographer.java:682)
System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:921)
System.err: at android.os.Handler.handleCallback(Handler.java:873)
System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: at android.os.Looper.loop(Looper.java:164)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6649)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
System.err: Caused by: java.lang.NoSuchMethodException: loadAnimator [class android.app.Fragment, int, boolean, int]
System.err: at java.lang.Class.getMethod(Class.java:2068)
System.err: at java.lang.Class.getDeclaredMethod(Class.java:2047)
System.err: ... 26 more
@RaphaelJenni thanks for reporting this issue. I've noticed that at this very moment there are only beta emulators and Android P is also still beta. Still, I was not able to reproduce the issue with the basic Hello World templates.
@NickIliev I tested it with the emulator. Got the same error.
I created a completely new project with the CLI.
Any way I could help?
@RaphaelJenni can you post detailed information about your environment including the used OS, the specifics of the created emulator (is it AVD or third-party), installed Android SDK and build-tools versions, NativeScript CLI version, Java version.
Tool | Version
-----|-------
OS | MacOS High Sierra (10.13.4) and Windows 10
Java | 1.8.0_144 (64bit)
Emulator | AVD, Nexus 5X, API P, x86, with Google Play
Android SDK | 5.1, 6.0, 7.1.1, 8.0, 8.1
Build-tools | 23.0.0 - 28.0.0-rc.1
TNS Version | 4.0.0
@NickIliev Hope that helps
Hit this exact issue after installing Android P beta on pixel2. So can't run NS apps on Android P with NS4x. I'll check all build tools later and report back.
Haven't gotten to my machine but I opened the preview app on my pixel2 running Android P beta and it crashed with the same output.
An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException:
Calling js method onViewAttachedToWindow failed
Error: java.lang.NoSuchMethodException: loadAnimator [class android.app.Fragment, int, boolean, int]
java.lang.Class.getMethod(Class.java:2068)
java.lang.Class.getDeclaredMethod(Class.java:2047)
com.tns.Runtime.callJSMethodNative(Native Method)
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
com.tns.Runtime.callJSMethod(Runtime.java:957)
com.tns.Runtime.callJSMethod(Runtime.java:941)
com.tns.Runtime.callJSMethod(Runtime.java:933)
com.tns.gen.java.lang.Object_frame_29_36_AttachListener.onViewAttachedToWindow(Object_frame_29_36_AttachListener.java:12)
android.view.View.dispatchAttachedToWindow(View.java:18356)
android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397)
android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1732)
android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1443)
android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7125)
android.view.Choreographer$CallbackRecord.run(Choreographer.java:935)
android.view.Choreographer.doCallbacks(Choreographer.java:747)
android.view.Choreographer.doFrame(Choreographer.java:682)
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:921)
android.os.Handler.handleCallback(Handler.java:873)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:164)
android.app.ActivityThread.main(ActivityThread.java:6649)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
File: "file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js, line: 595, column: 44
StackTrace:
Frame: function:'initDefaultAnimations', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 595, column: 45
Frame: function:'_setAndroidFragmentTransitions', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 28, column: 5
Frame: function:'Frame._navigateCore', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 237, column: 32
Frame: function:'FrameBase.performNavigation', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 235, column: 14
Frame: function:'FrameBase._processNextNavigationEntry', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 227, column: 22
Frame: function:'Frame._processNextNavigationEntry', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 135, column: 58
Frame: function:'Frame._onAttachedToWindow', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 111, column: 14
Frame: function:'AttachListener.onViewAttachedToWindow', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 35, column: 27
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
at com.tns.Runtime.callJSMethod(Runtime.java:957)
at com.tns.Runtime.callJSMethod(Runtime.java:941)
at com.tns.Runtime.callJSMethod(Runtime.java:933)
at com.tns.gen.java.lang.Object_frame_29_36_AttachListener.onViewAttachedToWindow(Object_frame_29_36_AttachListener.java:12)
at android.view.View.dispatchAttachedToWindow(View.java:18356)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1732)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1443)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7125)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:935)
at android.view.Choreographer.doCallbacks(Choreographer.java:747)
at android.view.Choreographer.doFrame(Choreographer.java:682)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:921)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
Caused by: java.lang.NoSuchMethodException: loadAnimator [class android.app.Fragment, int, boolean, int]
at java.lang.Class.getMethod(Class.java:2068)
at java.lang.Class.getDeclaredMethod(Class.java:2047)
... 26 more
file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js
that should help track it down.
One other note, the playground, preview apps both crash on start. Eddy Vs plugin app crashes on start. The older NS examples app (likely NS 2x doesn't crash on start).
hello facing the same issue reported by firebase Chrashlytics
smartphone Device
Brand: Google
Model: Pixel 2
Orientation: Portrait
RAM free: 1.61 GB
Disk free: 36.65 GB
plat_android Operating System
Version: P
Orientation: Portrait
Rooted: No
bug_report Crash
Date: May 10, 2018, 12:09:00 AM
Error:
Calling js method onViewAttachedToWindow failed Error: java.lang.NoSuchMethodException: loadAnimator [class android.app.Fragment, int, boolean, int] java.lang.Class.getMethod(Class.java:2068) java.lang.Class.getDeclaredMethod(Class.java:2047) com.tns.Runtime.callJSMethodNative(Native Method) com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088) com.tns.Runtime.callJSMethodImpl(Runtime.java:970) com.tns.Runtime.callJSMethod(Runtime.java:957) com.tns.Runtime.callJSMethod(Runtime.java:941) com.tns.Runtime.callJSMethod(Runtime.java:933) com.tns.gen.java.lang.Object_frame_32_36_AttachListener.onViewAttachedToWindow(Object_frame_32_36_AttachListener.java:12) android.view.View.dispatchAttachedToWindow(View.java:18356) android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397) android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404) android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404) android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404) android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404) android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404) android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1732) android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1443) android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7125) android.view.Choreographer$CallbackRecord.run(Choreographer.java:935) android.view.Choreographer.doCallbacks(Choreographer.java:747) android.view.Choreographer.doFrame(Choreographer.java:682) android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:921) android.os.Handler.handleCallback(Handler.java:873) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loop(Looper.java:164) android.app.ActivityThread.main(ActivityThread.java:6649) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826) File: "file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js, line: 595, column: 44 StackTrace: Frame: function:'initDefaultAnimations', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 595, column: 45 Frame: function:'_setAndroidFragmentTransitions', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 28, column: 5 Frame: function:'Frame._navigateCore', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 250, column: 32 Frame: function:'FrameBase.performNavigation', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 235, column: 14 Frame: function:'FrameBase._processNextNavigationEntry', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 227, column: 22 Frame: function:'Frame._processNextNavigationEntry', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 138, column: 58 Frame: function:'Frame._onAttachedToWindow', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 114, column: 14 Frame: function:'AttachListener.onViewAttachedToWindow', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 38, column: 27
Additional test with Android P Beta on Pixel emulator caused system alert to popup with the following message
Detected problems with API compatibility
Visit https://developer.android.com/preview/restrictions-non-sdk-interfaces for more info
The link states that
Reflection via Class.getDeclaredMethod(), Class.getMethod() will cause NoSuchMethodException thrown
Ah yea so this at the top of the doc:
Android P introduces new restrictions on the use of non-SDK interfaces, whether directly, via reflection, or via JNI.
These restrictions are applied whenever an app references a non-SDK interface or attempts to obtain its handle using reflection or JNI.
For more information about this decision, see Improving Stability by Reducing Usage of non-SDK Interfaces.
Joy oh joy š
If an additional stackTrace may help, facing this issue on production as well (N3.4.1, Pixel 2, android P)
Calling js method onStart failed
Error: java.lang.NoSuchMethodException: loadAnimator [class android.app.Fragment, int, boolean, int]
java.lang.Class.getMethod(Class.java:2068)
java.lang.Class.getDeclaredMethod(Class.java:2047)
com.tns.Runtime.callJSMethodNative(Native Method)
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
com.tns.Runtime.callJSMethod(Runtime.java:957)
com.tns.Runtime.callJSMethod(Runtime.java:941)
com.tns.Runtime.callJSMethod(Runtime.java:933)
com.tns.NativeScriptActivity.onStart(NativeScriptActivity.java:38)
android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1382)
android.app.Activity.performStart(Activity.java:7151)
android.app.ActivityThread.handleStartActivity(ActivityThread.java:2949)
android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:194)
android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:180)
android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:157)
android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:72)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1800)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loop(Looper.java:164)
android.app.ActivityThread.main(ActivityThread.java:6649)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
File: "<embedded>, line: 36, column: 1610972
StackTrace:
Frame: function:'initDefaultAnimations', file:'<embedded>', line: 36, column: 1610973
Frame: function:'_setAndroidFragmentTransitions', file:'<embedded>', line: 36, column: 1597801
Frame: function:'Frame._navigateCore', file:'<embedded>', line: 36, column: 617397
Frame: function:'FrameBase.performNavigation', file:'<embedded>', line: 36, column: 1012150
Frame: function:'FrameBase._processNextNavigationEntry', file:'<embedded>', line: 36, column: 1011991
Frame: function:'Frame._processNextNavigationEntry', file:'<embedded>', line: 36, column: 615783
Frame: function:'FrameBase.onLoaded', file:'<embedded>', line: 36, column: 1008713
Frame: function:'ActivityCallbacksImplementation.onStart', file:'<embedded>', line: 36, column: 627054
Frame: function:'NativeScriptActivity.onStart', file:'<embedded>', line: 36, column: 1519965
Yikes! For once Iām happy new Android version rollout / adoption is so slow.
Wow, this is some seriously bad news since it effects pretty much ALL the existing already published applications using NativeScript...
I've checked a couple things:
setAccessible
overrides in list pickers; if you aren't using list pickers in your app; I believe your NS 2.x app will continue to work without any issues. setAccessible
for both the loadAnimator and the same list picker color code. Since loadAnimator is used while navigating, the app crashes during startup.setAccessible
; fortunately most of them are not main stream; unsure about NS-Pro-UI as this could be another main stream vector, someone with repo access to this needs to check...Please note; getClass and the other api's are still valid EXCEPT for accessing internal API function under Android-P; so if you are accessing internal API; then your code should be using setAccessible to unlock the api access to actually used the value/function. This is why I searched for setAccessible
to narrow down the list...
@sipacate @toddanglin - This maybe something that Progress needs to open a dialog quickly with Google because literally a really huge chunk of NativeScript applications can no longer run on Android-P....
What if there isn't a SDK alternative?
We know that some apps may be using non-SDK interfaces in ways that do not have an SDK alternative. We value your feedback about where and how we need to expand and improve the public APIs for you. If you feel that you'll need the SDK API expanded before you can stop using non-SDK ones, please tell us via our bug tracker. We will be monitoring this list closely and using this valuable feedback to prioritize. It is critical for us to get this feedback in a timely manner so that we can continue to both tune the blacklist to minimize developer impact and also begin developing any needed alternatives for future platforms.
taken from their post here: https://android-developers.googleblog.com/2018/02/improving-stability-by-reducing-usage.html
I guess that would be one way to contact Google about the issue.
FYI we are already looking into this and will address the issues before the official Android P release. More info to follow as we have a better understanding of the impact and what needs to change.
Just a followup for people; I was just told by someone on that team that the FragementManager.LoadAnimation has been greylisted in the next version of Android-P. WooHoo, this will mean that the NS 3.x/4.x apps will start to run again properly on the next beta of Android-P!!! :grinning:
I have followed up and asked about the list-picker color to see if that is going to be greylisted also as that is the only other place that might cause a few apps some issues.
Hey All,
I filled in two separate issues for the FragmentManager.loadAnimator()
and NumberPicker.mSelectorWheelPaint
APIs that NativeScript uses through reflection in the issue tracker.
The update on them is that both APIs were greylisted.
I can confirm today that after the new android p beta release, the apps are not crashing anymore
I just tried I can replicate the issue emulator android P x86 :(
@superciccio - Can you provide a sample app that is failing? Which version of NativeScript?
I did that
ionic start myApp sidemenu --type=angular
and selected ionic v4
@superciccio You're on the wrong repo buddy, go check what's ionic doing with this issue
@superciccio - The command you are providing above is for ionic
, not NativeScript. ionic issue need to be reported to https://github.com/ionic-team/ionic
@NathanaelA I copied the wrong one
I meant this
tns create HelloWorld --template tns-template-blank-ng
and that is the exception
`
An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException:
Calling js method onViewAttachedToWindow failed
Error: java.lang.NoSuchMethodException: loadAnimator [class android.app.Fragment, int, boolean, int]
java.lang.Class.getMethod(Class.java:2068)
java.lang.Class.getDeclaredMethod(Class.java:2047)
com.tns.Runtime.callJSMethodNative(Native Method)
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
com.tns.Runtime.callJSMethod(Runtime.java:983)
com.tns.Runtime.callJSMethod(Runtime.java:967)
com.tns.Runtime.callJSMethod(Runtime.java:959)
com.tns.gen.java.lang.Object_frame_32_36_AttachListener.onViewAttachedToWindow(Object_frame_32_36_AttachListener.java:17)
android.view.View.dispatchAttachedToWindow(View.java:18356)
android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397)
android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1732)
android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1443)
android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7125)
android.view.Choreographer$CallbackRecord.run(Choreographer.java:935)
android.view.Choreographer.doCallbacks(Choreographer.java:747)
android.view.Choreographer.doFrame(Choreographer.java:682)
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:921)
android.os.Handler.handleCallback(Handler.java:873)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:164)
android.app.ActivityThread.main(ActivityThread.java:6649)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
File: "file:///data/data/org.nativescript.myphysio/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js, line: 611, column: 44
StackTrace:
Frame: function:'initDefaultAnimations', file:'file:///data/data/org.nativescript.myphysio/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 611, column: 45
Frame: function:'_setAndroidFragmentTransitions', file:'file:///data/data/org.nativescript.myphysio/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 30, column: 9
Frame: function:'Frame._navigateCore', file:'file:///data/data/org.nativescript.myphysio/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 251, column: 32
Frame: function:'FrameBase.performNavigation', file:'file:///data/data/org.nativescript.myphysio/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 235, column: 14
Frame: function:'FrameBase._processNextNavigationEntry', file:'file:///data/data/org.nativescript.myphysio/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 227, column: 22
Frame: function:'Frame._processNextNavigationEntry', file:'file:///data/data/org.nativescript.myphysio/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 138, column: 58
Frame: function:'Frame._onAttachedToWindow', file:'file:///data/data/org.nativescript.myphysio/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 114, column: 14
Frame: function:'AttachListener.onViewAttachedToWindow', file:'file:///data/data/org.nativescript.myphysio/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 38, column: 27
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
at com.tns.Runtime.callJSMethod(Runtime.java:983)
at com.tns.Runtime.callJSMethod(Runtime.java:967)
at com.tns.Runtime.callJSMethod(Runtime.java:959)
at com.tns.gen.java.lang.Object_frame_32_36_AttachListener.onViewAttachedToWindow(Object_frame_32_36_AttachListener.java:17)
at android.view.View.dispatchAttachedToWindow(View.java:18356)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1732)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1443)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7125)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:935)
at android.view.Choreographer.doCallbacks(Choreographer.java:747)
at android.view.Choreographer.doFrame(Choreographer.java:682)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:921)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
Caused by: java.lang.NoSuchMethodException: loadAnimator [class android.app.Fragment, int, boolean, int]
at java.lang.Class.getMethod(Class.java:2068)
at java.lang.Class.getDeclaredMethod(Class.java:2047)
... 26 more
`
@superciccio - Can you do a "tns info" inside your sample app folder and tell me which versions of everything you are using. Thanks.
@NathanaelA
here you go:
ā Getting NativeScript components versions information...
ā Component nativescript has 4.2.4 version and is up to date.
ā Component tns-core-modules has 4.2.1 version and is up to date.
ā Component tns-android has 4.2.0 version and is up to date.
ā Component tns-ios has 4.2.0 version and is up to date.
fresh clean almost an hour ago
I also tried to run on ios but It can't find the device ( didn't spent much time on find the root cause )
It can find Android emulator just fine it does start but then I have the exception, I don't a real devices with android P to test
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
FYI we are already looking into this and will address the issues before the official Android P release. More info to follow as we have a better understanding of the impact and what needs to change.