icemanbsi / searchable_dropdown

MIT License
107 stars 161 forks source link

Error After update ver to 1.1.2 #27

Open gian-almada opened 4 years ago

gian-almada commented 4 years ago

after updating ver to 1.1.2, i can't run the app, because this error :

e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath: class io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding, unresolved supertypes: androidx.lifecycle.LifecycleOwner class io.flutter.embedding.engine.FlutterEngine, unresolved supertypes: androidx.lifecycle.LifecycleOwner

e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\searchable_dropdown-1.1.2\android\src\main\kotlin\bsi\iceman\searchable_dropdown\SearchableDropdownPlugin.kt: (3, 28): Unresolved reference: NonNull e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\searchable_dropdown-1.1.2\android\src\main\kotlin\bsi\iceman\searchable_dropdown\SearchableDropdownPlugin.kt: (19, 36): Unresolved reference: NonNull e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\searchable_dropdown-1.1.2\android\src\main\kotlin\bsi\iceman\searchable_dropdown\SearchableDropdownPlugin.kt: (41, 30): Unresolved reference: NonNull e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\searchable_dropdown-1.1.2\android\src\main\kotlin\bsi\iceman\searchable_dropdown\SearchableDropdownPlugin.kt: (41, 57): Unresolved reference: NonNull e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\searchable_dropdown-1.1.2\android\src\main\kotlin\bsi\iceman\searchable_dropdown\SearchableDropdownPlugin.kt: (49, 38): Unresolved reference: NonNull

FAILURE: Build failed with an exception.

how to solve this ? thank you for your hard work

lcuis commented 4 years ago

Hello @gianalmada ,

Thanks for reporting this.

Here are a couple of questions:

  1. Can you please paste here the result of the flutter doctor -v command?
  2. Same for flutter build --verbose?
  3. Is AndoirdX enabled in your project?
lcuis commented 4 years ago

Here is how I tried reproducing your issue with no success so far.

Minimalist project with searchable_dropdown example with:

 AndroidX support    Kotlin support    Result
  no                  no                searchable_dropdown 1.1.2 worked
  no                  yes               searchable_dropdown 1.1.2 worked
  yes                 no                searchable_dropdown 1.1.2 worked

The case with both supports is the normal scenario that I usually use.

I am using Android Studio on Debian Linux with the following flutter --version output:

Flutter 1.15.3 • channel dev • https://github.com/flutter/flutter.git
Framework • revision 67826bdce5 (5 weeks ago) • 2020-02-10 14:59:32 -0800
Engine • revision 6158f03ef5
Tools • Dart 2.8.0 (build 2.8.0-dev.8.0 514a8d4c84)

Do you see something that might explain why this is working for me and not for you?

Is there a minimalist project that you could share with me so that I can try reproducing this issue on my machine?

Sorry for the inconvenience.

gian-almada commented 4 years ago

Hello @gianalmada ,

Thanks for reporting this.

Here are a couple of questions:

1. Can you please paste here the result of the `flutter doctor -v` command?

2. Same for `flutter build --verbose`?

3. Is AndoirdX enabled in your project?

1. [√] Flutter (Channel unknown, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.18363.720], locale en-US) • Flutter version 1.9.1+hotfix.6 at C:\src\flutter • Framework revision 68587a0916 (6 months ago), 2019-09-13 19:46:58 -0700 • Engine revision b863200c37 • Dart version 2.5.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at C:\Users\giana\AppData\Local\Android\sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04) • All Android licenses accepted.

[√] Android Studio (version 3.6) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 44.0.2 • Dart plugin version 192.7761 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] Connected device (1 available) • Redmi Note 8 • 12666e56 • android-arm64 • Android 9 (API 28)

• No issues found!

2. [ +40 ms] executing: [C:\src\flutter] git log -n 1 --pretty=format:%H [ +117 ms] Exit code 0 from: git log -n 1 --pretty=format:%H [ +3 ms] 68587a0916366e9512a78df22c44163d041dd5f3 [ ] executing: [C:\src\flutter] git describe --match v.. --first-parent --long --tags [ +93 ms] Exit code 0 from: git describe --match v.. --first-parent --long --tags [ ] v1.9.1+hotfix.6-0-g68587a091 [ +10 ms] executing: [C:\src\flutter] git rev-parse --abbrev-ref --symbolic @{u} [ +69 ms] Exit code 128 from: git rev-parse --abbrev-ref --symbolic @{u} [ ] fatal: HEAD does not point to a branch 3. yes, im using it

gian-almada commented 4 years ago

Here is how I tried reproducing your issue with no success so far.

Minimalist project with searchable_dropdown example with:

 AndroidX support    Kotlin support    Result
  no                  no                searchable_dropdown 1.1.2 worked
  no                  yes               searchable_dropdown 1.1.2 worked
  yes                 no                searchable_dropdown 1.1.2 worked

The case with both supports is the normal scenario that I usually use.

I am using Android Studio on Debian Linux with the following flutter --version output:

Flutter 1.15.3 • channel dev • https://github.com/flutter/flutter.git
Framework • revision 67826bdce5 (5 weeks ago) • 2020-02-10 14:59:32 -0800
Engine • revision 6158f03ef5
Tools • Dart 2.8.0 (build 2.8.0-dev.8.0 514a8d4c84)

Do you see something that might explain why this is working for me and not for you?

Is there a minimalist project that you could share with me so that I can try reproducing this issue on my machine?

Sorry for the inconvenience.

i think, this package not include in your android build gradle: implementation "androidx.annotation:annotation:1.0.0" implementation "com.android.support:support-annotations:28.0.0" and causing error,

lcuis commented 4 years ago

Thanks for your feedback @gianalmada !

It seems to me that the initial version of the plugin didn't have any annotation related lines in the android/build.gradle file: https://github.com/icemanbsi/searchable_dropdown/commit/1c85f073a039e7261228e2346e1830a8bfc08243#diff-7ae5a9093507568eabbf35c3b0665732

Is there something that makes you say that this could be the source of the issue?

Is there something I can do to confirm or not whether this is the source of the issue?

It seems to me that your version of Flutter is almost 5 months old. Could you please try an update of Flutter and dart, followed by a flutter clean and build again to see if this solves your issue?