颤音:Android仪器测试 - 如何向Gradlew命令提供无声性的安全论点

发布于 2025-01-23 11:10:57 字数 510 浏览 4 评论 0原文

在使用flutter应用程序的集成测试(当前处于迁移阶段以确保声音安全性)时,gradlew应用程序:assembledlebug -ptarget =< path_to_to_test> .dart命令命令失败了

错误:默认情况下,库默认情况下不能退出无效安全性 声音无效。

根据 flutter reposority frof Flutter Repository ,需要此步骤才能生成一个可以在以后将其上传到Firebase测试实验室的测试APK。

有没有办法将传递给gradlew命令?

While working with integration tests for a flutter app (which is currently in migration stage to sound null safety), the gradlew app:assembleDebug -Ptarget=<path_to_test>.dart command failed with an error

Error: A library can't opt out of null safety by default, when using
sound null safety.

As per the documentation from flutter repository , this step is required to generate a test apk that can be later uploaded to firebase test lab.

Is there a way to pass --no-sound-null-safety argument to the gradlew command?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自由如风 2025-01-30 11:10:57

当前,没有办法将传递 - 无弹药安全参数 gradlew 命令,因为这是一个扑朔迷离的功能。

解决方法是使应用程序文件的入口点使用DART 2.9,即无效安全类型。

// @dart=2.9

void main(){
    
}

在进行集成测试的main()输入文件时,gradlew命令能够在没有任何其他命令的情况下组装应用程序。

Currently there is no way to pass the --no-sound-null-safety argument to the gradlew command as this is a flutter feature.

The workaround was to make the entry point of the app file use dart 2.9 which is non null safety type.

// @dart=2.9

void main(){
    
}

On making the main() entry file for the integration test, the gradlew command was able to assemble the app without any additional commands.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文