无法在 Android 中安装 ByteBuddyAgent
build.gradle 中的代码
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'net.bytebuddy:byte-buddy:1.4.18'
compile 'net.bytebuddy:byte-buddy-android:1.4.18'
compile 'net.bytebuddy:byte-buddy-agent:1.4.18'
安装 ByteBuddyAgent 的代码
ByteBuddyAgent.install();
这是编译错误,因为java.lang
没有仪器和管理包。
Error:(31, 35) error: cannot access Instrumentation
class file for java.lang.instrument.Instrumentation not found
最佳答案
Android 仅支持官方 Java API 的子集。 Android 不支持检测 API,这使得代理无法安装。请参阅文档了解此限制。
关于java - 错误: ByteBuddyAgent for ByteBuddy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38934437/