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 21 declared in library [:square_in_app_payments] #78

Closed
tonydiaz opened this issue Nov 25, 2019 · 3 comments
Labels
question Further information is requested

Comments

@tonydiaz
Copy link

Describe your question

Using square_in_app_payments: ^1.2.3 in my app I see this error. I notice that when creating a new flutter app the minSdkVersion is set to 16.

Error

<app_name>/android/app/src/debug/AndroidManifest.xml Error:
	uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:square_in_app_payments] <app_name>/build/square_in_app_payments/intermediates/merged_manifests/debug/processDebugManifest/merged/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 21,
		or use tools:overrideLibrary="sqip.flutter" to force usage (may lead to runtime failures)

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 21 declared in library [:square_in_app_payments] <app_name>/build/square_in_app_payments/intermediates/merged_manifests/debug/processDebugManifest/merged/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 21,
  		or use tools:overrideLibrary="sqip.flutter" 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 3s
Finished with error: Gradle task assembleDebug failed with exit code 1

After updating build.gradle to use minSdkVersion 21

I did update the build.gradle file use version 21 then I saw new errors 😞

D8: Program type already present: android.support.v4.os.ResultReceiver$1

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
<app_name>/build/app/intermediates/transforms/dexBuilder/debug/0.jar
<app_name>/build/app/intermediates/transforms/dexBuilder/debug/1.jar
<app_name>/build/app/intermediates/transforms/dexBuilder/debug/2.jar
<app_name>/build/app/intermediates/transforms/dexBuilder/debug/3.jar
<app_name>/build/app/intermediates/transforms/dexBuilder/debug/4.jar
<app_name>/build/app/intermediates/transforms/dexBuilder/debug/5.jar
<app_name>/build/app/intermediates/transforms/dexBuilder/debug/6.jar
<app_name>/build/app/intermediates/transforms/dexBuilder/debug/7.jar
...

  Program type already present: android.support.v4.os.ResultReceiver$1
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

* 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 10s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
*******************************************************************************************
Finished with error: Gradle task assembleDebug failed with exit code 1

@tonydiaz tonydiaz added the question Further information is requested label Nov 25, 2019
@tonydiaz
Copy link
Author

tonydiaz commented Dec 5, 2019

@StephenJosey 👋

@okenshields
Copy link
Contributor

Hi Tony, the new error might be AndroidX related. Can you try this? https://flutter.dev/docs/development/androidx-migration

@tonydiaz
Copy link
Author

@okenshields Thanks! It corrected my problem. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants