Reputation: 10292
Unable to install ByteBuddyAgent in android
code in 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'
code to install ByteBuddyAgent
ByteBuddyAgent.install();
This is the compilation error, since java.lang
don't have instrument and management packages.
Error:(31, 35) error: cannot access Instrumentation
class file for java.lang.instrument.Instrumentation not found
Upvotes: 2
Views: 1100
Reputation: 44032
Android only supports a subset of the official Java API. The instrumentation API is not supported by Android what makes agent installation impossible. See the documentation for this limitation.
Upvotes: 2