klarna / react-native-klarna-inapp-sdk

Klarna's React Native wrapper for the In-App SDK
Apache License 2.0
22 stars 25 forks source link

Cannot run Android app after install library #265

Open yuraBrimit opened 1 month ago

yuraBrimit commented 1 month ago

Just use npm install react-native-klarna-inapp-sdk --save with autolink or manual installation

Then get following error

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

Android/build.gradle

buildscript { ext { googlePlayServicesVersion = "+" // default: "+" firebaseMessagingVersion = "21.1.0" // default: "21.1.0"

    buildToolsVersion = "33.0.0"
    minSdkVersion = 21
    compileSdkVersion = 33
    targetSdkVersion = 34

    // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
    ndkVersion = "23.1.7779620"
}
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath("com.android.tools.build:gradle")
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath("com.google.gms:google-services:4.3.15")
}

}

yuraBrimit commented 3 weeks ago

UPD: Issue still not solved :(

UPD2: after installing kotlin in android/build.gradle I have got the following error:

Could not determine the dependencies of task ':react-native-klarna-inapp-sdk:compileDebugAidl'.

Could not resolve all task dependencies for configuration ':react-native-klarna-inapp-sdk:debugCompileClasspath'. Could not find com.klarna.mobile:sdk:2.6.19. Required by: project :react-native-klarna-inapp-sdk

NMGuner commented 3 weeks ago

Hi @yuraBrimit, we just released a version addressing issues for apps not using Kotlin. Can you try version 2.3.7 and let us know please

yuraBrimit commented 3 weeks ago

Hi @yuraBrimit, we just released a version addressing issues for apps not using Kotlin. Can you try version 2.3.7 and let us know please

Unfortunately, still have issue with compileDebugAidl :(. But yes, kotlin error was solved.

Error: Command failed: ./gradlew app:installDevelopDebug -PreactNativeDevServerPort=8081 -PreactNativeDebugArchitectures=arm64-v8a -PreactNativeArchitectures=arm64-v8a

FAILURE: Build failed with an exception.

NMGuner commented 2 weeks ago

Can you make sure the additional lines for maven repository configuration are added to your android build.gradle as documented here.

allprojects {
    repositories {
        // Klarna Mobile SDK CDN Repository
        maven {
            url 'https://x.klarnacdn.net/mobile-sdk/'
        }
    }
}
yuraBrimit commented 2 weeks ago

Can you make sure the additional lines for maven repository configuration are added to your android build.gradle as documented here.

allprojects {
    repositories {
        // Klarna Mobile SDK CDN Repository
        maven {
            url 'https://x.klarnacdn.net/mobile-sdk/'
        }
    }
}

yes. I've add this lines, but still the same error result (compileDebugAidl)

my build.gradle file

buildscript {
    ext {
        googlePlayServicesVersion = "+" // default: "+"
        firebaseMessagingVersion = "21.1.0" // default: "21.1.0"

        buildToolsVersion = "33.0.0"
        minSdkVersion = 21
        compileSdkVersion = 33
        targetSdkVersion = 34

        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
        ndkVersion = "23.1.7779620"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("com.google.gms:google-services:4.3.15")
    }
}

allprojects {
    repositories {
        // Klarna Mobile SDK CDN Repository
        maven {
            url 'https://x.klarnacdn.net/mobile-sdk/'
        }
    }
}