microsoftconnect / ms-intune-app-sdk-android

Intune App SDK for Android enables data protection features and mobile app management via Microsoft Intune
41 stars 17 forks source link

MAM transformation task causes build failure (intuneDebugMamifyClasses/classes.jar already contains entry) #222

Closed parveen-bhatia closed 2 months ago

parveen-bhatia commented 3 months ago

Intune Android App SDK [Gradle Build Plugin] Issue

Questions to Ask Before Submission

  1. Does your app compile and launch successfully without the Intune App SDK? - Yes
  2. Have you checked the [Microsoft Intune App SDK for Android] repository for similar issues? - Yes
  3. Are you using the latest version of the [SDK and Plugin]? Yes

Summary

Please briefly describe the issue you are experiencing.

After upgrading our's project to AGP/Gradle 8.x, we upgraded Intune SDK and MAM plugin from 9.5.0 to 10.0.0. After that we started seeing this build failure:

Task :appian-android:intuneDebugMamifyClasses FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':appian-android:intuneDebugMamifyClasses'.
> Zip file '/Users/parveen.bhatia/repo/android-client/appian-android/build/intermediates/classes/intuneDebug/ALL/intuneDebugMamifyClasses/classes.jar' already contains entry 'com/appiancorp/core/expr/fn/modules/core/ClientEvaluatorOverridenFunctions.class', cannot overwrite

ClientEvaluatorOverridenFunctions.class is the part of our's internal libaray (.aar) which is included in our's project. As this library doesn't interact with system API's. We tried to exclude this class as suggested in documentation using following, but still getting same issue.

intunemam {
excludeClasses: ['com.appiancorp.core.expr.fn.modules.core.ClientEvaluatorOverridenFunctions']
} 

Questions:

Details

Logs

Android Studio / Gradle Logs

gradle_build_failure.txt

Gradle Build Plugin Report Logs

manifest-merger-intune-debug-report.txt.zip

parveen-bhatia commented 2 months ago

Please let us know if there is any update on it as we are completely blocked with it as of now.

mukeshk-ms commented 2 months ago

@parveen-bhatia can you please refer to this issue and see if the suggested solution helps in resolving it

parveen-bhatia commented 2 months ago

@mukeshk-ms i was able to fix this issue after upgrading AGP from 8.1.1 to 8.3.1. But i think it would be great if Intune SDK release notes and documentation can be updated about compatible AGP and Gradle versions, so that these kind of issues can be avoided. Thanks.