Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter build apk 报错 #22

Open
mengsiyitiaojie opened this issue Mar 18, 2020 · 2 comments
Open

flutter build apk 报错 #22

mengsiyitiaojie opened this issue Mar 18, 2020 · 2 comments

Comments

@mengsiyitiaojie
Copy link

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'dim'.

Could not resolve all files for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:3.1.2.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.1.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.pom'.
> Could not HEAD 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.pom'.
> Connect to 127.0.0.1:12759 [/127.0.0.1] failed: Connection refused (Connection refused)
> Could not resolve com.android.tools.build:gradle:3.1.2.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.pom'.
> Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.pom'.
> Connect to 127.0.0.1:12759 [/127.0.0.1] failed: Connection refused (Connection refused)

  • 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 0s

The plugin dim could not be built due to the issue above.

@fangmd
Copy link

fangmd commented Apr 3, 2020

网络问题吧

@InTheClodus
Copy link

InTheClodus commented Jul 28, 2020

我今天打包也遇到了这个问题我是这么解决的:

打开 External Libraries-->Flutter Plugins-->dim-0.2.8-->android-->gradle.wrapper-->打开 gradle-wrapper.properties文件,将 distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip修改为 distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
然后在打开 ..-->android-->build.gradle文件将

compileSdkVersion 27
    defaultConfig {
        minSdkVersion 16
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

修改为

compileSdkVersion 30
 defaultConfig {
        minSdkVersion 19
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

我通过这个方式修改源文件就可以编译正常,如果你还在用,希望可以帮到你

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants