Skip to main content
Question

Ionic Failed to build android app


Forum|alt.badge.img+1

Hello, Team, hope you are doing well.

I upgraded revenueCat module to latest one in my ionic/angular project.
this is the module in package.json
"@revenuecat/purchases-capacitor": "^7.3.1"

it’s working on xCode without issue.

but I can’t build android build on Android Studio.

Execution failed for task ':revenuecat-purchases-capacitor:compileDebugKotlin'.
> 'compileDebugJavaWithJavac' task (current target is 17) and 'compileDebugKotlin' task (current target is 19) jvm target compatibility should be set to the same Java version.
  Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

This is the error log when building.

 

if I use old package, the android build will work without error.

"@awesome-cordova-plugins/purchases": "^6.4.0"
"cordova-plugin-purchases": "^5.5.1"

 

Can anyone help me to resolve this issue?

Ryan Glanz
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • December 15, 2023

Hi,

Thanks for sharing. Could you do the suggested “run with --debug” to get more logs? I’ll bring it to our SDK team to take a look.


Forum|alt.badge.img+1

Hello, @Ryan Glanz Thanks for your reply.

I want to share the full repository with revenueCat module.

https://github.com/timeisgolden/ionic-test

this is just a simple ionic/angular/capacitor project, which is created 3 days ago.

I just installed the latest revenuecat module, and tried to build android version, 

got the error I reported.


Forum|alt.badge.img+2
  • New Member
  • May 2, 2024

@bai-feng-01b399 did you end up fixing this? I’ve just run into the same issue


happymeapp
Forum|alt.badge.img+2
  • New Member
  • November 5, 2024

I added this to the build.gradle for the module :revenuecat-purchases-capacitor

 

kotlinOptions {  jvmTarget = JavaVersion.VERSION_17}

 

added it under, 

compileOptions {    sourceCompatibility JavaVersion.VERSION_17    targetCompatibility JavaVersion.VERSION_17}

before that I was getting an error about using jvmTarget v21

 

Now the app build will complete.

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings