sabashChinTam / ct-react-native-datatrans

React native with datatan integration.
MIT License
0 stars 2 forks source link

Datatrans/Datatrans.h file not found #2

Open lucky-amplyn opened 2 years ago

lucky-amplyn commented 2 years ago

getting this issue while building the project

sohan1154 commented 2 years ago

same issue for me as well

sohan1154 commented 2 years ago

any one solved this issue?

sabashChinTam commented 2 years ago

Add Datatrans iOS SDK to your project.

sohan1154 commented 2 years ago

@sabashChinTam thanks for your reply can you please share how can we add Datatrans iOS SDK in project

sohan1154 commented 2 years ago

I have added that line in Podfile and then run the pod install pod 'Datatrans', :modular_headers => true also tried with fresh project but still the same issue is generated

richiehug commented 2 years ago

Hey! Can you please confirm you are using the latest version of the SDK when building your project?

sohan1154 commented 2 years ago

Hi @richiehug

yes I am using latest version of all thinks

"react": "17.0.2" "react-native": "0.68.1" "ct-react-native-datatrans": "^1.5.1" ch.datatrans:android-sdk:2.0.2 // for android pod 'Datatrans' // for ios

richiehug commented 2 years ago

@sohan1154 - we don't officially support React native, but the details below may help.

Activating the s.dependency Datatrans in ct-react-native-datatrans.podspec fixes the issue Datatrans/Datatrans.h file not found.

There were more issues we identified (using Xcode 13.4):

Unfortunately, we won't be able to offer more support for React native. Hope the above helps.

sohan1154 commented 2 years ago

thanks @richiehug let me try it with iOS as well as Android thanks for your support

sohan1154 commented 2 years ago

@richiehug can you please tell me what i need to change to avoid that error as I have tried multiple ways to fix it

--------1st CASE-------- **One or more issues found when checking AAR metadata values: The minCompileSdk (31) specified in a dependency’s AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module’s compileSdkVersion (android-30). Dependency: androidx.appcompat:appcompat:1.4.2. AAR metadata file: /Users/username/.gradle/caches/transforms-3/41685eb2747b9509af4f2790a37adade/transformed/appcompat-1.4.2/META-INF/com/android/build/gradle/aar-metadata.properties.

The minCompileSdk (32) specified in a dependency’s AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module’s compileSdkVersion (android-30). Dependency: androidx.compose.material:material:1.2.0-rc02. AAR metadata file: /Users/username/.gradle/caches/transforms-3/a7cb59c1a98eb36a1de6ca61d29a4629/transformed/jetified-material-1.2.0-rc02/META-INF/com/android/build/gradle/aar-metadata.properties.**

I have tried by changing values but didn't fix the error. ` buildToolsVersion = '33.0.0' minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33 googlePlayServicesAuthVersion = "19.2.0"

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
        ...
    }

    maven {
        // Datatrans SDK
        url("https://datatrans.jfrog.io/artifactory/mobile-sdk/")
    }

`

-------2nd CASE---------- when I am trying it with Android-12 then below error comes:

Manifest merger failed : android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

android:exported="true" this is already changed as true

I have also tried with API level 30, 31

sohan1154 commented 2 years ago

Android only I have passed these issues but now this error comes when clicking the payment button can you please suggest me what am i doing wrong for same

Error message is WARN Possible Unhandled Promise Rejection (id: 1): Error: Attempt to invoke interface method 'int com.facebook.react.bridge.ReadableArray.size()' on a null object reference promiseMethodWrapper@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:5511:45 _callee$@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:173123:92 tryCatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:24827:23 http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:24807:34 tryCatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:24827:23 invoke@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:24865:30 http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:24889:19 tryCallTwo@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:29284:9 doResolve@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:29448:25 Promise@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:29307:14 callInvokeWithMethodAndArg@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:24888:33 http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:24893:157 http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:24979:69 _callee@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:173113:40 onPress@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:173150:27 _performTransitionSideEffects@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:65178:22 _receiveSignal@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:65120:45 onResponderRelease@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:65016:34 invokeGuardedCallbackProd@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:6846:21 invokeGuardedCallback@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:6950:42 invokeGuardedCallbackAndCatchFirstError@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:6954:36 executeDispatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:7032:48 executeDispatchesInOrder@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:7052:26 executeDispatchesAndRelease@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:8312:35 forEach@[native code] forEachAccumulated@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:7583:22 runEventsInBatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:8336:27 runExtractedPluginEventsInBatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:8416:25 http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:8391:42 batchedUpdates$1@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:20453:20 batchedUpdates@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:8298:36 _receiveRootNodeIDEvent@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:8390:23 receiveTouches@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:8444:34 callFunction@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:5995:36 http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:5719:31 guard@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:5946:15 callFunctionReturnFlushedQueue@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.mapl.customer&modulesOnly=false&runModule=true:5718:21 callFunctionReturnFlushedQueue@[native code]

sabashChinTam commented 1 year ago

Sorry for the delay response,

In ios we should manually include the package from datatrans github url and link to our pod.

sohan1154 commented 1 year ago

pod 'Datatrans', :modular_headers => true

added that line in Podfile and then run npx pod-install command

after then it's start working

sohan1154 commented 1 year ago

Hey @sabashChinTam

Getting this issue in Android

Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :ct-react-native-datatrans project caused this error: /Users/sohan/lab/mapl/mapl-app/node_modules/ct-react-native-datatrans/android/libs/android-sdk-1.5.1.aar