Closed
Description
Hi everyone,i have a big problem i can't figure out.I have crash when i add flutter module to existing apps.I do follow this link https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps .It's working but when i add fabric.io to build.gradle of android project i have crash.
Steps to Reproduce
- do follow https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps it's working
- add fabric.io into build.gradle to android project
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
transitive = true;
}
- Build again and app crash.Flutter log error like this
07-26 22:07:19.384 16435-16435/com.app.myapplication E/flutter: [ERROR:flutter/runtime/dart_vm.cc(256)] VM snapshot must be valid.
07-26 22:07:19.384 16435-16435/com.app.myapplication A/flutter: [FATAL:flutter/shell/common/shell.cc(216)] Check failed: vm. Must be able to initialize the VM.
Logs
[07-26 22:07:19.384 16435-16435/com.app.myapplication E/flutter: [ERROR:flutter/runtime/dart_vm.cc(256)] VM snapshot must be valid.
07-26 22:07:19.384 16435-16435/com.app.myapplication A/flutter: [FATAL:flutter/shell/common/shell.cc(216)] Check failed: vm. Must be able to initialize the VM.
--------- beginning of crash
07-26 22:07:19.384 16435-16435/com.app.myapplication A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 16435 (p.myapplication)
07-26 22:07:19.405 16485-16485/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-26 22:07:19.406 16485-16485/? A/DEBUG: Build fingerprint: 'google/sdk_gphone_x86/generic_x86:8.0.0/OSR1.170901.043/4456315:user/release-keys'
Revision: '0'
07-26 22:07:19.407 16485-16485/? A/DEBUG: ABI: 'x86'
pid: 16435, tid: 16435, name: p.myapplication >>> com.app.myapplication <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
07-26 22:07:19.409 16485-16485/? A/DEBUG: Abort message: '[FATAL:flutter/shell/common/shell.cc(216)] Check failed: vm. Must be able to initialize the VM.
'
eax 00000000 ebx 00004033 ecx 00004033 edx 00000006
esi 00004033 edi bffaada8
xcs 00000073 xds 0000007b xes 0000007b xfs 0000003b xss 0000007b
eip acb6aac4 ebp bffaadc8 esp bffaad5c flags 00200296
07-26 22:07:19.411 16485-16485/? A/DEBUG: backtrace:
#00 pc 00000ac4 [vdso:acb6a000] (__kernel_vsyscall+16)
#01 pc 00075b3c /system/lib/libc.so (tgkill+28)
#02 pc 0001f04e /system/lib/libc.so (abort+110)
#03 pc 00334383 /data/app/com.app.myapplication-Vn-1qYse4nMlk8AyJbFuPQ==/lib/x86/libflutter.so
#04 pc 00334ab9 /data/app/com.app.myapplication-Vn-1qYse4nMlk8AyJbFuPQ==/lib/x86/libflutter.so
#05 pc 000d1b4f /data/app/com.app.myapplication-Vn-1qYse4nMlk8AyJbFuPQ==/lib/x86/libflutter.so
#06 pc 0007cd33 /data/app/com.app.myapplication-Vn-1qYse4nMlk8AyJbFuPQ==/lib/x86/libflutter.so
#07 pc 00086283 /data/app/com.app.myapplication-Vn-1qYse4nMlk8AyJbFuPQ==/lib/x86/libflutter.so
#08 pc 0001b43a /data/app/com.app.myapplication-Vn-1qYse4nMlk8AyJbFuPQ==/oat/x86/base.odex (offset 0x1b000)
#09 pc 000d9fff [anon:libc_malloc:a8500000]
#10 pc 0056e99f /dev/ashmem/dalvik-main space (region space) (deleted)
Activity
zoechi commentedon Jul 26, 2018
Please add the output of
flutter doctor -v
.jason-simmons commentedon Jul 26, 2018
What do the contents of the APK zip file look like before and after adding the fabric.io dependency?
The assertion failure indicates that the Flutter engine can not find the assets representing the application's Dart code.
Look for files in the APK such as
assets/flutter_assets/isolate_snapshot_data
,assets/flutter_assets/kernel_blob.bin
,assets/flutter_assets/platform.dill
, andassets/flutter_assets/vm_snapshot_data
.Are these files still present in the right places after adding fabric.io?
haihai111 commentedon Jul 27, 2018
this is flutter doctor,everything is fine
haihai111 commentedon Jul 27, 2018
@jason-simmons
APK after add fabric have assets flutter such as isolate_snapshot_data,vm_snapshot_data.But when i add fabric,it gone!!!
haihai111 commentedon Jul 27, 2018
Hi i found reason make app crash.
apply plugin: 'io.fabric'
This is a code make crash app,when i remove it app working.But when i remove that code,i can't install fabric in my app!!!
loidoan commentedon Aug 23, 2018
I was also so. Is there a way to fix it?
luanpotter commentedon Aug 24, 2018
I also had the exactly same problem, can confirm that removing the apply plugin from fabric solves the problem, but is there a way to keep using fabric? Is it a problem with the fabric plugin itself?
ZhangQinglian commentedon Aug 26, 2018
I had the problem too.Is there some way to solve this problem without remove fabric ?
loidoan commentedon Aug 27, 2018
Here ! I fixed this. You can checkout Upgrading Flutter channel master "https://flutter.io/upgrading/" . You without remove fabric. When you upgrading after restart your project.
ZhangQinglian commentedon Aug 27, 2018
Still not work .
haihai111 commentedon Aug 27, 2018
add this line in strings.xml
"< string name="com.crashlytics.RequireBuildId">false < /string > "
and remove : apply plugin: 'io.fabric'
in build.gradle
Now fabric still work and when you build release flutter not crash.I don't know why,but it woking.You can try
loidoan commentedon Aug 27, 2018
@haihai111 thanks you. I can do it. But i don't know why?. I think Fultter add plugin faric ✌️
ZhangQinglian commentedon Aug 28, 2018
when the app crash , I find that apk's assets path missing "flutter_shared" .
24 remaining items