Closed iwontknow closed 11 months ago
Maybe you put the package dependency in dev_dependencies
but you're using the package methods in your app? If so, move the dependency to dependencies
instead.
Hey, I didn't use the methods in my app yet, but I tried both. First dev_dependencies
and then dependencies
.
Can you supply a minimal project that demonstrates the error?
So I have an update for you. After a restart of my computer and flutter clean && flutter pub get
, it magically works. I didnt change a thing. Sorry for any inconvenience I may have caused you.
Glad you were able to resolve it. 👍
@jonbhanson I have the same problem (flutter clean && flutter pub get
doesn't fix it for me).
When I add to pubspec.yaml
dev_dependencies:
flutter_native_splash: ^2.3.9
then the following lines get added to GeneratedPluginRegistrant.java
:
try {
flutterEngine.getPlugins().add(new net.jonhanson.flutter_native_splash.FlutterNativeSplashPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin flutter_native_splash, net.jonhanson.flutter_native_splash.FlutterNativeSplashPlugin", e);
}
and on build I get the error:
android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:49: error: package net.jonhanson.flutter_native_splash does not exist
flutterEngine.getPlugins().add(new net.jonhanson.flutter_native_splash.FlutterNativeSplashPlugin());
Doing grep -r net.jonhanson.flutter_native_splash .
fails to find this package mentioned anywhere but GeneratedPluginRegistrant
, whereas searching for the package names of other plugins in GeneratedPluginRegistrant
shows numerous paths.
Since I'm adding this to dev_dependencies
, I don't think this plugin should even be being added to GeneratedPluginRegistrant
.
I have to remove this library from dev_dependencies
before I can build my app.
@lukehutch This may sound dumb, but try restarting your computer. This fixed it for me.
@iwontknow Oh.. I've had the same thing, and as you say, reboot pc and flutter clean -> flutter pub get
so it goes well... It's ironic
Describe the bug
I can successfully create a Splash Screen with the
dart run flutter_native_splash:create
command. However, if i try to run the app afterwards. I get an Error and the build will fail.Configuration
Device (please complete the following information):
To Reproduce Steps to reproduce the behavior:
Screenshots
Additional context I tried following, but nothing helped. I also searched for similar bug related to this dependencie but found nothing. Did i miss something?
flutter clean
flutter pub cache repair
Uninstall / Reinstall dependencies Create Splashscreen, delete Splashscreen Invalidate Caches from IDE, Repair IDE, Restart IDE