当前位置: 首页 > article >正文

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

http://www.kler.cn/news/336340.html

相关文章:

  • 网络层常用互联网协议
  • (15)衰落信道模型作用于信号是相乘还是卷积
  • Electron桌面应用打包现有的vue项目
  • 如何使用ssm实现基于Java的校园二手物品交易平台的设计与实现+vue
  • 【含开题报告+文档+PPT+源码】基于SpringBoot的校园互助平台设计与实现【包运行成功】
  • 多因素身份验证技术的原理及实现方式
  • node.js版本管理工具--nvm安装教程及配置(windows)
  • 【PostgreSQL】PG数据库表“膨胀”粗浅学习
  • UE4完整教程 UE4简介 UE4学习攻略及文件格式
  • ubuntu18.04 设置静态ip 00-installer-config.yaml
  • Leetcode - 140双周赛
  • 高轨SAR GESS系统1(CSDN_20241006)
  • 15分钟学 Python 第38天 :Python 爬虫入门(四)
  • AJAX 3——原理:XMLHttpRequest+Promise
  • 108页PPT丨OGSM战略规划框架:实现企业目标的系统化方法论
  • Redis入门第一步:认识Redis与快速安装配置
  • LeetCode 347.前 K 个高频元素
  • rknn实现yolo5目标检测
  • Java中如何实现定时任务?
  • 大模型书籍强烈安利:《掌握NLP:从基础到大语言模型》(附PDF)