Skip to content

android.r8.optimizedResourceShrinking not supported (AGP 9.0.0) #35

@Kevinrob

Description

@Kevinrob

The SDK crash with android.r8.optimizedResourceShrinking=true (new default for AGP 9.0.0)

17:12:35.268  E  FATAL EXCEPTION: DefaultDispatcher-worker-3 (Fix with AI)
                 Process: com.example, PID: 17723
                 android.content.res.Resources$NotFoundException: Resource ID #0x0
                 	at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:304)
                 	at android.content.res.ResourcesImpl.openRawResource(ResourcesImpl.java:432)
                 	at android.content.res.Resources.openRawResource(Resources.java:1415)
                 	at android.content.res.Resources.openRawResource(Resources.java:1359)
                 	at ch.datatrans.payment.r.<init>(SourceFile:17)
                 	at ch.datatrans.payment.S3.invokeSuspend(SourceFile:7)
                 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:34)
                 	at kotlinx.coroutines.DispatchedTask.run(SourceFile:100)
                 	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(SourceFile:124)
                 	at kotlinx.coroutines.scheduling.TaskImpl.run(SourceFile:89)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(SourceFile:586)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(SourceFile:820)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(SourceFile:717)
                 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:704)
                 	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@705ce3, Dispatchers.IO]

https://android-developers.googleblog.com/2025/09/improve-app-performance-with-optimized-resource-shrinking.html

Starting with AGP 9.0.0, optimized resource shrinking becomes the standard behavior for any project that has the resource shrinker turned on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions