qt gradle 国内镜像

1.进入文件夹C:\Users\Think.gradle

2.创建文件init.gradle输入以下内容

allprojects{
    
    
    repositories {
    
    
        def ALIYUN_REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public'
        def ALIYUN_JCENTER_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
        all {
    
     ArtifactRepository repo ->
            if(repo instanceof MavenArtifactRepository){
    
    
                def url = repo.url.toString()
                if (url.startsWith('https://repo1.maven.org/maven2')) {
    
    
                    project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL."
                    remove repo
                }
                if (url.startsWith('https://jcenter.bintray.com/')) {
    
    
                    project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL."
                    remove repo
                }
            }
        }
        maven {
    
    
            url ALIYUN_REPOSITORY_URL
            url ALIYUN_JCENTER_URL
        }
    }
}

终端执行gradle wrapper

gradle.properties文件中增加以下语句


android {
    
    
 compileOptions {
    
    
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
}

如果缺包就在gradle.properties文件里添加相应库

dependencies {
    
    
    implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
    compile 'javax.annotation:javax.annotation-api:1.3.1'
    compile 'com.google.code.findbugs:jsr305:2.0.1'
}

‘D:/1_project/andpro/build-cccc-android-Debug/android-build/gradlew.bat’ 不是内部或外部命令,也不是可运行的程序或批处理文件。

  1. 进入C:\Users\Think.gradle\wrapper\dists\gradle-5.6.1-bin\bycvpp2xqg8wbfxm5cc0t3675\gradle-5.6.1\bin文件夹
  2. 打开终端到此处
  3. 创建gradle文件夹(如果已经存在gradle文件, 就把他给删掉)
  4. 填写命令 gradle wrapper
    在这里插入图片描述

groovy.xxx不存在

在build.gradle文件添加jar文件目录

//build.gradle

dependencies {
    
    
	compile project.fileTree(dir:'D:/1_project/andpro/eeee/lib',include:['*.jar'])
}

猜你喜欢

转载自blog.csdn.net/yongwoozzang/article/details/111714508