Skip to content

Runtime tries to invoke method on non existing base class #445

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
blagoev opened this issue May 9, 2016 · 5 comments
Closed

Runtime tries to invoke method on non existing base class #445

blagoev opened this issue May 9, 2016 · 5 comments

Comments

@blagoev
Copy link
Contributor

blagoev commented May 9, 2016

Bundle extends Object in Android 4.4 and Bundle extends BaseBundle on later android versions.
Invoking bundle.putInt() produces an error on devices running Android 4.4.4

The error is similar to this

MakeInstanceStrong (87, class android.os.Bundle)
D/TNS.Native(24250): RegisterInstance: Updating linked instance with its real class
D/TNS.Native(24250): SetClass called
D/TNS.Native(24250): ObjectManager::GetJSInstanceInfo: called
D/TNS.Native(24250): MetaDataEntry Method putInt's signature is: (Ljava/lang/String;I)V
D/TNS.Native(24250): CallJavaMethod called android/os/BaseBundle.putInt. Instance id: 807945176, isSuper=0
D/TNS.Native(24250): ObjectManager::GetJSInstanceInfo: called
D/TNS.Java(24250): Platform.getJavaObjectByID:87
W/dalvikvm(24250): JNI WARNING: can't call Landroid/os/BaseBundle;.putInt on instance of Landroid/os/Bundle; (CallVoidMethodA)
W/dalvikvm(24250): in Lcom/tns/Runtime;.callJSMethodNative:(IILjava/lang/String;IZ[Ljava/lang/Object;)Ljava/lang/Object; (CallVoidMethodA)
I/dalvikvm(24250): "main" prio=5 tid=1 RUNNABLE
I/dalvikvm(24250): | group="main" sCount=0 dsCount=0 obj=0x415efe58 self=0x4150c540
I/dalvikvm(24250): | sysTid=24250 nice=0 sched=0/0 cgrp=apps handle=1074233684
I/dalvikvm(24250): | state=R schedstat=( 1331894042 177783310 1766 ) utm=115 stm=18 core=1
I/dalvikvm(24250): at com.tns.Runtime.callJSMethodNative(Native Method)
I/dalvikvm(24250): at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:861)
I/dalvikvm(24250): at com.tns.Runtime.callJSMethodImpl(Runtime.java:726)
I/dalvikvm(24250): at com.tns.Runtime.callJSMethod(Runtime.java:712)
I/dalvikvm(24250): at com.tns.Runtime.callJSMethod(Runtime.java:693)
I/dalvikvm(24250): at com.tns.Runtime.callJSMethod(Runtime.java:683)
I/dalvikvm(24250): at com.tns.gen.android.app.Application_ActivityLifecycleCallbacks_ftns_modules_application_application_l33_c30__.onActivityResumed(Application_ActivityLifecycleCallbacks_ftns_modules_application_application_l33_c30__.java:24)
I/dalvikvm(24250): at android.app.Application.dispatchActivityResumed(Application.java:211)
I/dalvikvm(24250): at android.app.Activity.onResume(Activity.java:1109)
I/dalvikvm(24250): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
I/dalvikvm(24250): at android.app.Activity.performResume(Activity.java:5327)
I/dalvikvm(24250): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2780)
I/dalvikvm(24250): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2819)
I/dalvikvm(24250): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2254)
I/dalvikvm(24250): at android.app.ActivityThread.access$800(ActivityThread.java:141)
I/dalvikvm(24250): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1212)
I/dalvikvm(24250): at android.os.Handler.dispatchMessage(Handler.java:102)
I/dalvikvm(24250): at android.os.Looper.loop(Looper.java:136)
I/dalvikvm(24250): at android.app.ActivityThread.main(ActivityThread.java:5113)
I/dalvikvm(24250): at java.lang.reflect.Method.invokeNative(Native Method)
I/dalvikvm(24250): at java.lang.reflect.Method.invoke(Method.java:515)
I/dalvikvm(24250): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
I/dalvikvm(24250): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
I/dalvikvm(24250): at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm(24250):
E/dalvikvm(24250): VM aborting
F/libc (24250): Fatal signal 6 (SIGABRT) at 0x00005eba (code=-6), thread 24250 (ivescript.myApp)
I/DEBUG ( 212): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 212): Build fingerprint: 'Xiaomi/2014819/HM2014819:4.4.4/KTU84P/V7.1.3.0.KHJMICK:user/release-keys'
I/DEBUG ( 212): Revision: '0'
I/DEBUG ( 212): pid: 24250, tid: 24250, name: ivescript.myApp >>> org.nativescript.myApp <<<

@blagoev
Copy link
Contributor Author

blagoev commented May 9, 2016

notice this line
JNI WARNING: can't call Landroid/os/BaseBundle;.putInt on instance of Landroid/os/Bundle; (CallVoidMethodA)

@blagoev
Copy link
Contributor Author

blagoev commented May 9, 2016

This is related to this issue #404

@blagoev
Copy link
Contributor Author

blagoev commented May 9, 2016

In the Redmi 2 issue #404 the exact code is
https://github.com/MiCode/patchrom_android/blob/ea109c17d1383df894adbb1e88b64c547d7e5989/base-framework/framework.jar.out/smali/android/os/Bundle%241.smali

which indicates that Bundle extends Object and {N} runtime tries to invoke the putInt on BaseBundle class which is not present on that platform.

@blagoev blagoev added the bug label May 9, 2016
@calebeaires
Copy link

👍

@Plamen5kov
Copy link
Contributor

Plamen5kov commented Sep 14, 2016

We discussed this problem, and we updated the documentation with detailed explanation, what measures to take when supporting older devices. The updated documentation explaining dealing with metadata can be found here.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

6 participants