gradle 生成构建版本后,Flutter应用程序崩溃且未打开

6ovsh4lw  于 2023-02-23  发布在  Flutter
关注(0)|答案(1)|浏览(178)

在android studio发布模式下生成构建后,会收到以下警告

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-1.6.0\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_ml_vision-0.9.3+5\android\src\main\java\io\flutter\plugins\firebasemlvision\FirebaseMlVisionPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.6+1\android\src\main\java\io\flutter\plugins\sharedpreferences\SharedPreferencesPlugin.java:25: warning: [deprecation] getFlutterEngine()
 in FlutterPluginBinding has been deprecated
    setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext());
                        ^
1 warning
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

并使用生成APK

flutter build apk --release

并成功安装它,当尝试打开应用程序崩溃,不打开,这里的日志和警告,而生成构建:

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-1.6.0\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-6.0.9\android\src\main\java\io\flutter\plugins\firebasemessaging\FirebaseMessagingPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_ml_vision-0.9.3+5\android\src\main\java\io\flutter\plugins\firebasemlvision\FirebaseMlVisionPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.6+1\android\src\main\java\io\flutter\plugins\sharedpreferences\SharedPreferencesPlugin.java:25: warning: [deprecation] getFlutterEngine()
 in FlutterPluginBinding has been deprecated
    setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext());
                        ^
1 warning
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
svmlkihl

svmlkihl1#

看来,警告是一个known issue,这是来自Android本身,而不是Flutter,如下所述:
警告来自android本身。它不应该破坏你的应用程序,至少在那些被调用的方法从android本身删除之前。记住,仅仅因为软件包是最新版本并不意味着它们在本机端是最新的。在可预见的未来,这应该不会影响你的应用程序,但如果它困扰你,文件问题与适当的repo。虽然,我想插件的作者应该意识到这一点,并将最有可能的工作。因为这实际上不是一个问题与flutter,我将关闭。

相关问题