android - Flutter: 任务 ':agora_rtc_engine:compileDebugKotlin' 执行失败

我正在做一个旧项目。它在 5 天前运行良好。现在我正面临agora 的错误。我之前的代码没有任何改变。这是错误-

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':agora_rtc_engine:compileDebugKotlin'.
> Could not resolve all files for configuration ':agora_rtc_engine:debugCompileClasspath'.
   > Could not find native-full-sdk-3.4.6.jar (com.github.agorabuilder:native-full-sdk:3.4.6).
     Searched in the following locations:
         https://www.jitpack.io/com/github/agorabuilder/native-full-sdk/3.4.6/native-full-sdk-3.4.6.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 38s
Running Gradle task 'assembleDebug'...                             40.0s
Exception: Gradle task assembleDebug failed with exit code 1

我使用 agora_rtc_engine: ^3.3.1 是因为这个项目在没有零安全性的情况下开发(可能是 flutter 1.5)。我怎么解决这个问题 ?

回答1

1.在终端运行flutter upgrade升级Flutter

2.Run dart migrate 运行dart迁移工具

3.解决迁移工具显示的所有错误

4.运行 flutter pub outdated --mode=null-safety 打印所有过时的包

5.运行 flutter pub upgrade --null-safety 自动升级所有包

6.检查代码是否有错误并解决

7.再次运行dart migrate,现在应该成功了。按照链接检查建议的更改

8.按“应用迁移”按钮

9.再次检查代码是否有错误并修复它们。

运行 flutter 在命令行中运行,应用程序应该运行...

注意:如果您的项目中有任何不支持空安全的库,您必须升级该库。如果该库没有空安全性,请删除该库并使用另一个库

回答2

所以你必须先将你的项目迁移到 null-safety 然后得到

agora_rtc_engine: ^4.2.2

然后你到你的 build.gradle 并添加最后一行

allprojects {
       repositories {
         google()
         jcenter()
    // add this line.
         maven { url ‘https://www.jitpack.io' }
        }
    }

因为在 https://github.com/AgoraIO/Agora-Flutter-SDK/issues/650#issuecomment-1113503053 上关注这个问题,所以没有解决方案,因为这个问题已经在 agora 项目中关闭。

相似文章

随机推荐

最新文章