gpt4 book ai didi

android - 调试build.gradle文件

转载 作者:行者123 更新时间:2023-12-03 04:21:41 24 4
gpt4 key购买 nike

在Windows PowerShell中构建。已经尝试过java version 8和gradle更新

./gradlew build.gradle
使用Java 7运行Gradle的支持已被弃用,并计划在Gradle 5.0中删除。有关更多详细信息,请参见https://docs.gradle.org/4.4/userguide/java_plugin.html#sec:java_cross_compilation

失败:构建失败,发生异常。

  • 其中:
    构建文件'C:\ ProjectChaayos \ KettleAndroid \ assembly \ build.gradle'行:10
  • 出了什么问题:
    评估项目':assembly'时发生问题。

    java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0

  • 尝试:
    使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行,以获取更多日志输出。与--scan一起运行以获取完整的见解。
  • https://help.gradle.org上获得更多帮助

  • 以下是build.gradle文件,在控制台上显示错误,即

    assembly/build.gradle


             buildscript {
    repositories {
    maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
    }
    }
    apply plugin: 'com.android.application'
    apply plugin: 'io.fabric'

    repositories {
    maven { url 'https://maven.fabric.io/public' }
    maven {
    url "http://dl.bintray.com/glomadrian/maven"
    }
    maven {

    url "https://repo.eclipse.org/content/repositories/paho-releases/"
    }

    google()
    }


    android {
    compileSdkVersion project.ext.compileSdkVersion
    lintOptions {
    disable 'MissingTranslation'
    }
    /*splits {
    abi {
    enable true
    reset()
    include 'x86', 'armeabi-v7a'
    universalApk true
    }
    }*/

    dataBinding {
    enabled = true
    }
    packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'
    }

    defaultConfig {
    applicationId "kettle.android_phase3"
    minSdkVersion project.ext.minSdkVersion
    targetSdkVersion project.ext.targetSdkVersion
    versionCode 4
    versionName "1.0"
    multiDexEnabled true
    vectorDrawables.useSupportLibrary = true

    }
    buildTypes {
    release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    resValue "string", "app_name", "Assembly screen v2 app"

    }
    debug {
    debuggable true
    applicationIdSuffix '.debug'
    versionNameSuffix '-DEBUG'
    resValue "string", "app_name", "Assembly screen app v2 debug"
    }
    }
    lintOptions {
    abortOnError false
    }
    compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    }
    buildToolsVersion project.ext.buildToolsVersion

    }

    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':common')
    compile project(':printer')
    compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') {
    transitive = true;
    }
    compile 'testfairy:testfairy-android-sdk:1.+@aar'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile('io.socket:socket.io-client:0.8.3') {
    // excluding org.json which is provided by Android
    exclude group: 'org.json', module: 'json'
    }
    compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
    compile 'pub.devrel:easypermissions:1.1.3'
    }

    如您所见,第10行抛出了错误
    :apply plugin'com.android.application'

    gradle-wrapper.properties:-


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

    最佳答案

    看起来您不是在build.gradle文件中引用gradle

    我希望看到列出的依赖项

    buildscript {
    repositories {
    jcenter()
    }

    dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    }
    }

    带有适当的gradle版本

    关于android - 调试build.gradle文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50113340/

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