background_locator_fixed icon indicating copy to clipboard operation
background_locator_fixed copied to clipboard

Build failed on Android. Flutter 3.0.5

Open VladlenRnd opened this issue 2 years ago • 10 comments

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

VladlenRnd avatar Aug 26 '22 22:08 VladlenRnd

Experiencing the same issue

ghost avatar Aug 31 '22 18:08 ghost

Same here! :(

lucianokapluk avatar Sep 01 '22 20:09 lucianokapluk

if someone has a fix I'll happily merge it

Yukams avatar Sep 07 '22 20:09 Yukams

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
                }
        }

EmreSURK avatar Sep 14 '22 11:09 EmreSURK

same T_T

SaowaluckT avatar Sep 16 '22 19:09 SaowaluckT

Is this bug still here with 2.0.6 ?

Yukams avatar Mar 08 '23 14:03 Yukams

yes I am facing same error with 2.0.6 in release mode

rajeshbdabhi avatar Mar 10 '23 09:03 rajeshbdabhi

in your build.gradle file set compileSdkVersion 31 to solve it

ram-wappnet avatar Mar 18 '23 14:03 ram-wappnet

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

wian-plus avatar Apr 17 '23 09:04 wian-plus

We can just compare 2.0.6-dev.1, as that includes the fix that is not in 2.0.6

wian-plus avatar Apr 17 '23 10:04 wian-plus