Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check failed: vm. Must be able to initialize the VM #25147

Closed
SolveBugs opened this issue Dec 10, 2018 · 13 comments
Closed

Check failed: vm. Must be able to initialize the VM #25147

SolveBugs opened this issue Dec 10, 2018 · 13 comments

Comments

@SolveBugs
Copy link

SolveBugs commented Dec 10, 2018

Add2App, when i runing my host app,there is a exception:
Check failed: vm. Must be able to initialize the VM.
and,my flutter doctor -v info :

[✓] Flutter (Channel master, v1.0.1-pre.3, on Mac OS X 10.13.6 17G65, locale zh-Hans-CN)
    • Flutter version 1.0.1-pre.3 at /Users/zhenqiang/flutter_sdk/flutter
    • Framework revision d74b1c2051 (2 days ago), 2018-12-07 14:19:09 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/zhenqiang/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/zhenqiang/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✗] iOS toolchain - develop for iOS devices
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    ✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew, run:
        brew update
        brew install --HEAD usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install with Brew:
        brew install ios-deploy
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
        For more info, see https://flutter.io/platform-plugins
      To install:
        brew install cocoapods
        pod setup

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 31.1.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] Connected device (1 available)
    • H60 L01 • 7N2SSE155J045614 • android-arm • Android 6.0 (API 23)

and i am in master channel.

Can anybody help me for this problem?

@zoechi
Copy link
Contributor

zoechi commented Dec 10, 2018

Check failed: vm. Must be able to initialize the VM.

Is this the exact and full error output?

@zoechi
Copy link
Contributor

zoechi commented Dec 10, 2018

Duplicate of #24641

@zoechi zoechi marked this as a duplicate of #24679 Dec 10, 2018
@zoechi zoechi closed this as completed Dec 10, 2018
@zoechi zoechi marked this as a duplicate of #24641 Dec 10, 2018
@SolveBugs
Copy link
Author

@zoechi yes,this is the full error output.
can you tell me how to solve it?
please,thank you very much.

@SolveBugs
Copy link
Author

@zoechi And this is a known issue?When to solve? thanks a lot.

@zhanzengyu
Copy link

@SolveBugs I solve it by #24679 from @jelenalecic
remember release add proguard

@SolveBugs
Copy link
Author

@nesger 你好,怎么解决的?我的问题是apk中的assets文件里少了flutter_assets文件夹,导致dart虚拟机初始化失败

@SolveBugs
Copy link
Author

@nesger 按照这个步骤吗?
1。Import flutter module to your HOST app(set binding, implementation, and instantiate view/fragment)
When you clean/rebuild from HOST app, flutter module does not generate properly
2.You need to open your flutter module in a separate AS
3.flutter clean
4.cd .android
5./gradlew clean
6./gradlew assembleDebug
7.Return to host app and run app(do not sync or rebuild) :)

@zhanzengyu
Copy link

zhanzengyu commented Dec 12, 2018

@nesger 按照这个步骤吗?
1。Import flutter module to your HOST app(set binding, implementation, and instantiate view/fragment)
When you clean/rebuild from HOST app, flutter module does not generate properly
2.You need to open your flutter module in a separate AS
3.flutter clean
4.cd .android
5./gradlew clean
6./gradlew assembleDebug
7.Return to host app and run app(do not sync or rebuild) :)

@SolveBugs 嗯,我是按照这样去处理的。
不过不需要将flutter module在一个单独的模块开启。
另外需要注意的是不要用IDE去运行主Module。
你这样操作之后。直接到主模块运行 ./gradlew installDebug
如果你要先执行 clean,就按照如下步骤:

  1. cd 到主模块
  2. 执行./gradlew clean
  3. cd 到Flutter模块
  4. 执行上面3-6。第6可以换成./gradlew assemble。这样可以把release也打包出来。
  5. cd 到主模块
  6. 执行./gradlew installDebug
    然后看看效果。应该是可以的。
    这边后续会写下博客记录这个坑。耗费了很多时间

@SolveBugs
Copy link
Author

@nesger 好的我试试。大佬写好文章了告知一声

@zhanzengyu
Copy link

@SolveBugs 更多问题可以看下我的 FlutterNote,后续会记录使用过程的坑。刚好最近实际项目有需求会使用。https://github.com/nesger/FlutterNote。
可以 star 和 follow 一波。后续会更新的。

@weidongjian
Copy link

也碰到了,上面的方法对我无效,自己后来解决了,方案如下:
https://www.jianshu.com/p/2d0bba84e57e

@wsmzdyss
Copy link

wsmzdyss commented Jul 4, 2019

最简单的一种方法是先单独运行一下flutter里的main.dart,然后再运行app就可以了。

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants