美文网首页
flutter的安卓项目sync下载jar包总是失败解决办法

flutter的安卓项目sync下载jar包总是失败解决办法

作者: xmb | 来源:发表于2020-08-20 09:36 被阅读0次

    问题:

    A problem occurred configuring root project 'android'.
    > Could not resolve all artifacts for configuration ':classpath'.
       > Could not download protobuf-java.jar (com.google.protobuf:protobuf-java:3.4.0)
          > Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.4.0/protobuf-java-3.4.0.jar'.
             > Could not GET 'https://d29vzk4ow07wi7.cloudfront.net/dce7e66b32456a1b1198da0caff3a8acb71548658391e798c79369241e6490a4?response-content-disposition=attachment%3Bfilename%3D%22protobuf-java-3.4.0.jar%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHAqOi8vZDI5dnprNG93MDd3aTcuY2xvdWRmcm9udC5uZXQvZGNlN2U2NmIzMjQ1NmExYjExOThkYTBjYWZmM2E4YWNiNzE1NDg2NTgzOTFlNzk4Yzc5MzY5MjQxZTY0OTBhND9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPWF0dGFjaG1lbnQlM0JmaWxlbmFtZSUzRCUyMnByb3RvYnVmLWphdmEtMy40LjAuamFyJTIyIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNTk3ODAyMTQ3fSwiSXBBZGRyZXNzIjp7IkFXUzpTb3VyY2VJcCI6IjAuMC4wLjAvMCJ9fX1dfQ__&Signature=bSKzS8bfmkjRogNAH5fWAk9jHxEYJmZCe0WEGUdh-G0YjQmT3yJ-REX2w9ryj3pLPi6aPnE6NioDzY0Bg7UF43AYv5l5Nz0neiz4tilUIIV1mZOOhcoxv9k~UYasG1UQMFEyKxZYXV~yDo9KweyoaP4Lqn-aJR6mYde--4ZZBOJHRx79dviQTdkYm7DPFkfls~Qv7S44Qmin04osgzEMfKRo-ZtiQ3OD2~Se1PJcXyxbRFz6f43MoaPL90iYtf7P3xbM~f2tPfx~cZkBJ8-2xZD7p62K~ff9AyAsj0iJXQf970AvDslDK-aRQp0QSi2kT1ylk4BpNg7P9RGv6bl4iQ__&Key-Pair-Id=APKAIFKFWOMXM2UMTSFA'.
                > Received close_notify during handshake
       > Could not download fastutil.jar (it.unimi.dsi:fastutil:7.2.0)
          > Could not get resource 'https://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar'.
             > Could not GET 'https://d29vzk4ow07wi7.cloudfront.net/74fa208043740642f7e6eb09faba15965218ad2f50ce3020efb100136e4b591c?response-content-disposition=attachment%3Bfilename%3D%22fastutil-7.2.0.jar%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHAqOi8vZDI5dnprNG93MDd3aTcuY2xvdWRmcm9udC5uZXQvNzRmYTIwODA0Mzc0MDY0MmY3ZTZlYjA5ZmFiYTE1OTY1MjE4YWQyZjUwY2UzMDIwZWZiMTAwMTM2ZTRiNTkxYz9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPWF0dGFjaG1lbnQlM0JmaWxlbmFtZSUzRCUyMmZhc3R1dGlsLTcuMi4wLmphciUyMiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTU5NzgwMjA5MH0sIklwQWRkcmVzcyI6eyJBV1M6U291cmNlSXAiOiIwLjAuMC4wLzAifX19XX0_&Signature=a1ynvL5ufYZAbDowbSc1J2dFsgtB0tsCNQDzbtuUjDOn3JrsOdXIrci28v9xCRgg-HxsU5v6PwhUSaVJF26bsg177YF7CmKFvHTjAuPgHx7d6i8M1yAHYqN6OWbKwiGcPoTkAnPMZiby4eGLh64BGtX~cTYewi-C7DZvwKT1BxGbU6GVuBBm8~wLmhh3yWWiN-aWCrX2r7qN3qVwLGnqqHgDu~GyWG2tvCNn~bpMo1ApeaBcUr9CaryEefEcFVQRZPcUELhkurU9j8vuPsvnvgTZnXc3kQlEl3rGxTE2WcNYn7-OmcApTQ7RzjyAHqzh2Qn-gBoRP26Sras2qG6wIA__&Key-Pair-Id=APKAIFKFWOMXM2UMTSFA'.
                > Read timed out
    

    解决方法:
    1、进入flutter的目录,找到~/Library/flutter/packages/flutter_tools/gradle/flutter.gradle文件

    WX20200819-101127@2x.png
    2、添加mavenCentral()到如下位置
    WX20200819-101152@2x.png
    3、重新sync安卓项目,即可快速下载

    参考文章:https://www.cnblogs.com/floor/p/11791705.html

    相关文章

      网友评论

          本文标题:flutter的安卓项目sync下载jar包总是失败解决办法

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