Why exception may occurs?
See original GitHub issueGradle console output is below
21:15:39.548 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 21:15:39.548 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 21:15:39.548 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 21:15:39.548 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Where: 21:15:39.548 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Build file ‘/Users/d.samaryan/Documents/Adroid Samples/ktlint/Kotlindetect/app/build.gradle’ line: 40 21:15:39.548 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 21:15:39.548 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong: 21:15:39.549 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] A problem occurred evaluating project ‘:app’. 21:15:39.549 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > java.lang.reflect.InvocationTargetException (no error message) 21:15:39.549 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 21:15:39.549 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try: 21:15:39.549 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
- What went wrong: A problem occurred evaluating project ‘:app’.
java.lang.reflect.InvocationTargetException (no error message)
In my build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'io.gitlab.arturbosch.detekt'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.kotlindetect"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
repositories {
mavenCentral()
}
detekt {
version = "1.0.0.M12.3" // Specify current detekt version
input = "$projectDir/src/main/java" // input is preconfigured to 'project.projectDir.absolutePath'
config = "$projectDir/detekt.yml" // Use $project.projectDir to navigate inside your project
filters = ".*test.*, .*/resources/.*" // What paths to exclude? Use comma oder semicolon to separate
}
Hope for your help, thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (7 by maintainers)
Top GitHub Comments
More generally, quoting the project API docs:
I found my mistake: in the detekt clojure I set a wrong path to the project:
And now plugin actually worked! Thank you so much for help in solving the problem and for your plugin!