Skip to content

Crash App when add flutter module to existing apps #19818

Closed
@haihai111

Description

@haihai111

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

  1. do follow https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps it's working
  2. 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;
}
  1. 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.

screen shot 2018-07-26 at 10 07 37 pm

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

added
c: crashStack traces logged to the console
a: existing-appsIntegration with existing apps via the add-to-app flow
on Jul 26, 2018
zoechi

zoechi commented on Jul 26, 2018

@zoechi
Contributor

Please add the output of flutter doctor -v.

jason-simmons

jason-simmons commented on Jul 26, 2018

@jason-simmons
Member

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, and assets/flutter_assets/vm_snapshot_data.

Are these files still present in the right places after adding fabric.io?

haihai111

haihai111 commented on Jul 27, 2018

@haihai111
Author

this is flutter doctor,everything is fine

screen shot 2018-07-27 at 8 35 20 am

haihai111

haihai111 commented on Jul 27, 2018

@haihai111
Author

@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

haihai111 commented on Jul 27, 2018

@haihai111
Author

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

loidoan commented on Aug 23, 2018

@loidoan

I was also so. Is there a way to fix it?

luanpotter

luanpotter commented on Aug 24, 2018

@luanpotter
Contributor

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

ZhangQinglian commented on Aug 26, 2018

@ZhangQinglian

I had the problem too.Is there some way to solve this problem without remove fabric ?

loidoan

loidoan commented on Aug 27, 2018

@loidoan

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

ZhangQinglian commented on Aug 27, 2018

@ZhangQinglian

Still not work .

haihai111

haihai111 commented on Aug 27, 2018

@haihai111
Author

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

loidoan commented on Aug 27, 2018

@loidoan

@haihai111 thanks you. I can do it. But i don't know why?. I think Fultter add plugin faric ✌️

ZhangQinglian

ZhangQinglian commented on Aug 28, 2018

@ZhangQinglian

when the app crash , I find that apk's assets path missing "flutter_shared" .

24 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: existing-appsIntegration with existing apps via the add-to-app flowc: crashStack traces logged to the console

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @zoechi@EchoFUN@luanpotter@kimlet@sbaranov

    Issue actions

      Crash App when add flutter module to existing apps · Issue #19818 · flutter/flutter