0

Starting my android-apk on the device, dalvik complains not to find some methods although all this methods are contained in classes.dex to see using apkanalyser dex packages .... These methods are from platform base android.jar

Why dalvik can not find them?

Background: This apk is built using the command line tools without gradle. (To understand the processes basically) Platform is android-25 excactly 25.3.1 build_tools_version="27.0.3"

The dalvik messages:

I/dalvikvm(17763): Could not find method   android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
W/dalvikvm(17763): VFY: unable to resolve virtual method 535: Landroid/content/res/TypedArray;.getType (I)I
D/dalvikvm(17763): VFY: replacing opcode 0x6e at 0x0008

but contained in classes.dex:

M d 1   1   133 android.support.v7.widget.TintTypedArray int getType(int)
M r 0   1   26  android.content.res.TypedArray int getType(int)

I do not expect souch warning because the methods are listed in classes.dex

1 Answers1

0

Any method that is referenced (i.e. used by an invoke instruction) will "exist" in the dex file. e.g. there will be an entry in the method id list for that method. That doesn't mean that the method itself exists.

If you look at the api documentation for TypedArray, you'll notice that the getType() method was only added as of api 21. api 19/20 (kitkat) was the last platform version that included dalvik, so your device is definitely less than api 21, and thus won't have the TypedArray.getType() method.

JesusFreke
  • 19,784
  • 5
  • 65
  • 68