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

Android Proguard mapping files are not found when using product flavour & build type combinations

Pablo.Coberly
Creator

Android agent plugin version: 

com.appdynamics:appdynamics-gradle-plugin:20.10.0

 

Using the Android Gradle plugin and calling an assembly task for a particular Android product flavour & build type puts the mapping files in an output folder that the AppDynamics Android plugin cannot find.

 

For example, where "test" is the product flavour and "prod" is the build type.

 

 

./gradlew assembleTestProd

 

 

 

Gives the output:

 

 

 

> Task :app:appDynamicsUploadProguardMappingTestProd
<UploadProguardMappingFileTask_Decorated> Proguard is enabled but mapping file was not generated. Please check your build configuration.

 

 

 

Gradle puts the mapping file in:

 

build/outputs/mapping/testProd/

 

But the Appdynamics plugin seems to expect the mapping file to be in

 

build/outputs/mapping/test/

 

Expectation:

 

AppDynamics plugin should create tasks that upload the mapping file from the same output location as the specific product flavour and build type that was assembled.

 

4 REPLIES 4

Pablo.Coberly
Creator

I've tried specifying the mapping file location in the proguard-rules.pro:

 

-printmapping build/outputs/mapping/test/mapping.txt

But again, it seems the task appDynamicsUploadProguardMappingTestProd is looking for the mapping files before they are there. 

 

I've also tried hooking into the task to add a dependency: 

// Put the proguard mapping files where appd expects them.
task copyProguardMappingFiles(type: Copy) {
from "$buildDir/outputs/mapping/testProd"
include "*.*"
into "$buildDir/outputs/mapping/test"
} 
tasks.matching { it.name == 'appDynamicsUploadProguardMappingTestProd' }.all { Task task ->
task.dependsOn 'copyProguardMappingFiles'
}

Now if I run the task twice in succession, the second run doesn't warn about not finding the mapping files, because it seems to be uploading the files that were copied to the expected location the first time.

 

 

 

 

FYI, I've updated the Gradle plugin and run time versions to the latest versions:

 

// App dynamics Plugin
classpath "com.appdynamics:appdynamics-gradle-plugin:21.2.1"
implementation 'com.appdynamics:appdynamics-runtime:21.2.1'

 And the same thing happens.

Pablo.Coberly
Creator

I raised a support ticket with AppDynamics support and they were able to reproduce the issue. The dev team are working on a resolution.

Appdynamics says "Developers confirmed that this issue will be fixed for the next Agent update, which should come out next month."

Boggles my mind that I have to give these updates in this forum and not Appdynamics people themselves.