Skip to main content

I want to use latest version of Intercom Android, it's 15.11.0 but I'm facing this issue when I try to build an Android application through Unity 2022

> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
> Compilation failed to complete, origin: /Users/Jesus.Garcia@productmadness.com/.gradle/caches/transforms-3/4a75e8b5239795acd12bc894c94ac93e/transformed/jetified-intercom-sdk-base-15.11.0-runtime.jar:io/intercom/android/sdk/Injector$1.class

I'm using gradle version 7.6 and AGP 7.4.2 but I see how you are using a most recent version
https://github.com/intercom/intercom-android/blob/master/sample/build.gradle
https://github.com/intercom/intercom-android/blob/master/sample/gradle/wrapper/gradle-wrapper.properties

So I was wondering if I would have to upgrade also to the same versions.

Regards,
Jesús.

Hi @Jesús García Manday, It’s Mat from the Support Engineering Team 😀

 

Yes, updating to the same versions used by the Intercom sample project could resolve the build issues, as the sample is typically configured to be compatible with the latest SDK changes.

From the sample project links you provided, here’s what to consider updating:

1. **Gradle Version**: Update your Gradle version to match the one in the sample (`gradle-wrapper.properties`). The Intercom sample project likely uses a Gradle version that aligns with their latest SDK, so aligning with it should help avoid compatibility issues.
   
2. **Android Gradle Plugin (AGP)**: If Intercom’s sample project uses a newer AGP version than 7.4.2, update your AGP to that version. You can find the AGP version in the `build.gradle` file, usually defined in the `classpath 'com.android.tools.build:gradle:AGP_VERSION'` line.

3. **Java Compatibility**: Verify that your Java version matches the one required by the updated Gradle and AGP. For newer Gradle versions, Java 11 or above is typically recommended.

4. **R8 Compatibility**: Since the error is from `R8`, which handles code shrinking and optimization, you may need to adjust `proguard-rules.pro` or disable shrinking temporarily to identify if any rule in the Intercom SDK needs adjustment.

Once you’ve aligned the versions, try rebuilding the project. Let me know if additional adjustments are needed!


Reply