Android应用程序在首次启动后完全变白色并显示启动屏幕

ghg1uchk  于 2023-09-29  发布在  Android
关注(0)|答案(2)|浏览(140)

我已经构建了一个Flutter应用程序,它在调试时工作得非常好,但只要我构建一个apk并尝试将其安装到设备上,启动屏幕就会运行,然后屏幕完全变白色。注意:不像发布模式下显示的调试错误屏幕那样呈灰色。

e: /Users/priscilla/.gradle/caches/transforms-3/c4988ff80110f75080a936fc6f044848/transformed/core-1.10.1/jars/classes.jar!/META-INF/core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/priscilla/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation-jvm/1.6.0/a7257339a052df0f91433cf9651231bbb802b502/annotation-jvm-1.6.0.jar!/META-INF/annotation.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/priscilla/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/priscilla/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/priscilla/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/priscilla/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.22/1a8e3601703ae14bb58757ea6b2d8e8e5935a586/kotlin-stdlib-common-1.8.22.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.

我得到这个当我建立一个签署的释放apk,但建设是成功的。

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await setUpLocator();

  SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
  runApp(const MobileScaffoldApp(isDebug: false));
}

我假设问题可能是其中之一,因为其他一切都运行良好的应用程序。

mnemlml8

mnemlml81#

可能你会使用需要proguard-rules.pro文件的软件包,检查是否有效

b1payxdu

b1payxdu2#

白色是由main方法的run应用程序上的路由问题引起的。我所做的只是在配置文件模式下运行应用程序,并找到了问题的根源。它似乎只发生在发布模式,所以配置文件提供了我所有的资源来修复它。
它完全独立于Kotlin版本差异(最终影响不大)。

相关问题