Android Studio一直在download - 修改Gradle使用国内源 - 阿里云Maven镜像仓库地址 - 报错platform ‘android-30‘ not found.

修改Project模式下的/build.gradle 换源

Android Studio一直在download - 修改Gradle使用国内源 - 阿里云Maven镜像仓库地址 - 报错platform ‘android-30‘ not found._第1张图片

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        maven { url 'https://plugins.gradle.org/m2/' }
        maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
        maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
//        google()
//        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url 'https://plugins.gradle.org/m2/' }
        maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
        maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
//        google()
//        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

关掉AS再打开,飞起!

报错

Module: 'simpleDemo' platform 'android-30' not found.

解决办法:

修改\simpleDemo\build.gradle,从

compileSdkVersion 30

compileSdkVersion 33

保存,重启即可.

没有android33? 点这看:

Android Studio一直在download - 修改Gradle使用国内源 - 阿里云Maven镜像仓库地址 - 报错platform ‘android-30‘ not found._第2张图片

怎么下载更多的android版本? 。。。。 没有爬墙的梯子,就别想了。。。。

你可能感兴趣的:(Web前端,开发,android,gradle,离线打包,uniapp)