NativeScript: Can't open the app on Android P
Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?
Yes
Tell us about the problem
If you have a device running the Android P Beta, the app doesn’t start anymore.
Which platform(s) does your issue occur on?
Android P (Beta)
Please provide the following version numbers that your issue occurs with:
- CLI: 4.0.0
- Cross-platform modules: 4.0.0
- Runtime(s): 4.0.1
Please tell us how to recreate the issue in as much detail as possible.
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).
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
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
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 26 (15 by maintainers)
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.
Hey All,
I filled in two separate issues for the
FragmentManager.loadAnimator()andNumberPicker.mSelectorWheelPaintAPIs 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
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:
setAccessibleoverrides 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.setAccessiblefor 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
setAccessibleto 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…
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!!! 😀
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.
@NickIliev Hope that helps