mkharibalaji / react-native-adyen-payment

React Native Adyen Payment
https://mkharibalaji.github.io/react-native-adyen-payment/
MIT License
35 stars 35 forks source link

Task react-native-adyen-payment:compileDebugKotlin fails on RN 0.65.1 #64

Closed calypsow777 closed 2 years ago

calypsow777 commented 2 years ago

I get this error when trying to compile my app after upgrading from RN 0.64.2 to RN 0.65.1:

Task :react-native-adyen-payment:compileDebugKotlin FAILED
e: /.../main/app/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/AdyenPaymentModule.kt: (240, 32): Type mismatch: inferred type is String? but String was expected
e: /.../main/app/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/AdyenPaymentModule.kt: (521, 23): Type mismatch: inferred type is String? but String was expected
e: /.../main/app/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/service/ComponentService.kt: (95, 33): Type mismatch: inferred type is PaymentComponentData<CapturedType(in PaymentMethodDetails)>? but PaymentComponentData<in PaymentMethodDetails> was expected
e: /.../main/app/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/ui/AdyenComponentActivity.kt: (107, 38): Type mismatch: inferred type is CallResult? but CallResult was expected
e: /.../main/app/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/ui/AdyenComponentActivity.kt: (169, 39): Type mismatch: inferred type is AdyenComponentConfiguration? but AdyenComponentConfiguration was expected
e: /.../main/app/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/ui/AdyenComponentActivity.kt: (169, 46): Type mismatch: inferred type is AdyenComponentConfiguration? but AdyenComponentConfiguration was expected
e: /.../main/app/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/ui/AdyenComponentActivity.kt: (173, 61): Type mismatch: inferred type is PaymentMethodsApiResponse? but PaymentMethodsApiResponse was expected
e: /.../main/app/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/ui/AdyenComponentActivity.kt: (173, 68): Type mismatch: inferred type is PaymentMethodsApiResponse? but PaymentMethodsApiResponse was expected
e: /.../main/app/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/ui/AdyenComponentActivity.kt: (197, 16): Type mismatch: inferred type is Intent? but Intent was expected

I tried several versions of Gradle and I also tried to put the following instruction in build.gradle, using the plugin kotlin-android:

kotlinOptions {
        freeCompilerArgs += [
            '-Xno-call-assertions',
            '-Xno-receiver-assertions',
            '-Xno-param-assertions'
        ]
    }
kashif-javaid commented 2 years ago

I am getting the same error even not on RN 63.4 and even with a fresh install .

kashif-javaid commented 2 years ago

Steps to reproduce

1 ) expo init adyenTest 2) minimal bare workflow 3) yarn add react-native-adyen-payment 4) yarn android

Following Error

Task :react-native-adyen-payment:compileDebugKotlin FAILED w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings 271 actionable tasks: 265 executed, 6 up-to-date Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: /Users/kashifjavaid/Desktop/AdyenTest/adyentest/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/kashifjavaid/Desktop/AdyenTest/adyentest/node_modules/expo-constants/android/src/main/java/expo/modules/constants/ConstantsService.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/kashifjavaid/Desktop/AdyenTest/adyentest/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/kashifjavaid/Desktop/AdyenTest/adyentest/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. e: /Users/kashifjavaid/Desktop/AdyenTest/adyentest/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/AdyenPaymentModule.kt: (240, 32): Type mismatch: inferred type is String? but String was expected e: /Users/kashifjavaid/Desktop/AdyenTest/adyentest/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/AdyenPaymentModule.kt: (521, 23): Type mismatch: inferred type is String? but String was expected e: /Users/kashifjavaid/Desktop/AdyenTest/adyentest/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/service/ComponentService.kt: (95, 33): Type mismatch: inferred type is PaymentComponentData? but PaymentComponentData was expected e: /Users/kashifjavaid/Desktop/AdyenTest/adyentest/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/ui/AdyenComponentActivity.kt: (107, 38): Type mismatch: inferred type is CallResult? but CallResult was expected e: /Users/kashifjavaid/Desktop/AdyenTest/adyentest/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/ui/AdyenComponentActivity.kt: (169, 46): Type inference failed. Expected type mismatch: inferred type is AdyenComponentConfiguration? but AdyenComponentConfiguration was expected e: /Users/kashifjavaid/Desktop/AdyenTest/adyentest/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/ui/AdyenComponentActivity.kt: (173, 68): Type inference failed. Expected type mismatch: inferred type is PaymentMethodsApiResponse? but PaymentMethodsApiResponse was expected e: /Users/kashifjavaid/Desktop/AdyenTest/adyentest/node_modules/react-native-adyen-payment/android/src/main/java/com/rnlib/adyen/ui/AdyenComponentActivity.kt: (198, 20): Type inference failed. Expected type mismatch: inferred type is Intent? but Intent was expected

FAILURE: Build failed with an exception.

Package.json

{ "main": "index.js", "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "web": "expo start --web", "start": "react-native start" }, "dependencies": { "expo": "~42.0.1", "expo-splash-screen": "~0.11.2", "expo-status-bar": "~1.0.4", "expo-updates": "~0.8.1", "react": "16.13.1", "react-dom": "16.13.1", "react-native": "~0.63.4", "react-native-adyen-payment": "^1.8.3", "react-native-gesture-handler": "~1.10.2", "react-native-reanimated": "~2.2.0", "react-native-screens": "~3.4.0", "react-native-unimodules": "~0.14.5", "react-native-web": "~0.13.12" }, "devDependencies": { "@babel/core": "^7.9.0" }, "private": true }

kashif-javaid commented 2 years ago

I have tried opening the android project of this repo in android studio 4.1 and there are alot of errors when trying to compile android module ,

Screenshot 2021-09-17 at 15 05 24
ChielBruin commented 2 years ago

Can you try with an older version of this dependency? I am personally still running on a fork of 1.6.1 that should be equal to 1.7.0 of the main repository (https://github.com/flyingfishtech/react-native-adyen-payment @master to be precise). That version does fully work. Maybe one of the changes in 1.8.x broke something

kashif-javaid commented 2 years ago

@ChielBruin Yeah Thanks , It works for api 29 and but get the same errors as you if if update it to sdk target 30.

kashif-javaid commented 2 years ago

@mkharibalaji I am trying to run the android project inside src folder so i could fix the issues on android , but i am getting the following errors in android studio . Just made no sense . I am using android studio 4.1 . I tried to contact you help me get running so i could contribute and fix some of these issues . shall wait for your reply . I am kinda a stuck atm.

Screenshot 2021-09-20 at 13 15 39

n

akhilsanker commented 2 years ago

Hi, same issue here with: React native : 0.64.0 react-native-adyen-payment": 1.8.3

getting Task :react-native-adyen-payment:compileDebugKotlin FAILED in Android. Not able to run the project.

Thanks

mickadoua commented 2 years ago

i had this issue, i dont remember exactly what I did to resolve.

but here is my build.gradle file

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "21.3.6528147"
    }

be sure you have this version of NDK installed