Xposed模块开发Cannot load module问题

想开发一个修改机器型号的模块,都在VirtualXposed上成功运行机型修改,信心满满的装到已经装了xposed的真机上,结果不生效,查看log是模块加载不成功

查看log如下

06-27 14:25:56.205 I/Xposed  (  318): Found Xposed class 'de/robv/android/xposed/XposedBridge', now initializing
06-27 14:25:56.751 I/Xposed  (  318): Loading modules from /data/app/com.xposed-1/base.apk
06-27 14:25:56.934 E/Xposed  (  318):   Cannot load module:
06-27 14:25:56.934 E/Xposed  (  318):   The Xposed API classes are compiled into the module's APK.
06-27 14:25:56.934 E/Xposed  (  318):   This may cause strange issues and must be fixed by the module developer.
06-27 14:25:56.934 E/Xposed  (  318):   For details, see: http://api.xposed.info/using.html

检查了build.grade的引用应该是没有问题的

dependencies {
    compileOnly 'de.robv.android.xposed:api:82'
    compileOnly 'de.robv.android.xposed:api:82:sources'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    }

但是还是抱着试一试的想法,尝试注释掉

    //implementation fileTree(dir: 'libs', include: ['*.jar'])

装到机器中发现问题解决

分析:我这边是把jar包放到libs下面的文件夹,官方文档特别写到不能使用compile,要用privode,而privode在Android Studio的3.1.4版本中换成了compileOnly,可能是后面的implementation覆盖了前面的compileOnly 发此文为记录这一个神奇的问题,暂未找到其他方式,所以目前的解决方案是如果要用到其他jar包需要手动一个个添加,不能使用filetree的方式

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值