RevenueCat / purchases-kmp

RevenueCat SDK for Kotlin Multiplatform
MIT License
76 stars 2 forks source link

Generating APK/AAB fails at :androidApp:minifyReleaseWithR8 due to amazon-appstore-sdk #224

Open kasem-sm opened 3 days ago

kasem-sm commented 3 days ago

Describe the bug As the title says, Generating fails and the amazon-appstore-sdk comes from purchases-android

The error - java.lang.IllegalArgumentException: Provided Metadata instance has version 2.1.0, while maximum supported version is 2.0.0. To support newer versions, update the kotlinx-metadata-jvm library.

AGPBI: {"kind":"warning","text":"Expected stack map table for method with non-linear control flow. In later version of R8, the method may be assumed not reachable.","sources":[{"file":"/Users/user/.gradle/caches/modules-2/files-2.1/com.amazon.device/amazon-appstore-sdk/3.0.5/cb046867a6d127f404780c49287e63177e960304/amazon-appstore-sdk-3.0.5.jar"}],"tool":"R8"}
AGPBI: {"kind":"warning","text":"Expected stack map table for method with non-linear control flow. In later version of R8, the method may be assumed not reachable.","sources":[{"file":"/Users/user/.gradle/caches/modules-2/files-2.1/com.amazon.device/amazon-appstore-sdk/3.0.5/cb046867a6d127f404780c49287e63177e960304/amazon-appstore-sdk-3.0.5.jar"}],"tool":"R8"}
AGPBI: {"kind":"error","text":"java.lang.IllegalArgumentException: Provided Metadata instance has version 2.1.0, while maximum supported version is 2.0.0. To support newer versions, update the kotlinx-metadata-jvm library.","sources":[{}],"tool":"R8"}```

```> Task :androidApp:minifyReleaseWithR8 FAILED
java.lang.IllegalArgumentException: Provided Metadata instance has version 2.1.0, while maximum supported version is 2.0.0. To support newer versions, update the kotlinx-metadata-jvm library.
Screenshot 2024-09-26 at 11 33 47 PM
  1. Environment
    1. Platform: Android
    2. SDK version: 1.0.1+13.2.1
    3. OS version:
    4. IDE: Android Studio
    5. IDE version: Android Studio Ladybug | 2024.2.1 Beta 1
    6. Kotlin version - 2.1.0-Beta1
JayShortway commented 2 days ago

Hi @kasem-sm, thanks for reporting this! Does this happen as well when using Kotlin 2.0.x?

Also, if you click on the "Build PodTrueAI: failed" line, or maybe the ":androidApp:minifyReleaseWithR8", there should be more output on the right. Maybe the rest of the stack trace is there?

kasem-sm commented 2 days ago

Although it works with Kotlin 2.0.x, I had to upgrade to Kotlin 2.1.0-Beta because I’m using Xcode 16.

This is the output when I click "Build PodTrueAI: failed"


AGPBI: {"kind":"warning","text":"Expected stack map table for method with non-linear control flow. In later version of R8, the method may be assumed not reachable.","sources":[{"file":"/Users/user/.gradle/caches/modules-2/files-2.1/com.amazon.device/amazon-appstore-sdk/3.0.5/cb046867a6d127f404780c49287e63177e960304/amazon-appstore-sdk-3.0.5.jar"}],"tool":"R8"}
AGPBI: {"kind":"error","text":"java.lang.IllegalArgumentException: Provided Metadata instance has version 2.1.0, while maximum supported version is 2.0.0. To support newer versions, update the kotlinx-metadata-jvm library.","sources":[{}],"tool":"R8"}```

```> Task :androidApp:minifyReleaseWithR8 FAILED
java.lang.IllegalArgumentException: Provided Metadata instance has version 2.1.0, while maximum supported version is 2.0.0. To support newer versions, update the kotlinx-metadata-jvm library.
JayShortway commented 2 days ago

Thanks for the details! I haven't been able to reproduce it so far. I can see the same warning about the stack map table, but no errors. I have tried building a minified (and signed) APK with:

Some follow-up questions: