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

[BUG] Example cannot compile with Flutter 3 on Android #1234

Closed
3 of 11 tasks
hschendel opened this issue May 12, 2022 · 8 comments · Fixed by #1236
Closed
3 of 11 tasks

[BUG] Example cannot compile with Flutter 3 on Android #1234

hschendel opened this issue May 12, 2022 · 8 comments · Fixed by #1236
Labels
bug This issue reports broken functionality or another error

Comments

@hschendel
Copy link
Contributor

Describe The Bug
The example does not build for Android

Expected Behavior
The example should build for Android

Screenshots & Recordings

$ flutter pub cache clean && flutter pub get && flutter run
This will remove everything inside /Users/user/.pub-cache.
You will have to run `flutter pub get` again in each project.
Are you sure? (y/N)? y
Removing pub cache directory /Users/user/.pub-cache.
Running "flutter pub get" in flutter_tools...                       9.1s
Running "flutter pub get" in example...                             4.3s
Launching lib/main.dart on SM G970F in debug mode...
e: /Users/user/.pub-cache/hosted/pub.dartlang.org/location-4.3.0/android/src/main/java/com/lyokone/location/FlutterLocationService.kt: (124, 1): Class 'FlutterLocationService' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: /Users/user/.pub-cache/hosted/pub.dartlang.org/location-4.3.0/android/src/main/java/com/lyokone/location/FlutterLocationService.kt: (258, 5): 'onRequestPermissionsResult' overrides nothing

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':location:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > 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 9s
Running Gradle task 'assembleDebug'...                              9.9s
Exception: Gradle task assembleDebug failed with exit code 1

Additional Information
Building for web works fine.

The whole thing was triggered by my upgrade to Flutter 3.0.0.

The root cause appears to be in flutterlocation, see Lyokone/flutterlocation#698 and Lyokone/flutterlocation#718, these issues also discuss workarounds.

This has to be fixed in flutterlocation, I wrote this ticket to avoid unnecessary research effort here ;-)

Changing the compileSdkVersion to 30 does not help.


Doctors Report

[✓] Flutter (Channel stable, 3.0.0, on macOS 12.3.1 21E258 darwin-arm, locale en-DE)
    • Flutter version 3.0.0 at /Users/hagen/bin/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee4e09cce0 (3 days ago), 2022-05-09 16:45:18 -0700
    • Engine revision d1b9a6938a
    • Dart version 2.17.0
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/hagen/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] Connected device (4 available)
    • SM G970F (mobile) • XYZ                                          • android-arm64  • Android 12 (API 31)
    • macOS (desktop)   • macos                                         • darwin-arm64   • macOS 12.3.1 21E258 darwin-arm
    • Chrome (web)      • chrome                                        • web-javascript • Google Chrome 101.0.4951.64

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

To Reproduce
Steps to reproduce the behavior:

flutter pub cache clean && flutter pub get && flutter run


Severity
This will help us to label the issue quicker and decide what needs attention first. Only choose fatal if the entire app crashes, otherwise choose non-fatal.

  • Non-Fatal
  • Fatal / App Crashes

Frequency/Rarity
This will help us to label the issue quicker and decide what needs attention first.

  • Once
  • Uncommon
  • Common
  • Always

Applicable Platforms
Only select those that you've tested on - one or more. If possible, test on a variety of platforms.

  • Android
  • iOS
  • Web
  • Windows
  • Others (beta platforms)
@hschendel hschendel added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels May 12, 2022
@JaffaKetchup
Copy link
Member

Hi there, and thanks for the heads up. As you said, there's not much we can do about this, but we'll make sure to get ready for Flutter 3 otherwise ASAP.

@JaffaKetchup JaffaKetchup added blocked This issue's resolution can't be worked on right now fatal and removed needs triage This new bug report needs reproducing and prioritizing labels May 12, 2022
@cristhianveal
Copy link

I'm the same since I updated flutter 3. but it's normal, hopefully it will be solved soon.

@noahvelasco
Copy link

To solve this issue temporarily please check out this other github link- its a small change on a file within the flutter folder on your machine.

@JaffaKetchup
Copy link
Member

Good workaround, but always be cautious when editing cached package files!

@JaffaKetchup JaffaKetchup changed the title [BUG] Example does not compile for Android due to Flutter 3 and flutterlocation [BUG] Example cannot compile with Flutter 3 May 13, 2022
@JaffaKetchup JaffaKetchup changed the title [BUG] Example cannot compile with Flutter 3 [BUG] Example cannot compile with Flutter 3 on Android May 13, 2022
@Zverik
Copy link
Contributor

Zverik commented May 13, 2022

flutterlocation was updated a few minutes ago, so this issue might be obsolete.

@JaffaKetchup
Copy link
Member

Thanks @Zverik, will have a look in a minute.

@JaffaKetchup JaffaKetchup removed the blocked This issue's resolution can't be worked on right now label May 13, 2022
@JaffaKetchup
Copy link
Member

#1236 contains the necessary fixes to get this fully project fully ready for Flutter 3

@hschendel
Copy link
Contributor Author

Thank you @JaffaKetchup !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants