Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Build #1

Open
tomelsner opened this issue Jun 11, 2024 · 2 comments
Open

Android Build #1

tomelsner opened this issue Jun 11, 2024 · 2 comments

Comments

@tomelsner
Copy link

I'm using Expo 51 and am trying to do an android build. It fails with the following error:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':premieroctet-react-native-wallet:compileDebugKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (17) and 'compileDebugKotlin' (11).

Any idea how I can address this?

@andresmartinezstay
Copy link

@tomelsner Use this patch to change the java version to 17, it compiles fine:

diff --git a/node_modules/@premieroctet/react-native-wallet/android/build.gradle b/node_modules/@premieroctet/react-native-wallet/android/build.gradle
index 8577ad4..43226e0 100644
--- a/node_modules/@premieroctet/react-native-wallet/android/build.gradle
+++ b/node_modules/@premieroctet/react-native-wallet/android/build.gradle
@@ -54,12 +54,12 @@ android {
   compileSdkVersion safeExtGet("compileSdkVersion", 33)
 
   compileOptions {
-    sourceCompatibility JavaVersion.VERSION_11
-    targetCompatibility JavaVersion.VERSION_11
+    sourceCompatibility JavaVersion.VERSION_17
+    targetCompatibility JavaVersion.VERSION_17
   }
 
   kotlinOptions {
-    jvmTarget = JavaVersion.VERSION_11.majorVersion
+    jvmTarget = JavaVersion.VERSION_17.majorVersion
   }
 
   namespace "com.premieroctet.wallet"

@andresmartinezstay
Copy link

Also there is a bug in the implementation when adding a pass:

diff --git a/node_modules/@premieroctet/react-native-wallet/android/src/main/java/com/premieroctet/wallet/RNWalletModule.kt b/node_modules/@premieroctet/react-native-wallet/android/src/main/java/com/premieroctet/wallet/RNWalletModule.kt
index d6e8c3f..e293fb4 100644
--- a/node_modules/@premieroctet/react-native-wallet/android/src/main/java/com/premieroctet/wallet/RNWalletModule.kt
+++ b/node_modules/@premieroctet/react-native-wallet/android/src/main/java/com/premieroctet/wallet/RNWalletModule.kt
@@ -46,7 +46,7 @@ class RNWalletModule : Module() {
         promise.reject(CodedException("Current activity not found"))
         return@AsyncFunction
       }
-      walletClient.savePasses(jwt, appContext.currentActivity!!, addToGoogleWalletRequestCode)
+      walletClient.savePassesJwt(jwt, appContext.currentActivity!!, addToGoogleWalletRequestCode)
       addPassPromise = promise
     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants