Troubleshoot OneAgent auto-instrumentation on Android
Find out how to solve problems related to setting up Android mobile app.
Auto-instrumentation
No, this is not supported. Generally, manual and auto instrumentation must use the same OneAgent for Android version.
These exceptions are trigger by the Apktool tool and aapt
. They indicate that the auto-instrumentor wasn't able to read/modify the binary files of your APK file.
These tools are shipped within the Mobile Agent zip file and are regularly updated through public updates. Therefore, you should always use the latest OneAgent for Android version.
If your app depends on a framework file from a manufacturer that is not part of the standard Android OS, then you manually have to install this framework file with the Apktool
. You can find the install command in the official Apktool documentation. In this case the auto-instrumentor is not able to successfully update the 1.apk
. Normally the auto-instrumentor takes care of renewing the framework APK by deleting the framework directory and recreating the 1.apk
file using the Apktool
tool. However the Apktool
will not clean its framework directory if more than just the 1.apk
are installed. In this case you must update the 1.apk
manually.
The provided APK file contains an old mobile agent. When you use a combination of manual and auto-instrumentation, you can't mix the OneAgent for Android versions.
You are using a resource from Android that is not part of the public.xml
file. Instead of referring to a non-public resource, you should copy the resource into your application and refer it directly, as recommended here.
The auto-instrumentor uses the tool Apktool
and this tool blocks non-public resources for safety reasons.
The auto-instrumentor uses tools like aapt
and Apktool
to extract information from the AndroidManifest.xml
file and to modify it. In this case the tools are not able to generate a compiled version of the modified AndroidManifest.xml
file. The exact error message is only shown, when
the DTXLogLevel
property is enabled.
These tools are shipped within the OneAgent for Android zip file and are regularly updated through public updates. Therefore, you should always use the latest OneAgent for Android version.
The provided APK file is already auto-instrumented and can't be auto-instrumented again. You must use an uninstrumented APK file.
No. Using DexGuard with the default configuration generates a protected APK file that the auto-instrumentor can't modify. The auto instrumentation process fails because the Unicode characters introduced by DexGuard are not supported. A possible workaround for this issue is to use -classobfuscationdictionary empty.txt
, where empty.txt
is an empty file. This option instructs DexGuard to assign obfuscated class names such as a
, b
, or c
, avoiding the Unicode class name issue.
You may have to deactivate additional protection and optimization features from DexGuard to generate an APK file that is compatible with the auto-instrumentor. If you do not want to modify you DexGuard configuration, then use manual instrumentation. Manual instrumentation is fully compatible with DexGuard or other protection tools.
he auto-instrumentor uses the tool Apktool (and aapt
) to unpack and decode the provided APK file. The exact error message is only shown, when the property DTXLogLevel
is enabled.
These tools are shipped within the OneAgent for Android zip file and are regularly updated through public updates. Therefore, you should always use the latest OneAgent for Android version.
If your app depends on a framework file from a manufacturer that is not part of the standard Android OS, then you manually have to install this framework file with the Apktool
. You can find the install command in the official Apktool documentation. In this case the auto-instrumentor is not able to successfully update the 1.apk
. Normally the auto-instrumentor takes care of renewing the framework APK by deleting the framework directory and recreating the 1.apk
file using the Apktool
tool. However the Apktool
will not clean its framework directory if more than just the 1.apk
are installed. In this case you must update the 1.apk
manually.
You have to adjust the default value of the DTXPrimaryDexLimit
property. read more details in What do I have to consider for Android multidex applications? for details.
No, the auto-instrumentor cancels the auto-instrumentation process, if the APK file is already auto-instrumented. You must use an uninstrumented APK file. You can run the auto-instrumentation process on a manually instrumented APK file.
The provided APK file contains an old mobile agent. When you use a combination of manual and auto-instrumentation, you can't mix the OneAgent for Android versions.
DESK Gradle plugin
There can be multiple reasons for this error message:
- Not specifying the
applicationId
or other mandatory properties. - Not adding a configuration block (
desk
) to your module'sbuild.gradle
file. - Not defining a configuration for your product flavor and also not adding a default configuration.
Check if you have added the buildscript
block with the classpath 'com.desk.tools:android:7.+'
dependency to your module's build.gradle
file.
Gradle was not able to find the specified version. Check if you have specified the correct version number. You can check the available version on JCenter and Maven Central. You also must add jcenter()
or mavenCentral()
to your buildscript
configuration.
Gradle was not able to find a version that matches your version settings. You can check the available version on JCenter and
Maven Central. You also have to add jcenter()
or mavenCentral()
to your buildscript
configuration.
Check if you have applied the DESK Gradle plugin before the desk
block and the desk.agent()
dependency.
apply plugin: 'com.desk.tools.android'
desk {
...
The DESK Gradle plugin started the auto-instrumentation, but it failed. Check the error message from the auto-instrumentor for further help.
The DESK Gradle plugin auto-instrumented your APK file, but was not able to successfully extract your signing information and sign the instrumented APK file with your certificate. Check if your DESK plugin version fits the used Android plugin version.
Because auto-instrumentation was successful, you can use the generated instrumented APK in the <project>/<module>/build/outputs/apk/<app_name>/dist
folder. You must sign the <app_name>.apk
file manually with your Google playstore certificate.
You have added the OneAgent for Android library multiple times. Check if you have added the DESK.jar
to your libs directory and remove it. See the section Enable manual API calls to enrich mobile-user experience data of the DESK Gradle plugin for more information on how to integrate manual instrumentation into your build process.
You have added the OneAgent for Android library multiple times. Check if you have added the DESK.jar
to your libs directory and remove it. See the section Enable manual API calls to enrich mobile-user experience data of the DESK Gradle plugin for more information on how to integrate manual instrumentation into your build process.
The log file is stored in the <project>/<module>/build/tmp/autoInstrument<build_variant>/logs
directory.