Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Class ref in pre-verified class resolved to unexpected implementation #84

Closed
@Ashish-Bansal

Description

@Ashish-Bansal

Hi everyone,

I have created an xposed module and one user is experiencing this error :

Loading modules from /data/app/com.phantom.onetapyoutubemodule-1.apk Loading class com.phantom.onetapyoutubemodule.YoutubeMediaHook java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation at dalvik.system.DexFile.defineClass(Native Method) at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:211) at dalvik.system.DexPathList.findClass(DexPathList.java:313) at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:51) at java.lang.ClassLoader.loadClass(ClassLoader.java:501) at java.lang.ClassLoader.loadClass(ClassLoader.java:461) at de.robv.android.xposed.XposedBridge.loadModule(XposedBridge.java:421) at de.robv.android.xposed.XposedBridge.loadModules(XposedBridge.java:386) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:120) at dalvik.system.NativeStart.main(Native Method)

(full log at http://ix.io/olo)

I found one old post on XDA forums regarding this issue :
http://forum.xda-developers.com/showpost.php?p=48498627&postcount=6877

but it didn't help me as it's very much old.

The problem is only one user is getting this error and other modules are working for him (Check the full log link).

Does anyone knows the reason ?

Thanks!

Activity

rovo89

rovo89 commented on Feb 12, 2016

@rovo89
Owner

You get a plus point for using the search function. Too few people use it...

but it didn't help me as it's very much old.

Old doesn't mean incorrect. ;) It's still the correct answer. You have compiled the Xposed API into your module's APK. So e.g. the XposedBridge class comes with your APK and the installed Xposed framework. When resolving references to this class, it's not clear which of the two is meant - hence the unexpected implementation error.

The solution (for Gradle) is to use provided instead of compile for the Xposed API dependency. Then you only have references to the framework classes, but don't include them in your APK.

Ashish-Bansal

Ashish-Bansal commented on Feb 13, 2016

@Ashish-Bansal
Author

Yeah, you are right, I compiled the Xposed Bridge into my module's APK.

I guess Dalvik is not able to remove that ambiguity but ART is able to do that(as I was using ART and it was working for me).

I checked source code of other modules which loaded fine according to logs. I wonder how those modules are working.

e.g. https://github.com/pylerSM/YouTubeBackgroundPlayback/blob/master/build.gradle#L43

Anyway, Thanks :)

rovo89

rovo89 commented on Feb 13, 2016

@rovo89
Owner

I guess Dalvik is not able to remove that ambiguity but ART is able to do that

Possible. It might be because under Dalvik, dexopt doesn't know anything about XposedBridge, but dex2oat under ART might know some things. Nevertheless, the API should never be compiled into modules.

TheDiamondYT1

TheDiamondYT1 commented on Jan 12, 2017

@TheDiamondYT1

So this means you cant develop using AIDE (doesnt support provided)

rovo89

rovo89 commented on Jan 13, 2017

@rovo89
Owner

It there's no way to say that the classes will be there on the device, but must not be packaged in the APK, then yes, you can't use that IDE.

TheDiamondYT1

TheDiamondYT1 commented on Jan 13, 2017

@TheDiamondYT1

You can. Just extract the jar and delete all the .class files in all directories BUT LEAVE the .java files.

TheDiamondYT1

TheDiamondYT1 commented on Jan 13, 2017

@TheDiamondYT1

Then set it to compile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @rovo89@Ashish-Bansal@TheDiamondYT1

        Issue actions

          Class ref in pre-verified class resolved to unexpected implementation · Issue #84 · rovo89/XposedBridge