【问题标题】:Unable to build an apk in flutter无法在颤振中构建apk
【发布时间】:2021-10-15 11:43:30
【问题描述】:

我正在尝试从我的颤振项目中构建一个 api,上个月我在做 flutter build apk 时很好,但现在不行......我无法做到,这是错误日志

FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:releaseCompileClasspath'.
   > Could not resolve com.google.android.gms:play-services-location:16.+.
     Required by:                                                       
         project :app > project :location                               
      > Failed to list versions for com.google.android.gms:play-services-location.
         > Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml.
            > Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'.
               > Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'. 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 33s                                                     
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      34.3s
Gradle task assembleRelease failed with exit code 1

这是我的 android/build.gradle:https://gist.github.com/wahyu-handayani/959de3306aa1410c1b9b78ad927cc35c

【问题讨论】:

  • 您得到 403 ..这意味着您无法在没有 VPN 的情况下访问...请使用付费 VPN 重试。 (免费的 vpn 对我不起作用)
  • 嗨@mohandesR,但至少直到上个月还好

标签: flutter build apk


【解决方案1】:

尝试将您的 gradle 包装器更新为: distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip

【讨论】:

  • 我今天试了一下,我换了 gradle wrapper 后解决了。非常感谢你的帮助
  • 很高兴来到这里!
猜你喜欢
  • 2020-10-05
  • 2020-08-25
  • 2020-12-18
  • 1970-01-01
  • 2020-12-30
  • 2022-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多