gpt4 book ai didi

gradle - flutter 不安全的未检查操作并覆盖已弃用的 api 错误

转载 作者:行者123 更新时间:2023-12-03 02:45:46 27 4
gpt4 key购买 nike

我收到以下错误:

Note: /Users/D/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.13.4/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/D/flutter/.pub-cache/hosted/pub.dartlang.org/share-0.6.3+6/android/src/main/java/io/flutter/plugins/share/SharePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/D/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/D/flutter/.pub-cache/hosted/pub.dartlang.org/square_in_app_payments-1.3.0/android/src/main/java/sqip/flutter/internal/CardEntryModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
解决此问题的步骤:
更新了以下依赖项:
cupertino_icons: ^0.1.3
firebase_core: ^0.4.4+2
firebase_auth: ^0.15.5+2
google_sign_in: ^4.1.4
image_picker: ^0.6.3+4
cloud_firestore: ^0.13.4
percent_indicator: ^2.1.1+1
uuid: ^2.0.4
share: ^0.6.3+6
path_provider: ^1.6.5
barcode_scan: ^2.0.1
intl: ^0.16.1
square_in_app_payments: ^1.3.0
http: ^0.12.0+4
firebase_storage: ^3.1.3
firebase_crashlytics: ^0.1.3
firebase_dynamic_links: ^0.5.0+11
将 gradle 文件更新为:
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'io.fabric.tools:gradle:1.31.0'
}
还将成绩包装器更改为 gradle-6.0.1-all.zip。
但没有运气。我花了一整天的时间来解决这个问题,但已经没有选择了。任何人都可以帮忙吗?
我的应用程序/Gradle 文件:
    def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
// throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
throw new FileNotFoundException ("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0.0'
}


apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
compileSdkVersion 29
lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "my application package name"
minSdkVersion 21
targetSdkVersion 29
versionCode 18 //flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
multiDexKeepFile file('multidex-config.txt')
minifyEnabled true // - true done
useProguard false // - true done

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'


}
}
}

flutter {
source '../..'
}

dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

}

apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'

最佳答案

套装multiDexEnabledtrue在您的 project/android/app/build.gradle文件。

defaultConfig {
......
multiDexEnabled true
}

关于gradle - flutter 不安全的未检查操作并覆盖已弃用的 api 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60566241/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com