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

minSdkVersion 16 cannot be smaller than version 19 #183

Closed
KakarN opened this issue Apr 30, 2019 · 5 comments
Closed

minSdkVersion 16 cannot be smaller than version 19 #183

KakarN opened this issue Apr 30, 2019 · 5 comments

Comments

@KakarN
Copy link

KakarN commented Apr 30, 2019

I am would like to integrate Razorpay into my react-native app. I have installed the razorpay package and have also linked successfully.

However, when I try to run the app I am getting the following errors:

$ react-native run-android

info Starting JS server...
info Building and installing the app on the device (cd android && ./gradlew app:installDebug)...

> Configure project :react-native-razorpay
WARNING: The specified Android SDK Build Tools version (26.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:processDebugManifest FAILED
/Users/kakarnyori/react-native-projects/RazorpayTest/android/app/src/debug/AndroidManifest.xml Error:
        uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [com.razorpay:checkout:1.5.5] /Users/kakarnyori/.gradle/caches/transforms-1/files-1.1/checkout-1.5.5.aar/a23f27ddc59bc933dbac2f4019e7fbab/AndroidManifest.xml as the library might be using APIs not available in 16
        Suggestion: use a compatible library with a minSdk of at most 16,
                or increase this project's minSdk version to at least 19,
                or use tools:overrideLibrary="com.razorpay" to force usage (may lead to runtime failures)

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [com.razorpay:checkout:1.5.5] /Users/kakarnyori/.gradle/caches/transforms-1/files-1.1/checkout-1.5.5.aar/a23f27ddc59bc933dbac2f4019e7fbab/AndroidManifest.xml as the library might be using APIs not available in 16
        Suggestion: use a compatible library with a minSdk of at most 16,
                or increase this project's minSdk version to at least 19,
                or use tools:overrideLibrary="com.razorpay" to force usage (may lead to runtime failures)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
22 actionable tasks: 1 executed, 21 up-to-date
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details.

I have been using Expo to develop mobile apps, and I am very new to Android development. Could you please tell me how can I fix this?

@ratnadeep007
Copy link

ratnadeep007 commented May 1, 2019

@KakarN I faced same issue today while using Razorpay react-native package.
You're using expo and it's clearly mentioned in repo README that:
The react native plugin is wrapper around native SDK, so it doesn't work with the tools like expo which doesn't support native modules.
You can do expo eject and then following instructions:
open build.gradle file in android folder and change the value of minSdkVersion from 16 to 19.
Hope this resolves your issue. 😄
sdk-version-fix-razorpay

@KakarN
Copy link
Author

KakarN commented May 2, 2019

@ratnadeep007 That did it! Thanks.

@KakarN KakarN closed this as completed May 2, 2019
@SaravanakumarSubramanian
Copy link

SaravanakumarSubramanian commented Sep 24, 2019

I have the same issue changing the minSDKVersion to 19 did not solve the issue for me

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users//android/app/src/debug/AndroidManifest.xml Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:react-native-razorpay] /Users/
/node_modules/react-native-razorpay/android/build/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 19,
or use tools:overrideLibrary="com.razorpay.rn" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception

Razorpay gradle

apply plugin: 'com.android.library'
repositories {
    mavenCentral()
}
def safeExtGet(prop, fallback) {
    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
    compileSdkVersion safeExtGet('compileSdkVersion', 28)


    defaultConfig {
        minSdkVersion 19
        targetSdkVersion safeExtGet('targetSdkVersion', 28)
        versionCode 1
        versionName "1.0"
    }
}

dependencies {
    implementation 'com.facebook.react:react-native:+'
    implementation 'com.razorpay:checkout:1.5.12'
}

@realabbas
Copy link

Change your project level build.gradle file.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 19
        compileSdkVersion = 28
        targetSdkVersion = 28
    }

Change the minimum sdk version to 19

@pratham-stack
Copy link

Downgrade your version 'audioplayers: ^0.17.1' to 'audioplayers: ^0.16.1' in pubspec.yaml and pub get the dependencies of 'audioplayers: ^0.16.1'.

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

5 participants