microsoftconnect / intune-app-wrapping-tool-android

Use the Intune App Wrapping Tool for Android to enable Android apps to be managed by Microsoft Intune
29 stars 11 forks source link

Crash opening views implemented with Jetpack Compose #98

Closed d2callpod closed 6 months ago

d2callpod commented 9 months ago

Questions to Ask Before Submission

  1. Does you app launch successfully without wrapping? yes
  2. Have you reviewed the prerequisites for App Wrapping? yes
  3. Does your issue have a solution in the Troubleshooting Guide? no
  4. Have you checked the Microsoft Intune App SDK for Android repository for similar issues? yes
  5. Are you using the latest version of the App Wrapper? yes

Describe the bug: With a wrapped apk navigating to views implemented with Jetpack Compose. There are no issues with the apk prior to wrapping.

To Reproduce Steps to reproduce the behavior:

  1. Wrap an APK with the Intune wrapping tool
  2. Launch the app
  3. Authenticate with Intune
  4. Navigate to views that are implemented with xml layouts
  5. Navigate to views implemented with Jetpack Compose
  6. The app crashes with the stacktrace below

Expected behavior: Jetpack Compose views open without crashing.

Screenshots and logs:

java.lang.IncompatibleClassChangeError: Found interface androidx.compose.ui.graphics.drawscope.DrawScope, but class was expected (declaration of 'androidx.compose.ui.graphics.drawscope.DrawScope' appears in /data/app/~~A2WLcqqu2Gybutp-zSRSQg==/com.keepersecurity.intune-xQXZL80eio-qnibnZdnbzg==/base.apk!classes13.dex)
    at androidx.compose.ui.graphics.drawscope.DrawScope.drawRect-n-J9OG0$default(DrawScope.kt:454)
    at androidx.compose.foundation.BackgroundNode.drawRect(Background.kt:163)
    at androidx.compose.foundation.BackgroundNode.draw(Background.kt:155)
    at androidx.compose.ui.node.LayoutNodeDrawScope.drawDirect-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:105)
    at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:86)
    at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:364)
    at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt:54)
    at androidx.compose.ui.node.NodeCoordinator$drawBlock$1$1.invoke(NodeCoordinator.kt:383)
    at androidx.compose.ui.node.NodeCoordinator$drawBlock$1$1.invoke(NodeCoordinator.kt:382)
    at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303)
    at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:500)
    at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256)
    at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133)
    at androidx.compose.ui.node.NodeCoordinator$drawBlock$1.invoke(NodeCoordinator.kt:382)
    at androidx.compose.ui.node.NodeCoordinator$drawBlock$1.invoke(NodeCoordinator.kt:380)
    at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
    at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:335)
    at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:277)
    at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:348)
    at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:176)
    at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:361)
    at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt:54)
    at androidx.compose.ui.node.NodeCoordinator$drawBlock$1$1.invoke(NodeCoordinator.kt:383)
    at androidx.compose.ui.node.NodeCoordinator$drawBlock$1$1.invoke(NodeCoordinator.kt:382)
    at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303)
    at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:500)
    at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256)
    at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133)
    at androidx.compose.ui.node.NodeCoordinator$drawBlock$1.invoke(NodeCoordinator.kt:382)
    at androidx.compose.ui.node.NodeCoordinator$drawBlock$1.invoke(NodeCoordinator.kt:380)
    at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
    at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:335)
    at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:277)
    at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:348)
    at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:926)
    at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:174)
    at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:361)
    at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:353)
    at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:926)

Smartphone (please complete the following information):

Intune app wrapping tool (please complete the following information):

Additional context: No

ChismanRaheem commented 8 months ago

HI @d2callpod Please confirm that if you are using ProGuard to eliminate unused class references from the app's primary DEX file. Note if you are using v3.1.0 or higher of the Android Gradle plugin, disable the D8 dexer

d2callpod commented 8 months ago

Hi @ChismanRaheem

We have Proguard disabled.

ChismanRaheem commented 7 months ago

HI @d2callpod Please collect diagnostic logs and share the incident ID with the full crash report, if available please provide us with sample app so that we can reproduce the issue with steps that you have provided.

Ref: https://learn.microsoft.com/en-us/mem/intune/user-help/send-logs-to-your-it-admin-by-email-android

d2callpod commented 7 months ago

@ChismanRaheem

Here is an example apk and it's source code.

intune-wrapped-compose-sample-apk.zip

ComposeApplication.zip

ChismanRaheem commented 7 months ago

@d2callpod Thank you we are looking into this.

ChismanRaheem commented 7 months ago

@d2callpod In this situation, JetPack Compose cannot be utilized, note we are looking into this internally it is advised to use the Intune SDK in place of the wrapper.

d2callpod commented 7 months ago

The SDK can be used within JetPack Compose apps? From looking at the documentation I wasn't sure.

ChismanRaheem commented 6 months ago

Hi @d2callpod I can see that this is still being investigated with our SDK team (internal tracking #16814898) in the meantime I am respectfully requesting a sample application, when available please provide a sample repro of the application.

d2callpod commented 6 months ago

I don't want to invest any more time in Intune unless it's clear the SDK can be used. I already put a lot of time into the use of Intune. I have low expectations of this being resolved. Especially after talking with the author of this blog post.

https://www.zacsweers.dev/is-viewpump-a-security-risk/amp/

ChismanRaheem commented 6 months ago

Hi @d2callpod Thank you for the update and providing your feedback on the issue. I am recommending that you engage the respective repository that aligns with the incident via https://github.com/msintuneappsdk/ms-intune-app-sdk-android/issues for further investigation with the Intune app sdk for Android.

Summary: Jetpack Compose is not supported with Intune app wrapper for Android.