最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Flutter can not run - Stack Overflow

programmeradmin1浏览0评论

I did a git clone of a new flutter project to be put in. I downloaded the new flutter sdk and android studio, and java got version 17.

However, when I run the cloned file locally, the following error message appears and it does not run.

Package flutter_local_notifications:linux references flutter_local_notifications_linux:linux as the default plugin, but the package does not exist, or is not a plugin package.
Ask the maintainers of flutter_local_notifications to either avoid referencing a default implementation via platforms: linux: default_package: flutter_local_notifications_linux or create a plugin named flutter_local_notifications_linux.

Package flutter_local_notifications:linux references flutter_local_notifications_linux:linux as the default plugin, but the package does not exist, or is not a plugin package.
Ask the maintainers of flutter_local_notifications to either avoid referencing a default implementation via platforms: linux: default_package: flutter_local_notifications_linux or create a plugin named flutter_local_notifications_linux.

Package flutter_local_notifications:linux references flutter_local_notifications_linux:linux as the default plugin, but the package does not exist, or is not a plugin package.
Ask the maintainers of flutter_local_notifications to either avoid referencing a default implementation via platforms: linux: default_package: flutter_local_notifications_linux or create a plugin named flutter_local_notifications_linux.

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files\Java\jdk-23\bin\java.exe

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at 
Error: Gradle task assembleDebug failed with exit code 1

Exited (1).

I don't know what the problem is. I think it's probably a version problem, is there a solution?

For your information, there seems to be an error related to flutter_local_notifications, but there is a problem that push notification does not work even in the app distributed in that file.

I did a git clone of a new flutter project to be put in. I downloaded the new flutter sdk and android studio, and java got version 17.

However, when I run the cloned file locally, the following error message appears and it does not run.

Package flutter_local_notifications:linux references flutter_local_notifications_linux:linux as the default plugin, but the package does not exist, or is not a plugin package.
Ask the maintainers of flutter_local_notifications to either avoid referencing a default implementation via platforms: linux: default_package: flutter_local_notifications_linux or create a plugin named flutter_local_notifications_linux.

Package flutter_local_notifications:linux references flutter_local_notifications_linux:linux as the default plugin, but the package does not exist, or is not a plugin package.
Ask the maintainers of flutter_local_notifications to either avoid referencing a default implementation via platforms: linux: default_package: flutter_local_notifications_linux or create a plugin named flutter_local_notifications_linux.

Package flutter_local_notifications:linux references flutter_local_notifications_linux:linux as the default plugin, but the package does not exist, or is not a plugin package.
Ask the maintainers of flutter_local_notifications to either avoid referencing a default implementation via platforms: linux: default_package: flutter_local_notifications_linux or create a plugin named flutter_local_notifications_linux.

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files\Java\jdk-23\bin\java.exe

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.
Error: Gradle task assembleDebug failed with exit code 1

Exited (1).

I don't know what the problem is. I think it's probably a version problem, is there a solution?

For your information, there seems to be an error related to flutter_local_notifications, but there is a problem that push notification does not work even in the app distributed in that file.

Share Improve this question asked Feb 4 at 5:18 대전_1반_유지원대전_1반_유지원 111 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

The error you're getting is quite clear: The supplied javaHome seems to be invalid, so you probably just have to update the JAVA_HOME environment variable (if you are using it) or move your JDK to the path your IDE is looking for it (which is also listed in the error you posted, C:\Program Files\Java\jdk-23\bin\java.exe). That should be enough to solve the current issue.

发布评论

评论列表(0)

  1. 暂无评论