美文网首页
Flutter安卓模拟器运行报错

Flutter安卓模拟器运行报错

作者: 伊路顺峰 | 来源:发表于2021-08-12 19:34 被阅读0次

    FAILURE: Build failed with an exception.

    • What went wrong:
      Could not determine the dependencies of task ':weibo_kit:compileVendorDebugAidl'.

    Could not resolve all task dependencies for configuration ':weibo_kit:vendorDebugCompileClasspath'.
    Could not resolve com.sina.weibo.sdk:core:9.12.0.
    Required by:
    project :weibo_kit
    Could not resolve com.sina.weibo.sdk:core:9.12.0.
    Could not get resource 'https://google.bintray.com/exoplayer/com/sina/weibo/sdk/core/9.12.0/core-9.12.0.pom'.
    Could not GET 'https://google.bintray.com/exoplayer/com/sina/weibo/sdk/core/9.12.0/core-9.12.0.pom'. Received status code 403 from server: Forbidden

    • 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 1m 46s
    Exception: Gradle task assembleDebug failed with exit code 1
    如果你像我一样按照下面的方法,更改了镜像仍然报错,那么可以按我的方法试试方法3,报错的库文件可能不一样,但是解决方案大概类似。
    解决方案1、
    链接

    解决方案2、
    链接

    解决方案3、
    由于我这里是用到了微博分享,所以我去GitHub上看了看有没有其他小伙伴遇到同样的问题,刚好有人遇到跟我一样的问题,并且有解决方案:就是使用git url 链接,问题地址,但是很不幸,我们的项目使用的是Flutter2.0 以下的版本,使用git url 这种方式,下载的weibo_kit是最新的包,出现版本兼容问题,只能继续找其他方法,这个issues 里面还提到一种解决方案,就是使用maven本地包,具体方法如下:
    (1)、首先在pub.dev 搜索weibo_kit 下载我们项目正在使用的版本

    image.png
    下载完成把它放到项目中
    image.png

    (2)、把pubspec.yaml 中weibo_kit 引用方式改为本地文件


    image.png

    这个时候运行一下项目,如果可以运行那就搞定,不用看下面了,如果运行还是报错,那么继续往下看吧。
    (3)、在gitHub 上把weibo_kit整个项目clone 下来,解压打开文件,把这个文件中android文件中libs文件夹拷贝到刚才项目中pub/weibo_kit-1.1.0/android 文件夹中,


    image.png
    image.png
    然后参照第二次下载的文件中的
    image.png image.png
    image.png

    到此就配置完了,我的项目就可以运行了,希望对你有帮助。

    相关文章

      网友评论

          本文标题:Flutter安卓模拟器运行报错

          本文链接:https://www.haomeiwen.com/subject/gqvkbltx.html