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 report] Can't build Android using 3.0.0-dev.5; Unresolved reference: PermissionsUtils #1060

Closed
tomekit opened this issue Dec 16, 2023 · 2 comments

Comments

@tomekit
Copy link

tomekit commented Dec 16, 2023

Version

3.0.0-dev.5

Platforms

Android

Device Model

Pixel 6 API 34 emulator

flutter info

[✓] Flutter (Channel stable, 3.16.4, on Ubuntu 23.04 6.2.0-39-generic, locale en_US.UTF-8)
    • Flutter version 3.16.4 on channel stable at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2e9cb0aa71 (5 days ago), 2023-12-11 14:35:13 -0700
    • Engine revision 54a7145303
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /home/tomek/Android/Sdk
    • Platform android-34, build-tools 33.0.1
    • ANDROID_HOME = /home/tomek/Android/Sdk
    • Java binary at: /opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 15.0.7
    • cmake version 3.25.1
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[✓] Android Studio (version 2023.1)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 76.3.3
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.78.2)
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
    • Linux (desktop)              • linux         • linux-x64      • Ubuntu 23.04 6.2.0-39-generic
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 114.0.5735.198

[✓] Network resources
    • All expected network resources are available.

• No issues found!

How to reproduce?

Include: photo_manager: 3.0.0-dev.5 in pubspec.yaml and build the Android app

Logs

Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/core/PhotoManagerPlugin.kt:17:52 Unresolved reference: PermissionsUtils
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/core/PhotoManagerPlugin.kt:31:35 Unresolved reference: PermissionsUtils
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/core/PhotoManagerPlugin.kt:49:26 Variable expected
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:9:57 Unresolved reference: PermissionDelegate19
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:10:57 Unresolved reference: PermissionDelegate23
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:11:57 Unresolved reference: PermissionDelegate29
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:12:57 Unresolved reference: PermissionDelegate30
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:13:57 Unresolved reference: PermissionDelegate33
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:28:27 Unresolved reference: PermissionsUtils
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:106:27 Unresolved reference: PermissionsUtils
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:131:34 Unresolved reference: PermissionDelegate19
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:132:35 Unresolved reference: PermissionDelegate23
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:133:23 Unresolved reference: PermissionDelegate29
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:134:35 Unresolved reference: PermissionDelegate30
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:135:23 Unresolved reference: PermissionDelegate33
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:149:27 Unresolved reference: PermissionsUtils
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/PermissionDelegate.kt:165:27 Unresolved reference: PermissionsUtils
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/impl/PermissionDelegate34.kt:10:52 Unresolved reference: PermissionsUtils
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/impl/PermissionDelegate34.kt:30:27 Unresolved reference: PermissionsUtils
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/impl/PermissionDelegate34.kt:112:27 Unresolved reference: PermissionsUtils
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/impl/PermissionDelegate34.kt:157:22 Unresolved reference: onGranted
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/impl/PermissionDelegate34.kt:159:22 Unresolved reference: onDenied
e: file:///home/tom/.pub-cache/hosted/pub.dev/photo_manager-3.0.0-dev.5/android/src/main/kotlin/com/fluttercandies/photo_manager/permission/impl/PermissionDelegate34.kt:168:27 Unresolved reference: PermissionsUtils

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':photo_manager:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

Example code (optional)

No response

Contact

No response

@AlexV525
Copy link
Member

If the example builds normally, it is likely your sdk version is incorrect.

@tomekit
Copy link
Author

tomekit commented Dec 16, 2023

Thanks for the hint.
For anyone having the same issue, I've had to update my project's Kotlin version to: ext.kotlin_version = '1.9.20' that's in android/build.gradle, previously I was using: ext.kotlin_version = '1.8.22' which apparently is too old.

@tomekit tomekit closed this as completed Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants