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

Cannot run Android app after install library #265

Open
yuraBrimit opened this issue Aug 13, 2024 · 5 comments
Open

Cannot run Android app after install library #265

yuraBrimit opened this issue Aug 13, 2024 · 5 comments

Comments

@yuraBrimit
Copy link

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.

  • Where:
    Build file '**/node_modules/react-native-klarna-inapp-sdk/android/build.gradle' line: 25

  • What went wrong:
    A problem occurred evaluating project ':react-native-klarna-inapp-sdk'.

Plugin with id 'kotlin-android' not found.

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
Copy link
Author

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
Copy link
Member

NMGuner commented Aug 22, 2024

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
Copy link
Author

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.

  • What went wrong:
    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
Copy link
Member

NMGuner commented Aug 26, 2024

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
Copy link
Author

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/'
        }
    }
}

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