[英]debugging the build.gradle file
Building in windows powershell . 在Windows PowerShell中构建。 Already tried
java version 8
and gradle update 已经尝试过
java version 8
和Gradle更新
./gradlew build.gradle Support for running Gradle using Java 7 has been deprecated and is scheduled to be removed in Gradle 5.0. ./gradlew build.gradle已弃用使用Java 7运行Gradle的支持,并计划在Gradle 5.0中删除。 Please see https://docs.gradle.org/4.4/userguide/java_plugin.html#sec:java_cross_compilation for more details.
有关更多详细信息,请参见https://docs.gradle.org/4.4/userguide/java_plugin.html#sec:java_cross_compilation 。
FAILURE: Build failed with an exception. 失败:构建失败,发生异常。
Where: Build file 'C:\\ProjectChaayos\\KettleAndroid\\assembly\\build.gradle' line: 10 其中:构建文件'C:\\ ProjectChaayos \\ KettleAndroid \\ assembly \\ build.gradle'行:10
What went wrong: A problem occurred evaluating project ':assembly'. 出了什么问题:评估项目':assembly'时发生问题。
java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
java.lang.UnsupportedClassVersionError:com / android / build / gradle / AppPlugin:不支持的major.minor版本52.0
Try: Run with --stacktrace option to get the stack trace. 尝试:使用--stacktrace选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.
使用--info或--debug选项运行以获取更多日志输出。 Run with --scan to get full insights.
与--scan一起运行以获取完整的见解。
Get more help at https://help.gradle.org 在https://help.gradle.org上获得更多帮助
Below is the build.gradle file on which error is shown in console ie 下面是build.gradle文件,在控制台上显示错误,即
assembly/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'
}
As you can see error thrown on line 10 如您所见,第10行抛出了错误
:apply plugin'com.android.application'
gradle-wrapper.properties:-
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
It doesn't look like you're referencing gradle in the build.gradle file 看起来您没有在build.gradle文件中引用gradle
I would expect to see the dependency listed like 我希望看到列出的依赖项
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
with the appropriate gradle version 带有适当的gradle版本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.