简体   繁体   English

在 Android Studio 上运行应用程序,模拟器打开,但不显示应用程序

[英]Running App on Android Studio, Emulator opens up, but doesnt show app

hope you all doin fine.希望你们一切顺利。

I try to run my code in Android Studio(btw. if i do it on Visual Studio its the same), and the code is clean, he opens up the Virtual Device but doesnt show my app.我尝试在 Android Studio 中运行我的代码(顺便说一句。如果我在 Visual Studio 上运行它也是一样的),并且代码很干净,他打开了虚拟设备但没有显示我的应用程序。

Launching lib\\main.dart on Android SDK built for x86 in debug mode... Running Gradle task 'assembleDebug'... e: java.io.IOException: Cannot run program "C:\\Users\\Tigran\\Desktop\\jdk-12.0.2\\bin\\java" (in directory "C:\\Users\\Tigran\\AppData\\Local\\kotlin\\daemon"): CreateProcess error=2, Das System kann die angegebene Datei nicht finden FAILURE: Build failed with an exception What went wrong: Execution failed for task ':app:compileDebugKotlin'. java.io.IOException: Cannot run program "C:\\Users\\Tigran\\Desktop\\jdk-12.0.2\\bin\\java": CreateProcess error=2, Das System kann die angegebene Datei nicht finden 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.org BUILD FAILED in 2m 26s Finished with error: Gradle task assembleDebug failed with exit code 1

This is the error im getting back.这是我回来的错误。 And i can remember that when i updated Android Studio there was a little check mark on deleting directories or smth like that, and i did hit that, so i think it stands in some connection to this problem.我记得当我更新 Android Studio 时,在删除目录或类似的东西时有一个小复选标记,我确实遇到了这个问题,所以我认为它与这个问题有某种联系。

Does anyone know how to solve this problem?有谁知道如何解决这个问题?

I think the solution to this problem is as follows:我认为解决这个问题的方法如下:

1-Open your flutter Project directory. 1-打开你的颤振项目目录。

2-Change directory to android directory in your flutter project directory. 2-将目录更改为flutter项目目录中的android目录。

3-Pub get with file pubspec.yaml . 3-Pub 获取文件pubspec.yaml

4-Clean Gradle and build gradle , if you need use this command ./gradlew clean build . 4-Clean Gradle 和 build gradle ,如果你需要使用这个命令./gradlew clean build

5- Run Project. 5- 运行项目。

If that doesn't work, you should reinstall the Java JDK and repeat the same steps .如果这不起作用,您应该重新安装Java JDK并重复相同的步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM