Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.196.215] failed: Connection time

 

仓库服务

上面有各个包的指示,可以加上相应的

* What went wrong:
Execution failed for task ':flutter:javaPreCompileDebug'.
> Could not resolve all files for configuration ':flutter:debugCompileClasspath'.
   > Could not find io.flutter:flutter_embedding_debug:1.0.0-5b952f286fc070e99cf192775fa5c9dfe858b692.
     Required by:
         project :flutter
   > Could not find io.flutter:arm64_v8a_debug:1.0.0-5b952f286fc070e99cf192775fa5c9dfe858b692.
     Required by:
         project :flutter
   > Could not find io.flutter:x86_debug:1.0.0-5b952f286fc070e99cf192775fa5c9dfe858b692.
     Required by:
         project :flutter
   > Could not find io.flutter:x86_64_debug:1.0.0-5b952f286fc070e99cf192775fa5c9dfe858b692.
     Required by:
         project :flutter

解决方式,在Flutter安装位置C:\flutter\packages\flutter_tools\gradle,flutter.gradle中修改添加如下内容。


buildscript {
    repositories {

        //google()
        mavenCentral()
        google()
        maven { url 'http://download.flutter.io' }

maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }//可以查看下错误提示和阿里云,缺哪个,就补充哪个
        maven { url 'https://maven.aliyun.com/repository/google'}
        maven { url 'https://maven.aliyun.com/repository/jcenter'}
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public'}
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'http://download.flutter.io' }
        maven { url 'https://maven.aliyun.com/repository/google'}
        maven { url 'https://maven.aliyun.com/repository/jcenter'}
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public'}
    }
}


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':package_info_plus:generateDebugRFile'.
> Could not resolve all files for configuration ':package_info_plus:debugCompileClasspath'.
   > Did not resolve 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2' which is part of the dependency lock state
   > Did not resolve 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.30' which is part of the dependency lock state
   > Did not resolve 'androidx.window:window:1.0.0-beta03' which is part of the dependency lock state
   > Did not resolve 'androidx.window:window-java:1.0.0-beta03' which is part of the dependency lock state
   > Did not resolve 'org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31' which is part of the dependency lock state
   > Did not resolve 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31' which is part of the dependency lock state
   > Did not resolve 'org.jetbrains:annotations:13.0' which is part of the dependency lock state
   > Did not resolve 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.30' which is part of the dependency lock state
   > Did not resolve 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2' which is part of the dependency lock state
   > Did not resolve 'org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.2' which is part of the dependency lock state

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

在build.grade中注释掉

/*

    dependencyLocking {

        ignoredDependencies.add('io.flutter:*')

        lockFile = file("${rootProject.projectDir}/project-${project.name}.lockfile")

        if (!project.hasProperty('local-engine-repo')) {

            lockAllConfigurations()

        }

    }*/

从网上下载别人的FLutter 工程 ,有时会出现类似下列的错误,解决方式为删除掉android文件夹,再重新生成一次就好了,这个是由于Java 的版本不一致造成的。

������ (1.8.0-adoptopenjdk) �г����쳣��������� Bug Database (http://bugs.java.com) ��û���ҵ��ô���, ��ͨ�� Java Bug ����ҳ (http://bugreport.java.com) ������ Java ������ Bug�����ڱ����и������ij�������������Ϣ��лл��
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)
    at com.sun.tools.javac.util.Assert.error(Assert.java:133)

/

[form_app] flutter pub get

Running "flutter pub get" in form_app...                        

Because json_serializable >=4.0.0 <4.0.1 depends on analyzer ^0.41.2 and json_serializable ^4.0.1 depends on analyzer >=0.41.2 <2.0.0, json_serializable ^4.0.0 requires analyzer >=0.41.2 <2.0.0.

And because mockito >=5.0.16 depends on analyzer ^2.1.0, mockito >=5.0.16 is incompatible with json_serializable ^4.0.0.

So, because form_app depends on both mockito ^5.0.16 and json_serializable ^4.0.0, version solving failed.

pub get failed (1; So, because form_app depends on both mockito ^5.0.16 and json_serializable ^4.0.0, version solving failed.)

exit code 1

--

[form_app] flutter pub get

Running "flutter pub get" in form_app...                        

Because json_serializable >=4.0.0 <4.0.1 depends on analyzer ^0.41.2 and json_serializable ^4.0.1 depends on analyzer >=0.41.2 <2.0.0, json_serializable ^4.0.0 requires analyzer >=0.41.2 <2.0.0.

And because mockito >=5.0.16 depends on analyzer ^2.1.0, mockito >=5.0.16 is incompatible with json_serializable ^4.0.0.

So, because form_app depends on both mockito ^5.0.16 and json_serializable ^4.0.0, version solving failed.

pub get failed (1; So, because form_app depends on both mockito ^5.0.16 and json_serializable ^4.0.0, version solving failed.)

exit code 1

你可能感兴趣的:(flutter,maven,android)