Flutter应用程序冻结在构建版本中,可以在androidX调试中正常工作吗? [英] Flutter app freeze in build release, work properly in debug, androidX?

查看:79
本文介绍了Flutter应用程序冻结在构建版本中,可以在androidX调试中正常工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最终更新:

现在一切正常;

在我没有添加互联网许可之前,该应用程序运行正常

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

(联系API和所有内容),由于更新,我必须显式修改清单.

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

实际上很容易解决:

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.

这可能是原因.

感谢您的关注.

[更新19/3/2019]: Facebook用户"Momo Roro"描述了其自己的应用程序的类似行为

[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

联系API,它实际上符合我的情况,

to contact the API, it actually matches my situation,

实际上,在启动屏幕之后,我的信息流应该会收到

in fact right after the splash screen my stream should receive

来自API的数据,并相应地路由到特定屏幕.

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;

我有几个发行版本,

但是在更新为颤动之后 (为此,我每天都诅咒自己)

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)

编译时没有错误

颤抖的医生说好,

我已经固定了依赖项并将其添加到 防止androidX问题

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"
            }
        }
    }
}

我尝试过:飘动干净,

flutter构建apk --target-platform = android-arm64,

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

flutter build --release ...没有任何作用

flutter build --release... nothing works

我在 github 上打开了一个问题,但是 如果您能指出正确的方向,我将不胜感激

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

预先感谢

推荐答案

最终更新:

现在一切正常;

在我没有添加互联网许可之前,该应用程序运行正常

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

(联系API和所有工具),由于更新,我必须显式修改清单.

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

实际上很容易解决:

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

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"

package="com.xxx.xxx">

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

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

android:icon ="@ mipmap/ic_launcher">

[...] 如果您在应用程序中也遇到了相同的意外行为更改.

android:icon="@mipmap/ic_launcher">

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

这可能是原因.

感谢您的关注.

这篇关于Flutter应用程序冻结在构建版本中,可以在androidX调试中正常工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆