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

Build with android studio fails #2408

Open
mock1328 opened this issue Sep 20, 2024 · 3 comments
Open

Build with android studio fails #2408

mock1328 opened this issue Sep 20, 2024 · 3 comments

Comments

@mock1328
Copy link

mock1328 commented Sep 20, 2024

When building a flutter app with this library as dependency in android studio, it gives an error in a build log:

Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [androidx.window:window:1.2.0] C:\Users\mock\.gradle\caches\8.10.1\transforms\b41269f68018ee3a6cde265ae09ac74f\transformed\jetified-window-1.2.0\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="androidx.window" to force usage (may lead to runtime failures)

Can we bump the minSdk in build.gradle to 19?

Also, building with latest openjdk versions (e.g. 22 or 23, not sure about 21) results in some warnings:

warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings

Java compiler has deprecated support for compiling with source/target compatibility version 8.

But these at least not critical and don't break the build, I suppose

@MaikuB
Copy link
Owner

MaikuB commented Oct 13, 2024

Can we bump the minSdk in build.gradle to 19?

Could you provide a link to a repo hosting a minimal app that can reproduce the issue? Note that from I could from what you shared, it looks like the issue is related to androidx.window rather than being to do with this plugin

Also, building with latest openjdk versions (e.g. 22 or 23, not sure about 21) results in some warnings:

Aware of these but this will be a common issue as the Flutter SDK itself creates apps that set the source and target compatibility to 8. When it comes to this plugin, the warning may be that for a while as this setting is needed to support desugaring. To get rid of that would require bumping the min SDK much higher, which in turn restrict the number of supported devices

@mock1328
Copy link
Author

mock1328 commented Oct 22, 2024

Aware of these but this will be a common issue as the Flutter SDK itself creates apps that set the source and target compatibility to 8. When it comes to this plugin, the warning may be that for a while as this setting is needed to support desugaring. To get rid of that would require bumping the min SDK much higher, which in turn restrict the number of supported devices

Thanks for the explanation. Forgive me for the lack of knowledge, but shouldn't desugaring with JDK11 should work fine since version 1.2.0? Judging by the changelog, newer version doesn't require usage of a newer min SDK?
I don't thing AGP version is a problem either -- right now the project uses AGP 7.3.1, and it requires use of JDK11 or higher, so I doubt the current version even works in real world with JDK8 compatible (as max supported version) SDKs

@MaikuB
Copy link
Owner

MaikuB commented Oct 22, 2024

@mock1328 you seem to be talking about something else that and this can get in the way of the issue you originally raised. I would advise to go back to provide a repo hosting a minimal app that can reproduce the issue you tried to report. Reason for asking for this is what you've shared so far doesn't point to this plugin being the issue and have yet to see anything that suggests bumping min SDK for the plugin solves the problem

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