microsoftconnect/ms-intune-app-sdk-android

Build failure after upgrade grade 8

Satoshi-Sakamoto147 opened this issue ยท 11 comments

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.
    It's similar to the ticket below, but it wasn't reopened, so I created a new ticket.
    #171

  3. Are you using the latest version of the [SDK and Plugin]?
    Yes

Summary

Please briefly describe the issue you are experiencing.

Details

  • Intune Android App SDK Version: 9.7.0
  • Gradle Version: 8.0
  • AGP Version: 8.1.1
  • Operating System (Mac, Linux, Windows) and Version: Windows
  • Android Studio Version: Giraffe | 2022.3.1

Logs

  1. Gradle build logs

Zip file 'C:\workspace\app\build\intermediates\classes\devHogeHogeDebug\ALL\devHogeHogeDebugMamifyClasses\classes.jar' already contains entry 'org/opencv/BuildConfig.class', cannot overwrite

Since the log of our product code cannot be published, I customized Taskr-Sample-Intune-Android-App and output the log.
patch file:
intune_gradle8.patch

Build file 'C:\workspace\Taskr-Sample-Intune-Android-App\app\build.gradle' line: 12

A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.microsoft.intune.mam'.
   > Gradle 8 is not yet supported. Please use the -preview version of the plugin.

I have the same failure with an other class file and no solution this problem.

@Satoshi-Sakamoto147 Was your app previously integrated with the MAM SDK and then began failing when updated? Or is this a brand-new integration?

For future, please add a summary of the issue in the location provided by the template.

I have the same error as @Satoshi-Sakamoto147 . For me, the MAM SDK was already included before I wanted to perform the grade update.

@ostannar Included and properly integrated? Was this a Gradle only update or an SDK + Gradle update? Can you share your logs as well?

Since the log of our product code cannot be published, I customized Taskr-Sample-Intune-Android-App and output the log.
patch file:
intune_gradle8.patch

Log:

Build file 'C:\workspace\Taskr-Sample-Intune-Android-App\app\build.gradle' line: 12

A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.microsoft.intune.mam'.
   > Gradle 8 is not yet supported. Please use the -preview version of the plugin.

Although it is different from the error in my environment, does this mean that ms-intune-app-sdk does not support gradle8 yet?

@meghandaly
It was a Gradle and SDK update. In the meantime I took back the Gradle update and left the SDK with version 9.7.0. That runs so far without problems.

But I would also like to update to Gradle 8. I get the same error message as @Satoshi-Sakamoto147
Show issue #171

How can this be solved?

I have the same error also with version 10.0.0 of Gradle plugin.

Can someone tell me how to solve the problem?

@Satoshi-Sakamoto147 and @ostannar

Can you please update your version of Javassist to 3.29.2? We missed a documentation update (updates currently pending doc team approval) that specified this as a dependency for the MAM SDK โ‰ฅ 10.0.0.

@meghandaly
I tried updating Javassist to 3.29.2,(or latest version 3.30.2) but the result remained the same.

  1. I get code from git@github.com:msintuneappsdk/Taskr-Sample-Intune-Android-App.git master branch.
  2. Apply this patch
    intune_example_update_gradle8.patch

Hi all, the Sample app repo is currently consuming MAM SDK 9.5.0, which needs to use the preview version of the MAM plugin to work with AGP 8+. We will work to get this updated, but I can confirm that this works locally and does not reproduce the original issue reported ("Zip file already contains entry"). We will still need Gradle logs and the Build Plugin Report Logs to investigate this issue.

  • Write the output of your Gradle build (with the --debug and --stacktrace options) to a file and attach it to this issue.
  • Enable reporting and share the resulting files at output\logs as a zip file.

@bannus cc: @ostannar @meghandaly @oydang
Thank you for your information.
I was able to build with Gradle 8 and launch Taskr-Sample-Intune-Android-App.

  1. download https://github.com/msintuneappsdk/Taskr-Sample-Intune-Android-App latest version(c11ee86771f7dbc537b2e19e88eaed77ae06b4f0)
  2. Start Android Studio
  3. Apply 20240329_upgrade_to_gradle_8.patch ( include Microsoft.Intune.MAM.SDK.aar and com.microsoft.intune.mam.build.jar(from ms-intune-app-sdk-android-10.0.0) replacement)
  4. Click SyncNow(or Try Again) in gradle file
  5. rebuild

My Development Environment

Android Studio AGP Gradle Version
Iguana 2023.2.1 8.3.1 8.4