sentry-android-gradle-plugin icon indicating copy to clipboard operation
sentry-android-gradle-plugin copied to clipboard

Execution failed for AsmClassesTransform

Open satyasivaprasad opened this issue 1 year ago • 17 comments

Gradle Version

7.1.3

AGP Version

7.1.3

Code Minifier/Optimizer

Proguard

Version

7.9.0

Sentry SDK Version

4.6.0

Steps to Reproduce

Execution failed for AsmClassesTransform:

Expected Result

Execution failed for task ':app:mergeExtDexQa'.

Could not resolve all files for configuration ':app:qaRuntimeClasspath'. Failed to transform vivalink-libs-core-1.4.aar (vigo.vivalink.libs:vivalink-libs-core:1.4) to match attributes {artifactType=android-dex, asm-transformed-variant=qa, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=26, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}. > Execution failed for AsmClassesTransform: /Users/siva/.gradle/caches/transforms-3/ae04c72823ca4937fa0d7b4659b6f560/transformed/jetified-vivalink-libs-core-1.4-runtime.jar. > java.lang.ArrayIndexOutOfBoundsException (no error message)

  • Try:

Actual Result

Error should be solved

satyasivaprasad avatar May 22 '24 08:05 satyasivaprasad

hi @satyasivaprasad, thanks for the report, we'll take a look and get back to you soon!

romtsn avatar May 22 '24 09:05 romtsn

@romtsn Any update?

satyasivaprasad avatar May 23 '24 03:05 satyasivaprasad

Hey @satyasivaprasad no updates as of now, we'll follow up on this issue once we managed to repro it or if we have questions.

kahest avatar May 27 '24 07:05 kahest

@satyasivaprasad from the stacktrace we can see vigo.vivalink.libs:vivalink-libs-core:1.4, is this a private library which is obfuscated?

markushi avatar May 29 '24 13:05 markushi

@satyasivaprasad most likely we won't be able to fix the issue without having access to the library, but you can work this around by excluding its classes from instrumentation as follows:

// in your app/build.gradle.kts
sentry {
  tracingInstrumentation {
  	excludes.set(setOf("vigo/vivalink/**"))
  }
}

romtsn avatar May 29 '24 13:05 romtsn

@satyasivaprasad have you had a chance to take a look at our suggestions?

romtsn avatar Jun 05 '24 13:06 romtsn

after adding

"sentry { tracingInstrumentation { excludes.set(setOf("vigo/vivalink/**")) } }"

facing the same issue

satyasivaprasad avatar Jun 06 '24 05:06 satyasivaprasad

@satyasivaprasad from the stacktrace we can see vigo.vivalink.libs:vivalink-libs-core:1.4, is this a private library which is obfuscated?

yes

satyasivaprasad avatar Jun 06 '24 05:06 satyasivaprasad

after adding

"sentry { tracingInstrumentation { excludes.set(setOf("vigo/vivalink/**")) } }"

facing the same issue

hmm, that should work, unless the library package name differs from vigo.vivalink.**. Can you check what's the package name of the classes coming from this lib?

romtsn avatar Jun 06 '24 07:06 romtsn

@romtsn package name of the classes coming from the library is "com.vivalnk"

I have also tried below tracingInstrumentation { excludes.set([ "vigo/vivalink/**", "com/vivalink/**" ]) }

but still not working

satyasivaprasad avatar Jun 06 '24 10:06 satyasivaprasad

 tracingInstrumentation { excludes.set([ "vigo/vivalink/**", "com/vivalink/**" ]) }

I'm not sure it's a correct way to set it. Do you use .gradle or .gradle.kts?

romtsn avatar Jun 06 '24 10:06 romtsn

.gradle

I am using ".gradle"

satyasivaprasad avatar Jun 06 '24 10:06 satyasivaprasad

oh ok, then it should be:

tracingInstrumentation { 
  excludes = ['com/vivalink/**']
}

romtsn avatar Jun 06 '24 11:06 romtsn

oh ok, then it should be:

tracingInstrumentation { 
  excludes = ['com/vivalink/**']
}

No luck , still facing issue

`Execution failed for task ':app:mergeExtDexQa'.

Could not resolve all files for configuration ':app:qaRuntimeClasspath'. Failed to transform vivalink-libs-core-1.4.aar (vigo.vivalink.libs:vivalink-libs-core:1.4) to match attributes {artifactType=android-dex, asm-transformed-variant=qa, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=26, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}. > Execution failed for AsmClassesTransform: /Users/siva/.gradle/caches/transforms-3/ae04c72823ca4937fa0d7b4659b6f560/transformed/jetified-vivalink-libs-core-1.4-runtime.jar. > java.lang.ArrayIndexOutOfBoundsException (no error message) `

satyasivaprasad avatar Jun 06 '24 13:06 satyasivaprasad

@satyasivaprasad alright, would you be able to share the library jar with us? I'm afraid without having access to it and being able to reproduce, we wouldn't be able to fix it. You can send it to me directly [email protected]

romtsn avatar Jun 07 '24 10:06 romtsn

hey @satyasivaprasad, I've finally had time to take a look into this, thanks for sending me over the library! Based on my observations, I think the following config should set you up:

tracingInstrumentation { 
  excludes = ['com/vivalink/**', 'com/ihealth/**']
}

please try it out and let us know if that helped. Thanks!

romtsn avatar Jun 20 '24 11:06 romtsn

@satyasivaprasad have you had a chance to look at my suggestion above?

romtsn avatar Jul 02 '24 08:07 romtsn

closing this issue. If it is still relevant, feel free to reopen and add a comment

stefanosiano avatar Jul 10 '24 12:07 stefanosiano