cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

Auto-instrument APK failed

znsjfrjd
Newcomer

I tried to auto-instrument APK with Dynatrace OneAgent (Android) 7.1.10.2332, but the process failed with:
Throwable occurred: az: compile android manifest failed rc = 1
at aD.a(SourceFile:195)
at aD.a(SourceFile:151)
at aD.a(SourceFile:146)
at v.b(SourceFile:178)
at a.f(SourceFile:196)
at a.a(SourceFile:168)
at e.s(SourceFile:665)
at com.dynatrace.android.instrumentation.AdkInstrumentor.c(SourceFile:465)
at com.dynatrace.android.instrumentation.AdkInstrumentor.main(SourceFile:281)

Any suggestion?


5 REPLIES 5

Thomas_Wirth1
Dynatrace Pro
Dynatrace Pro


First, we recommend to always use the latest auto-instrumentor (and OneAgent) version (currently 7.2.1.1221). The 7.2 Android agent is compatible with your 7.1 AppMon environment. For further information look at the documentation.


In your case the auto-instrumentor was not able to successfully modify the AndroidManifest.xml file. To find out the root cause, you have to enable the debug logging with DTXLogLevel=debug. If you don't want to share the details of your app in the forum, you can create a support ticket and attach the debug logs there.

One possible problem could be that the 7.1.10.2332 auto-instrumentor does not support Android P (build level 28). The Android P support is only available in 7.2 version.


znsjfrjd
Newcomer

We use version 7.1.x with Android P for a long time and everything was OK. I change dynatrace version to 7.2.1.1221 acording to your suggestion, but problem still exists. I launched auto-instrumentation with "DTXLogLevel=debug" and the result is below. We can't figure out what is wrong.

2018-11-29 10:32:54.438 FINE: APKit-aD(28): Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Android\bgzbnp\bgz-app\app\build\tmp\prepareApkit\dynatrace-mobile-agent-android-7.1.10.2332\Android\auto-instrumentor\tools\win\aapt.exe, p, -v, --include-manifest-only, --min-sdk-version, 21, --target-sdk-version, 28, --no-version-vectors, -F, C:\Users\PIOTR~1.WOJ\AppData\Local\Temp\APKTOOL4903239970320390798.tmp, -0, arsc, -I, C:\Users\piotr.wojtowicz\AppData\Local\apktool\framework\1.apk, -S, C:\Android\bgzbnp\bgz-app\app\build\outputs\apk\bgzCucumber\url\GOmobile-1.10.0.10-url\res, -M, C:\Android\bgzbnp\bgz-app\app\build\outputs\apk\bgzCucumber\url\GOmobile-1.10.0.10-url\AndroidManifest.xml] 2018-11-29 10:32:54.438 FINE: APKit-aD(28): at brut.androlib.Androlib.buildResourcesFull(Androlib.java:504) 2018-11-29 10:32:54.438 FINE: APKit-aD(28): at brut.androlib.Androlib.buildResources(Androlib.java:424) 2018-11-29 10:32:54.438 FINE: APKit-aD(28): at brut.androlib.Androlib.compileManifest(Androlib.java:535) 2018-11-29 10:32:54.438 FINE: APKit-aD(28): at brut.androlib.Androlib.compileManifest(Androlib.java:511) 2018-11-29 10:32:54.438 FINE: APKit-aD(28): at brut.apktool.Main.cmdCompileManifest(Main.java:287) 2018-11-29 10:32:54.438 FINE: APKit-aD(28): at brut.apktool.Main.main(Main.java:86) 2018-11-29 10:32:54.438 FINE: APKit-aD(28): Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Android\bgzbnp\bgz-app\app\build\tmp\prepareApkit\dynatrace-mobile-agent-android-7.1.10.2332\Android\auto-instrumentor\tools\win\aapt.exe, p, -v, --include-manifest-only, --min-sdk-version, 21, --target-sdk-version, 28, --no-version-vectors, -F, C:\Users\PIOTR~1.WOJ\AppData\Local\Temp\APKTOOL4903239970320390798.tmp, -0, arsc, -I, C:\Users\piotr.wojtowicz\AppData\Local\apktool\framework\1.apk, -S, C:\Android\bgzbnp\bgz-app\app\build\outputs\apk\bgzCucumber\url\GOmobile-1.10.0.10-url\res, -M, C:\Android\bgzbnp\bgz-app\app\build\outputs\apk\bgzCucumber\url\GOmobile-1.10.0.10-url\AndroidManifest.xml] 2018-11-29 10:32:54.438 FINE: APKit-aD(28): at brut.androlib.res.AndrolibResources.aapt1Package(AndrolibResources.java:581) 2018-11-29 10:32:54.438 FINE: APKit-aD(28): at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:629) 2018-11-29 10:32:54.438 FINE: APKit-aD(28): at brut.androlib.Androlib.buildResourcesFull(Androlib.java:479) 2018-11-29 10:32:54.438 FINE: APKit-aD(28): ... 5 more 2018-11-29 10:32:54.438 FINE: APKit-aD(28): Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Android\bgzbnp\bgz-app\app\build\tmp\prepareApkit\dynatrace-mobile-agent-android-7.1.10.2332\Android\auto-instrumentor\tools\win\aapt.exe, p, -v, --include-manifest-only, --min-sdk-version, 21, --target-sdk-version, 28, --no-version-vectors, -F, C:\Users\PIOTR~1.WOJ\AppData\Local\Temp\APKTOOL4903239970320390798.tmp, -0, arsc, -I, C:\Users\piotr.wojtowicz\AppData\Local\apktool\framework\1.apk, -S, C:\Android\bgzbnp\bgz-app\app\build\outputs\apk\bgzCucumber\url\GOmobile-1.10.0.10-url\res, -M, C:\Android\bgzbnp\bgz-app\app\build\outputs\apk\bgzCucumber\url\GOmobile-1.10.0.10-url\AndroidManifest.xml] 2018-11-29 10:32:54.438 FINE: APKit-aD(28): at brut.util.OS.exec(OS.java:97) 2018-11-29 10:32:54.438 FINE: APKit-aD(28): at brut.androlib.res.AndrolibResources.aapt1Package(AndrolibResources.java:579) 2018-11-29 10:32:54.438 FINE: APKit-aD(28): ... 7 more 2018-11-29 10:32:54.442 FINE: APKit-aD(28): ProcessStreamReader finished 2018-11-29 10:32:54.451 FINE: APKit-aD(1): syncExecProcess rc=1 2018-11-29 10:32:54.451 SEVERE: APKit-AdkInstrumentor(1): compile android manifest failed rc = 1 Throwable occurred: az: compile android manifest failed rc = 1 at aD.a(SourceFile:195) at aD.a(SourceFile:151) at aD.a(SourceFile:146) at v.b(SourceFile:178) at a.f(SourceFile:196) at a.a(SourceFile:168) at e.s(SourceFile:665) at com.dynatrace.android.instrumentation.AdkInstrumentor.c(SourceFile:465) at com.dynatrace.android.instrumentation.AdkInstrumentor.main(SourceFile:281)


You are still using the auto-instrumentor version 7.1.10.2332. If you are using the Dynatrace Gradle plugin, you should clean and sync your project. This behavior should force Android Studio to use the new plugin version.

To troubleshoot your problem we need the full log file. The problem occurs in a 3rd party tool and the root cause is not visible in the stacktrace.


danielbr
Helper

I have the exact issue with android instrumentor 7.2.3.

Can someone share anything that might help?

10x,
Daniel


To find out the root cause, you have to enable debug logging with DTXLogLevel=debug.

Then you should create a support ticket an attach the debug logs + manifest file, the support team will look at it and determines the root cause.