gskinnerTeam / flutter_vignettes

A collection of fun Flutter experiments, created by gskinner, in partnership with Google.
https://flutter.gskinner.com
MIT License
4.54k stars 990 forks source link

unable to run parallax_travel_cards_hero project #2

Closed TheAlphamerc closed 4 years ago

TheAlphamerc commented 4 years ago

I am not able to run project on my android device getting below error on project run command.

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

e: /Users/sonusharma/Documents/Flutter Projects/GitPro/flutter_vignettes-master/vignettes/parallax_travel_cards_hero/android/app/src/main/kotlin/com/example/parallax_travel_cards_hero/MainActivity.kt: (3, 28): Unresolved reference: NonNull
e: /Users/sonusharma/Documents/Flutter Projects/GitPro/flutter_vignettes-master/vignettes/parallax_travel_cards_hero/android/app/src/main/kotlin/com/example/parallax_travel_cards_hero/MainActivity.kt: (9, 42): Unresolved reference: NonNull
e: /Users/sonusharma/Documents/Flutter Projects/GitPro/flutter_vignettes-master/vignettes/parallax_travel_cards_hero/android/app/src/main/kotlin/com/example/parallax_travel_cards_hero/MainActivity.kt: (10, 48): Type mismatch: inferred type is FlutterEngine but PluginRegistry! was expected
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
*******************************************************************************************
Gradle task assembleDebug failed with exit code 1

Steps to produce error

  1. Download project from github.

  2. Extract downloaded zip into a folder.

  3. Open parallax_travel_cards_hero folder in VS code.

  4. Run Flutter pub get command.

  5. Run project.

Flutter Environment

[flutter] flutter doctor -v
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.14.6 18G95, locale en-IN)
    • Flutter version 1.9.1+hotfix.6 at /Users/sonusharma/Downloads/flutter
    • Framework revision 68587a0916 (3 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 /Users/sonusharma/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.3, Build version 10G8
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 41.0.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (1 available)
    • Redmi Note 7S • 97d3cc41 • android-arm64 • Android 9 (API 28)

! Doctor found issues in 1 category.
exit code 0
esDotDev commented 4 years ago

Thanks for the report. Have you tried running flutter upgrade ?

TheAlphamerc commented 4 years ago

no

esDotDev commented 4 years ago

I'd recommend you try upgrading to the latest versions of Flutter, we haven't tested in in 1.9 which is quite old now. In your terminal in your IDE, just enter flutter upgrade, you also might want to throw in a flutter clean for good measure,

dcocom commented 4 years ago

Can you try following the next steps?:

Your output mention some incompatibilities. I would also recommend checking your flutter doctor your Android NDK is not setup (not required but good to have) and you haven't accepted some licensing.

orimdominic commented 4 years ago

@TheAlphamerc I also suggest you try out the suggestions by @esDotDev and @dcocom. The parallax_travel_cards_hero project was able to run on my computer without any issues

flutter doctor -v

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

[√] Android Studio (version 3.5) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 42.1.1 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.41.0) • VS Code at C:\Users\scata2\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.7.1

[√] Connected device (1 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

• No issues found!

esDotDev commented 4 years ago

Closing for now, let us know if you still can not get it working.