Flutter app freeze in build release, work properly in debug, androidX?

醉酒当歌 提交于 2020-01-06 14:27:11

问题


final update:

now everything works;

while before I was not adding internet permission and the app worked perfectly

(contacting API and everything), since the update I have to explicitly modify the manifest.

Easy fix actually:

manifest xmlns:android="http://schemas.android.com/apk/res/android" 

package="com.xxx.xxx"> <uses-permission

 android:name="android.permission.INTERNET"/> <application

 android:name="io.flutter.app.FlutterApplication" android:label="xxx"

 android:icon="@mipmap/ic_launcher"> <activity android:name=".MainActivity"

 [...]

if you are too experiencing the same unexpected changes of behavior in your app.

This might be the cause.

Thank you for your attention.


[update 19/3/2019]: Facebook user "Momo Roro" described a similar behavior of its own app

asserting that it was caused by the inability of the app

to contact the API, it actually matches my situation,

in fact right after the splash screen my stream should receive

data from an API and route to a specific screen accordingly.

Any idea why it works in debug and not in release build?


I'm iterating an app I'm working on from a while;

I had several release version,

but after updating to flutter (I curse myself every day for that)

the app works perfectly in debug, but freeze in release build

(although it loads the 'homemade' splash screen)

no errors in compile time,

flutter doctor says ok,

I've pin my dependencies and added this to prevent androidX issues

rootProject.allprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'androidx.core') {
                details.useVersion "1.0.1"
            }
            if (details.requested.group == 'androidx.lifecycle') {
                details.useVersion "2.0.0"
            }
            if (details.requested.group == 'androidx.versionedparcelable') {
                details.useVersion "1.0.0"
            }
        }
    }
}

I've tried: flutter clean,

flutter build apk --target-platform=android-arm64,

flutter build --release... nothing works

I opened an issue on github, but I would appreciate if you could point me in the right direction

here you can find some logs

thanks in advance


回答1:


final update:

now everything works;

while before I was not adding internet permission and the app worked perfectly

(contacting API and everything), since the update I have to explicitly modify the manifest.

Easy fix actually:

manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.xxx.xxx">

android:name="android.permission.INTERNET"/>

android:name="io.flutter.app.FlutterApplication" android:label="xxx"

android:icon="@mipmap/ic_launcher">

[...] if you are too experiencing the same unexpected changes of behavior in your app.

This might be the cause.

Thank you for your attention.



来源:https://stackoverflow.com/questions/55223002/flutter-app-freeze-in-build-release-work-properly-in-debug-androidx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!