jonbhanson / flutter_native_splash

Automatically generates native code for adding splash screens in Android and iOS. Customize with specific platform, background color and splash image.
https://pub.dev/packages/flutter_native_splash
MIT License
1.28k stars 200 forks source link

When running the app on Android emulator, the following error occurs. #663

Closed nnsyu closed 2 months ago

nnsyu commented 3 months ago

Attention: If you open a bug report without sufficient details, it will be closed. Is your question related to Android 12? Please check the notes on Android 12 first (https://pub.dev/packages/flutter_native_splash#android-12-support).

Describe the bug

When running the app on Android emulator, the following error occurs.

\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:24: error: package net.jonhanson.flutter_native_splash does not exist flutterEngine.getPlugins().add(new net.jonhanson.flutter_native_splash.FlutterNativeSplashPlugin());

Configuration

flutter_native_splash: color: "#EEE8DC" image: assets/images/splash_bear.png

android_12: color: "#EEE8DC" image: assets/images/splash_bear.png

Device (please complete the following information):

To Reproduce Steps to reproduce the behavior, using the example app:

  1. add this line in pubspec.yaml dependencies: flutter_native_splash: ^2.3.11
  2. run flutter pub get
  3. add file "flutter_native_splash.yaml" in root dir
  4. run command "dart run flutter_native_splash:create" in terminal
  5. Run in an emulator
  6. See error

Screenshots If applicable, add screenshots to help explain your problem. If in doubt, attach a screenshot.

image

Additional context Add any other context about the problem here.

jonbhanson commented 2 months ago

Based on #645, rebooting your computer and running flutter clean && flutter pub get may resolve the problem.

jonbhanson commented 2 months ago

Closed due to inactivity. Feel free to reopen if you are still having trouble.