簡體   English   中英

Flutter 任務“:android_intent:compileDebugJavaWithJavac”執行失敗

[英]Flutter Execution failed for task ':android_intent:compileDebugJavaWithJavac'

我正在嘗試構建該應用程序,但它一直因上述錯誤而失敗。

我已經嘗試過使用不同的 gradle 版本,即 5.6.4、6.3、6.5、6.8,但對我沒有用,並且因同樣的錯誤而失敗。

distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip。

我嘗試將 minSdkVersion 更改為 21 和 23 但同樣的錯誤。

我的jdk版本是15.0.1

安慰:

Parameter format not correct -
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
error: warnings found and -Werror specified

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':android_intent:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 23s
Exception: Gradle task assembleDebug failed with exit code 1

build.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.")
}

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

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

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

def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
    compileSdkVersion 29

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

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

    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        }
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
//            signingConfig signingConfigs.debug
            signingConfig signingConfigs.release
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.google.firebase:firebase-messaging:20.1.3'
    implementation 'androidx.annotation:annotation:1.1.0'
    implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
//    implementation "androidx.multidex:multidex:2.0.1"
    implementation 'com.android.support:multidex:2.0.1' //enter the latest version
}

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

gradle-wrapper.properties。

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip

pubspec.yaml 文件

https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.6.0

environment:
  sdk: ">=2.2.2 <3.0.0"
module:
  androidX: true
dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: 0.1.2
  google_maps_flutter: 0.5.29
  google_map_location_picker: 3.3.3
  mvc_pattern: 6.1.3+2
  global_configuration: 1.5.0
  http: 0.12.2
  html: 0.14.0+3
  shared_preferences: 0.5.8
  flutter_html: 1.0.2
  flutter_svg: 0.18.0
  location: 3.0.2
  flutter_inappbrowser: 2.0.2
  url_launcher: 5.5.0
  firebase_messaging: 6.0.16
  cached_network_image: 2.2.0+1
  fluttertoast: ^7.1.1
  flutter_staggered_grid_view: 0.3.2
  intl_utils: 1.6.3

dev_dependencies:
  flutter_test:
    sdk: flutter

如果它給您錯誤,請不要在 flutter 中使用意圖,而是在本機 java 或 kotlin 中使用它,並使用方法0ACBC4CB70DDAEBB07B1 在 Z5ACEBC4CB70DDAEBB07B1 中調用本機方法

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM