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

Unresolved reference: FLAG_MUTABLE #39

Closed
77251380 opened this issue Jun 26, 2022 · 10 comments · Fixed by #40
Closed

Unresolved reference: FLAG_MUTABLE #39

77251380 opened this issue Jun 26, 2022 · 10 comments · Fixed by #40

Comments

@77251380
Copy link

77251380 commented Jun 26, 2022

I update from 0.3.0 to 0.4.0 ,there is a issue when building
Unresolved reference: S
Unresolved reference: FLAG_MUTABLE

@Sunbreak
Copy link
Collaborator

Could you post flutter doctor -v?

@77251380
Copy link
Author

77251380 commented Jun 27, 2022

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[√] Flutter (Channel stable, 2.10.4, on Microsoft Windows [Version 10.0.22000.739], locale zh-CN)
    • Flutter version 2.10.4 at D:\work\flutter2_10_4\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c860cba910 (3 months ago), 2022-03-25 00:23:12 -0500
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\mrz\AppData\Local\Android\sdk
    • Platform android-32, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.5)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.9.31229.75
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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.12+7-b1504.28-7817840)

[√] Connected device (4 available)
    • VTR AL00 (mobile) • BNU0217316003151 • android-arm64  • Android 9 (API 28)
    • Windows (desktop) • windows          • windows-x64    • Microsoft Windows [Version 10.0.22000.739]
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 101.0.4951.67
    • Edge (web)        • edge             • web-javascript • Microsoft Edge 103.0.1264.37

[!] HTTP Host Availability
    X HTTP host https://maven.google.com/ is not reachable. Reason: An error occurred while checking the HTTP host: 信号灯超时时间已到

@Sunbreak
Copy link
Collaborator

77251380 是 QQ号么,我加您了

@mil-ast
Copy link

mil-ast commented Jun 27, 2022

quick_usb-0.4.0/android/src/main/kotlin/com/example/quick_usb/QuickUsbPlugin.kt: (20, 52): Unresolved reference: S
quick_usb-0.4.0/android/src/main/kotlin/com/example/quick_usb/QuickUsbPlugin.kt: (21, 19): Unresolved reference: FLAG_MUTABLE

@AlphaBlend1975
Copy link

Same error here when build --release
not affected om debug on windows and android

@Sunbreak
Copy link
Collaborator

You should update the compileSdkVersion inside your app module youself

#40 is an example: compileSdkVersion Math.max(flutter.compileSdkVersion, 31)

@mpekurin
Copy link

@Sunbreak the issue is related to Gradle version, it should be not higher than 4.1.x in a project (com.android.tools.build:gradle:4.1.3 in android\build.gradle). Just FYI.

@Sunbreak
Copy link
Collaborator

It doesn't make sense. Any doc about the issue?

@mpekurin
Copy link

It doesn't make sense. Any doc about the issue?

I haven't found anything 🤷‍♂️

@vorte
Copy link

vorte commented Oct 7, 2022

I was also seeing the same error as above. I tried setting the compileSdkVersion and also the build.gradle version but gradle 4.1.x doesn't support Java 17 so the only way I could get this to work was to:

  1. Downgrade to java 11
  2. Set build.gradle to 4.1.3 and gradle-wrapper.properties to 6.7

The compileSdkVersion didn't seem to do anything for me. For reference I'm running flutter 3.3.4 on Windows 11.

Can we look into supporting newer gradle versions and also jdk 17?

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

Successfully merging a pull request may close this issue.

6 participants