background_locator_fixed
background_locator_fixed copied to clipboard
Build failed on Android. Flutter 3.0.5
e: C:\Users\User\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\background_locator_2-2.0.5\android\src\main\kotlin\yukams\app\background_locator_2\provider\LocationParserUtil.kt: (21, 20): Type mismatch: inferred type is String? but Any was expected
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':background_locator_2:compileDebugKotlin'.
> Compilation error. See log for more details
* 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 22s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Flutter doctor:
[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19044.1889], locale en)
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.4)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.70.2)
[√] Connected device (4 available)
[√] HTTP Host Availability
Experiencing the same issue
Same here! :(
if someone has a fix I'll happily merge it
I fixed this error but some other errors popped up: How I fixed this one:
fun getBinaryMessenger(context: Context?): BinaryMessenger {
val messenger : BinaryMessenger = backgroundEngine!!.dartExecutor!!.binaryMessenger!!
return messenger
?: if (context != null) {
backgroundEngine = FlutterEngine(context)
backgroundEngine!!.dartExecutor!!.binaryMessenger!!
}else{
messenger
}
}
same T_T
Is this bug still here with 2.0.6 ?
yes I am facing same error with 2.0.6 in release mode
in your build.gradle file set compileSdkVersion 31 to solve it
in your build.gradle file set compileSdkVersion 31 to solve it
This will possibly make many other packages incompatible. There needs to be a fix for this to allow for higher compile versions
We can just compare 2.0.6-dev.1, as that includes the fix that is not in 2.0.6