Comments (4)
哇,写的这么详细。辛苦了。这些问题应该马上在master上修复好了
flutter/flutter#35217
flutter/flutter#36805
非常感谢你对社区对贡献
from blogs.
请问,我在Flutter module下的.android/app中的build.gradle中添加:
buildTypes {
release {}
debug {}
}
flavorDimensions "environment"
productFlavors {
develop {
}
production {
}
}
运行Flutter module,报的错:
[ERROR:flutter/runtime/dart_vm_data.cc(19)] VM snapshot invalid and could not be inferred from settings.
[ERROR:flutter/runtime/dart_vm.cc(241)] Could not setup VM data to bootstrap the VM from.
[ERROR:flutter/runtime/dart_vm_lifecycle.cc(89)] Could not create Dart VM instance.
[FATAL:flutter/shell/common/shell.cc(218)] Check failed: vm. Must be able to initialize the VM.
请教怎么解决,我主要做iOS,Android不懂,多谢指点一下!
from blogs.
如果Android项目本身的app
(而不是flutter-module/.android/app
)中的build.gradle文件中没有配置productFlavors
, 不需要在对应的 flutter-module/.android/app
中配置相同的productFlavors
如果你的项目是Android原生和Flutter混编,应该找Android开发的同事(或者看Android原生项目的源码),看一下build.gradle
中的配置,保证对应的buildTypes配置和flutter-module/.android/app/build.gradle
一致即可。
from blogs.
如果Android项目本身的
app
(而不是flutter-module/.android/app
)中的build.gradle文件中没有配置productFlavors
, 不需要在对应的flutter-module/.android/app
中配置相同的productFlavors
如果你的项目是Android原生和Flutter混编,应该找Android开发的同事(或者看Android原生项目的源码),看一下
build.gradle
中的配置,保证对应的buildTypes配置和flutter-module/.android/app/build.gradle
一致即可。
我保持了一致,并且在AS的Build Variants中也都选择成一致的,仍然出现了此问题,很困惑。
经过一些测试,我定位到应该是buildTypes的问题,我在项目中自定义了一些BuildTypes
比如:
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
ceshi {
initWith debug
}
}
flavorDimensions "environment"
productFlavors {
dev {
dimension 'environment'
}
qa {
dimension 'environment'
}
prod {
dimension 'environment'
}
}
我将这些设置同步到了flutter模块中的gradle文件中,在选择debug时可以正常的调起flutter模块,但是如果我选择的是ceshi这个buildtype,仍然会出现
E/flutter: [ERROR:flutter/runtime/dart_vm_data.cc(18)] VM snapshot invalid and could not be inferred from settings.
[ERROR:flutter/runtime/dart_vm.cc(250)] Could not setup VM data to bootstrap the VM from.
[ERROR:flutter/runtime/dart_vm_lifecycle.cc(84)] Could not create Dart VM instance.
A/flutter: [FATAL:flutter/shell/common/shell.cc(274)] Check failed: vm. Must be able to initialize the VM.
A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 5689 (ver.learnkotlin), pid 5689 (ver.learnkotlin)
from blogs.
Related Issues (20)
- 反思|Android 事件拦截机制的设计与实现
- 反思|Android源码模块化管理工具Repo分析
- 反思|Android 输入系统 & ANR机制的设计与实现 HOT 1
- 反思 | 事件总线的局限性,及组件化开发流程中通信机制的设计与实现
- 反思|官方也无力回天?Android SharedPreferences的设计与实现
- [译] 编写AndroidStudio插件(一):创建一个基本插件
- [译] 编写AndroidStudio插件(二):持久化数据
- [译] 编写AndroidStudio插件(三): 更多配置
- [译] 编写AndroidStudio插件(四):整合Jira
- [译] 编写AndroidStudio插件(五):本地化和通知
- 反思 | 开启B站少女心模式,探究APP换肤机制的设计与实现
- [译] Android Visualizer 可视化器的自定义实现
- 反思 | Android 音视频缓存机制的系统性设计
- Android 音频倍速的原理与算法分析
- Android ExoPlayer 分场景集成不同音频倍速算法的实现
- 卷起来了!Android OpenGL 仿自如 APP 裸眼 3D 效果
- Unity3D-导出特效到安卓项目流程
- 反思: Google 为何把 SurfaceView 设计的这么难用?
- 目录链接错误 HOT 1
- 社区说|浅谈 WorkManager 的设计与实现:系统概述
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blogs.