qrserv
qrserv copied to clipboard
Dependency hold-backs
Unfortunately, it looks like there's issues as of the more recent Flutter releases regarding a couple dependencies that as a result are preventing the build process out-of-box.
flutter_statusbarcolor_ns 0.6.0 receive_sharing_intent 1.8.1
The error would generally be:
Execution failed for task ':package:compileReleaseKotlin'.
> Error while evaluating property 'compilerOptions.jvmTarget' of task ':package:compileReleaseKotlin'.
> Failed to calculate the value of property 'jvmTarget'.
> Unknown Kotlin JVM target: 21
The fixes would be the following for the respective dependencies build.gradle files...
flutter_statusbarcolor_ns
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
receive_sharing_intent
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
After doing that, there was also another error that I hadn't came across before:
C:\path\to\project\qrserv\android\app\src\main\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 21 cannot be smaller than version 24 declared in library [:flutter_statusbarcolor_ns] C:\path\to\project\qrserv\build\flutter_statusbarcolor_ns\intermediates\merged_manifest\release\processReleaseManifest\AndroidManifest.xml as the library might be using APIs not available in 21
Suggestion: use a compatible library with a minSdk of at most 21,
or increase this project's minSdk version to at least 24,
or use tools:overrideLibrary="com.sameer.flutterstatusbarcolor.flutterstatusbarcolor" to force usage (may lead to runtime failures)
Turns out, as of flutter_statusbarcolor_ns 0.6.0, minSdkVersion was increased from 16 (Android 4.1) to 24 (Android 7.0).
As of 2.6.0 of this application, minSdkVersion is 21 (Android 5.0).
After making the adjustments to the dependencies locally, to the main application itself, and decreasing the minimum SDK version, it successfully got built and functioned as usual.
For flutter_statusbarcolor_ns: I created a pull request with the fix.
As for receive_sharing_intent: a user already created a pull request for it several weeks back.
Generally, it looks like it might take a while before all the needed changes are put into place.
Beyond that, there is the minimum SDK version change with flutter_statusbarcolor_ns. I had changed this to 21 (Android 5.0) in the local copy as to match the application. This builds and functions just fine.
I don't really wish to unnecessarily increase the minimum SDK version. As is, even with the aforementioned changes made, the build will still fail by default and so the minimum SDK version for the dependency in pub cache will need to be manually decreased. Of course, I could just point it towards fork(s) with the fixes in pubspec.yaml.. but maybe I'll do that in the future if there isn't a complete resolution soon.
For now, I had requested for this to be lowered.