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

Fail to add AppMon sdk to my android application

pakorn_koo
Newcomer

Hi, I have a problem, I try to add AppMon to my sample android application but I got an error during building process. The error is show below.

11:25:40.179 [ERROR] [system.err] 2017-03-09 11:25:40.179 INFO: APKit-AdkInstrumentor(1): Combined DEX ... #methods=35292 11:25:40.180 [ERROR] [system.err] 2017-03-09 11:25:40.179 INFO: APKit-AdkInstrumentor(1): Instrumenting /home/soulski/Projects/axiata/MyApplication/app/build/outputs/apk/app-debug/combined-classes.dex 11:25:43.948 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running 11:25:43.948 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry. 11:25:43.948 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired. 11:25:43.948 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry. 11:25:43.949 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry. 11:25:43.949 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired. 11:25:43.949 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry. 11:25:44.072 [ERROR] [system.err] 2017-03-09 11:25:44.072 INFO: APKit-AdkInstrumentor(1): Instrumented DEX ... #methods=35303 11:25:45.190 [ERROR] [system.err] 2017-03-09 11:25:45.190 INFO: APKit-AdkInstrumentor(1): Using Dynatrace OneAgent (Android) 6.5.10.1012 11:25:45.191 [ERROR] [system.err] 2017-03-09 11:25:45.191 INFO: caa-jb(1): Rebuilding APK ... 11:25:45.758 [ERROR] [system.err] Exception in thread "main" com.dynatrace.android.instrumentation.diag.a: Failed to rebuild APK ... run in debug mode to see more details 11:25:45.759 [ERROR] [system.err] at com.dynatrace.android.instrumentation.AdkInstrumentor.a(SourceFile:191) 11:25:45.759 [ERROR] [system.err] at com.dynatrace.android.instrumentation.AdkInstrumentor.main(SourceFile:1189) 11:25:45.788 [QUIET] [system.out] Instrumentation failed 11:25:45.789 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED 11:25:45.789 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command '/home/soulski/Projects/axiata/MyApplication/app/build/tmp/prepareApkit/dynatrace-mobile-agent-android-6.5.10.1012/Android/auto-instrumentor/instrument.sh'' finished with exit value 5 (state: FAILED) 11:25:45.790 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context. 11:25:45.790 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app:autoInstrumentDebug' 11:25:45.790 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] :app:autoInstrumentDebug FAILED 11:25:45.791 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 168: dispatching class org.gradle.launcher.daemon.protocol.BuildEvent 11:25:45.791 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :app:autoInstrumentDebug (Thread[Daemon worker Thread 5,5,main]) completed. Took 32.138 secs. 11:25:45.791 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry] Worker root.52 completed (0 in use) 11:25:45.791 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 5,5,main]] finished, busy: 33.507 secs, idle: 0.034 secs 11:25:45.792 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 168: dispatching class org.gradle.launcher.daemon.protocol.BuildEvent 11:25:45.792 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 11:25:45.792 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 11:25:45.792 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 11:25:45.792 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong: 11:25:45.792 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':app:autoInstrumentDebug'. 11:25:45.792 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Process 'command '/home/soulski/Projects/axiata/MyApplication/app/build/tmp/prepareApkit/dynatrace-mobile-agent-android-6.5.10.1012/Android/auto-instrumentor/instrument.sh'' finished with non-zero exit value 5 11:25:45.793 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 11:25:45.793 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try: 11:25:45.793 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. 11:25:45.793 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] 11:25:45.793 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED 11:25:45.793 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] 11:25:45.793 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] Total time: 34.662 secs 11:25:45.794 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 168: dispatching class org.gradle.launcher.daemon.protocol.BuildEvent 11:25:45.795 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for task history cache (/home/soulski/Projects/axiata/MyApplication/.gradle/3.3/taskArtifacts) 11:25:45.795 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache fileHashes.bin (/home/soulski/Projects/axiata/MyApplication/.gradle/3.3/taskArtifacts/fileHashes.bin) 11:25:45.795 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on task history cache (/home/soulski/Projects/axiata/MyApplication/.gradle/3.3/taskArtifacts). 11:25:45.796 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs) 11:25:45.796 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 10 (avg: 0.0 secs, total: 0.0 secs) 11:25:45.796 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.ResolutionResultsStoreFactory] Deleted 2 resolution results binary files in 0.001 secs 11:25:45.796 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache Plugin Resolution Cache (/home/soulski/.gradle/caches/3.3/plugin-resolution) was closed 0 times. 11:25:45.798 [DEBUG] [org.gradle.process.internal.daemon.WorkerDaemonManager] Stopping 0 worker daemon(s). 11:25:45.798 [INFO] [org.gradle.process.internal.daemon.WorkerDaemonManager] Stopped 0 worker daemon(s). 11:25:45.798 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache Generated Gradle JARs cache (/home/soulski/.gradle/caches/3.3/generated-gradle-jars) was closed 0 times. 11:25:45.798 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for artifact cache (/home/soulski/.gradle/caches/modules-2) 11:25:45.798 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache artifact-at-repository.bin (/home/soulski/.gradle/caches/modules-2/metadata-2.23/artifact-at-repository.bin) 11:25:45.798 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-metadata.bin (/home/soulski/.gradle/caches/modules-2/metadata-2.23/module-metadata.bin) 11:25:45.798 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-versions.bin (/home/soulski/.gradle/caches/modules-2/metadata-2.23/module-versions.bin) 11:25:45.798 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on artifact cache (/home/soulski/.gradle/caches/modules-2). 11:25:45.798 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has finished executing the build.

Anyone have an idea?

Thanks.

1 REPLY 1

Thomas_Wirth1
Dynatrace Pro
Dynatrace Pro

From the below error message it looks like, that the android auto-instrumentor is not able to rebuild your apk file.

Exception in thread "main" com.dynatrace.android.instrumentation.diag.a: Failed to rebuild APK ... run in debug mode to see more details

Therefore I would recommend to run the auto-instrumentation in the debug mode and open a support ticket with the auto-instrumentor log file. To activate the debug logs use the property DTXLogLevel (see the below snippet):

dynatrace {
defaultConfig {
...
agentProperties 'DTXLogLevel': 'debug'
}
}