Skip to content

"Unable to resolve dependency" errors when opening Example of new Flutter Plugin project #22614

@admarwick

Description

@admarwick

I'm seeing errors when opening the Android module of a fresh Flutter Plugin project's example project. Sample error:
Unable to resolve dependency for ':app@dynamicProfile/compileClasspath': Could not resolve project :<project>

To reproduce, create a new Flutter Plugin project with Kotlin support using the 'New Flutter Project' wizard in Android Studio. To resolve warnings, change the kotlin version from 1.2.30 to 1.2.61 (this version ships with the IDE) in project/Android/build.gradle and project/Example/Android /build.gradle. Also resolve warnings by changing the gradle version to 3.2.0 in both build.gradle files, and if prompted change example/android/gradle.wrapper/gradle-wrapper.properties to reference gradle-4.6.

After these adjustments suggested by the IDE, check that the example project builds and runs in the emulator from the plugin project, which it does.

Next, select the example/android folder in the IDE and from the context menu select Flutter>Open Android module from Android Studio. The project opens but build terminates with the subject errors.

Flutter doctor:

[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-US)
   • Flutter version 0.8.2 at /Users/alan/Documents/util/flutter
   • Framework revision 5ab9e70727 (4 weeks ago), 2018-09-07 12:33:05 -0700
   • Engine revision 58a1894a1c
   • Dart version 2.1.0-dev.3.1.flutter-760a9690c2

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
   • Android SDK at /Users/alan/Library/Android/sdk
   • Android NDK location not configured (optional; useful for native profiling support)
   • Platform android-28, build-tools 28.0.3
   • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
   • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
   • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
   • Xcode at /Applications/Xcode.app/Contents/Developer
   • Xcode 10.0, Build version 10A255
   • ios-deploy 2.0.0
   • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
   • Android Studio at /Applications/Android Studio.app/Contents
   • Flutter plugin version 29.0.2
   • Dart plugin version 181.5616
   • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] Connected devices (1 available)
   • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consolet: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions