BILDIT-Platform / react-native-bildit-flybuy

React Native FlyBuy module. Supports Core, Pickup, Notify, and Presence Native SDK APIs.
9 stars 6 forks source link

Error compiling on Kotlin 1.8 #62

Closed keithyoder closed 1 year ago

keithyoder commented 1 year ago

ItsPleinAir has reported errors trying to build their app.

Is this an issue using more recent Kotlin verions?

image

keithyoder commented 1 year ago

Confirmed IPA is building with Kotlin 1.8.

addingama commented 1 year ago

Thanks for the info, the latest kotlin version has more strict checking.

@keithyoder can you provide the kotlin version that failing?

keithyoder commented 1 year ago

https://github.com/BILDIT-Platform/react-native-bildit-flybuy/blob/7b88e4c34247306dce8d61b82e52fe7b70ed7efe/android/src/main/java/com/reactnativeflybuy/Util.kt#L7-L23

fun handleFlyBuyError(sdkError: SdkError?) { 
   when (sdkError?.type) { 
     ResponseEventType.NO_CONNECTION -> { 
       Log.e("FlyBuy SDK Error", "No Connection") 
     } 
     ResponseEventType.FAILED -> { 
       when (sdkError.code) { 
         425 -> { 
           Log.e("FlyBuy SDK Error", "Upgrade your app!") 
         } 
         else -> { 
           Log.e("FlyBuy SDK Error", sdkError.userError()) 
         } 
       } 
     }
    else -> {
      // nothing to do.
    } 
   } 
 } 
keithyoder commented 1 year ago

https://github.com/BILDIT-Platform/react-native-bildit-flybuy/blob/7b88e4c34247306dce8d61b82e52fe7b70ed7efe/android/src/main/java/com/reactnativeflybuy/FlybuyModule.kt#L696

 map.putInt("siteID", order.site?.id!!) 

I think this is okay since any order has to have a site.

wilsolutions commented 1 year ago

I am planning to upgrade to RN 0.72 and and ended up running into Kotlin version issues as well.

> Task :react-native-bildit-flybuy:compileDebugKotlin FAILED
'compileDebugJavaWithJavac' task (current target is 11) and 'compileDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.

Please, do we have any idea when we may have a release bumping Kotlin?

Thanks

addingama commented 1 year ago

@wilsolutions do you set any kotlin version in your build.gradle file?

wilsolutions commented 1 year ago

@wilsolutions do you set any kotlin version in your build.gradle file?

I do: kotlinVersion = '1.6.20'

addingama commented 1 year ago

@wilsolutions can you try using version 2.1.5 and send kotlinVersion = '1.8.0'?

wilsolutions commented 1 year ago

@wilsolutions can you try using version 2.1.5 and send kotlinVersion = '1.8.0'?

I will need to revisit this later, I was exploring the possibility of migrating a RN 0.70 App to RN 0.72 when I've found this issue, it will take me a few weeks until I'm able to look at this again...

But I did bump my project to the 2.1.5 version with RN 0.70 and kotlin 1.6.0 and I have no issues.

addingama commented 1 year ago

I'll close this issue for now. I've tested the latest version with kotlin 1.8.0 and it's working.