-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
a: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowc: crashStack traces logged to the consoleStack traces logged to the consoleplatform-androidAndroid applications specificallyAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Milestone
Description
Steps to Reproduce
- Follow https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps for Android
- Add build flavors to
app/build.gradle, as simple as
productFlavors {
paid {
applicationId "com.example.flutter.paid"
}
}
- Click "Run" on Android studio
Logs
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/saas.ins.inspectorio-2/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@saas.ins.inspectorio-2@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/saas.ins.inspectorio-2/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@saas.ins.inspectorio-2@split_lib_slice_0_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/saas.ins.inspectorio-2/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@saas.ins.inspectorio-2@split_lib_slice_1_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/saas.ins.inspectorio-2/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@saas.ins.inspectorio-2@split_lib_slice_2_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/saas.ins.inspectorio-2/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@saas.ins.inspectorio-2@split_lib_slice_3_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/saas.ins.inspectorio-2/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@saas.ins.inspectorio-2@split_lib_slice_4_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/saas.ins.inspectorio-2/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@saas.ins.inspectorio-2@split_lib_slice_5_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/saas.ins.inspectorio-2/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@saas.ins.inspectorio-2@split_lib_slice_6_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/saas.ins.inspectorio-2/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@saas.ins.inspectorio-2@split_lib_slice_7_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/saas.ins.inspectorio-2/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@saas.ins.inspectorio-2@split_lib_slice_8_apk.apk@classes.dex) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/data/app/saas.ins.inspectorio-2/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/arm/data@app@saas.ins.inspectorio-2@split_lib_slice_9_apk.apk@classes.dex) because non-0 exit status
I/InstantRun: starting instant run server: is main process
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
I/ResourceExtractor: Found extracted resources res_timestamp-450000-1554992471308
Resource version mismatch res_timestamp-450000-1554992487134
E/flutter: [ERROR:flutter/runtime/dart_vm_data.cc(19)] VM snapshot invalid and could not be inferred from settings.
[ERROR:flutter/runtime/dart_vm.cc(237)] Could not setup VM data to bootstrap the VM from.
[ERROR:flutter/runtime/dart_vm_lifecycle.cc(81)] Could not create Dart VM instance.
A/flutter: [FATAL:flutter/shell/common/shell.cc(218)] Check failed: vm. Must be able to initialize the VM.
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 7006 (ins.inspectorio)
Disconnected from the target VM, address: 'localhost:8602', transport: 'socket'
[✓] Flutter (Channel master, v1.4.13-pre.6, on Mac OS X 10.14.3 18D109, locale en-VN)
• Flutter version 1.4.13-pre.6 at /usr/local/Cellar/flutter/1.1.1
• Framework revision e5722f32e4 (2 days ago), 2019-04-09 03:09:41 -0400
• Engine revision 8a46559653
• Dart version 2.2.1 (build 2.2.1-dev.3.1 None)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/truongsinh/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• 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-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2, Build version 10E125
• ios-deploy 1.9.4
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] VS Code (version 1.33.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.25.0
[✓] Connected device (1 available)
• SM A300FU • 5717d6bf • android-arm • Android 6.0.1 (API 23)
• No issues found!
The problem is that apk built with build flavor does not have flutter_assets, as seen in this screenshot.
At the moment, my workaround is to run , as share in my Hackernoon article../gradlew :flutter:copyFlutterAssetsDebug manually whenever I clean the project or make changes
android.buildTypes.all{ theBuildType ->
android.productFlavors.all { theProductFlavor ->
tasks.whenTaskAdded { theTask ->
if (theTask.name == "merge${theProductFlavor.name.capitalize()}${theBuildType.name.capitalize()}Assets") {
theTask.dependsOn ":flutter:copyFlutterAssets${theBuildType.name.capitalize()}"
}
}
}
}
Diff gist: https://gist.github.com/truongsinh/c71bb008b3dbea1d9d0e3bac0125f4bb#file-build-gradle-diff
I would love to make a PR to fix this, but I'm not familiar with Groovy and Gradle.
yongjhih, tomaszpolanski, jiexunsee, HOLDfoot and bitsydareljiexunsee
Metadata
Metadata
Assignees
Labels
a: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowc: crashStack traces logged to the consoleStack traces logged to the consoleplatform-androidAndroid applications specificallyAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
