Flutter---适配高版本studio运行里面的Android项目报错

1. 总是出现错误 可以添加以下命令

在app/build.gradle 里面添加




android {
    namespace = "com.example.untitled"
    compileSdk = flutter.compileSdkVersion
    ndkVersion = flutter.ndkVersion


    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
    }
}

dependencies {
    implementation 'com.google.code.findbugs:jsr305:3.0.2' // 保持这个依赖,确保项目所需
    implementation 'androidx.annotation:annotation-experimental:1.4.1'


}

在根目录里面的build.gradle

allprojects {
    repositories {
        google()
        mavenCentral() {
            metadataSources {
                mavenPom()
                artifact()
            }
        }
        maven {
            url 'https://maven.aliyun.com/repository/central'
            metadataSources {
                mavenPom()
                artifact()
            }
        }
        maven {
            url 'https://mirrors.tuna.tsinghua.edu.cn/maven2/'
            metadataSources {
                mavenPom()
                artifact()
            }
        }
    }
}

setting.gradle


plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "8.0.2" apply false
    id "org.jetbrains.kotlin.android" version "1.8.20" apply false
}

gradle-wrapper

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值