nebula-plugins / gradle-lint-plugin

A pluggable and configurable linter tool for identifying and reporting on patterns of misuse or deprecations in Gradle scripts.
Apache License 2.0
768 stars 89 forks source link

Android - java.lang.NoClassDefFoundError: android/os/Bundle #87

Open jouino16 opened 7 years ago

jouino16 commented 7 years ago

Hi, I'm using the plugin (version 6.6.0) on my Android project. And I'm getting "java.lang.NoClassDefFoundError: android/os/Bundle" when I run "lintGradle". I Get "java.lang.NoClassDefFoundError: android/os/Bundle" when I use "com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks". Also I get "java.lang.NoClassDefFoundError: android/location/Location" when I use "com.google.android.gms.location.LocationListener". And I get "java.lang.NoClassDefFoundError: android/os/Parcelable" when I use "com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener".

My configuration is as follows, in the build.gradle of the project (not the app):

dependencies { classpath 'com.netflix.nebula:gradle-lint-plugin:latest.release' } allprojects { apply plugin: 'nebula.lint' gradleLint.rules = ['unused-dependency']//'all-dependency', 'archaic-wrapper', 'duplicate-dependency-class'] repositories { jcenter() } }

When I run ./gradlew buildEnvironment, I get:


Root project

classpath +--- com.android.tools.build:gradle:2.2.3 | --- com.android.tools.build:gradle-core:2.2.3 | +--- com.android.tools.build:builder:2.2.3 | | +--- com.android.tools.build:builder-model:2.2.3 | | | --- com.android.tools:annotations:25.2.3 | | +--- com.android.tools.build:builder-test-api:2.2.3 | | | --- com.android.tools.ddms:ddmlib:25.2.3 | | | +--- com.android.tools:common:25.2.3 | | | | +--- com.android.tools:annotations:25.2.3 | | | | --- com.google.guava:guava:18.0 | | | --- net.sf.kxml:kxml2:2.3.0 | | +--- com.android.tools:sdklib:25.2.3 | | | +--- com.android.tools.layoutlib:layoutlib-api:25.2.3 | | | | +--- com.android.tools:common:25.2.3 () | | | | +--- net.sf.kxml:kxml2:2.3.0 | | | | +--- com.android.tools:annotations:25.2.3 | | | | --- com.intellij:annotations:12.0 | | | +--- com.android.tools:dvlib:25.2.3 | | | | --- com.android.tools:common:25.2.3 () | | | +--- com.android.tools:repository:25.2.3 | | | | +--- com.android.tools:common:25.2.3 () | | | | +--- org.apache.commons:commons-compress:1.8.1 | | | | --- com.google.jimfs:jimfs:1.1 | | | | --- com.google.guava:guava:18.0 | | | +--- com.google.code.gson:gson:2.2.4 -> 2.6.2 | | | +--- org.apache.commons:commons-compress:1.8.1 | | | +--- org.apache.httpcomponents:httpclient:4.1.1 -> 4.3.6 | | | | +--- org.apache.httpcomponents:httpcore:4.3.3 | | | | +--- commons-logging:commons-logging:1.1.3 | | | | --- commons-codec:commons-codec:1.6 | | | --- org.apache.httpcomponents:httpmime:4.1 | | | +--- org.apache.httpcomponents:httpcore:4.1 -> 4.3.3 | | | --- commons-logging:commons-logging:1.1.1 -> 1.1.3 | | +--- com.android.tools:sdk-common:25.2.3 | | | +--- com.android.tools:sdklib:25.2.3 () | | | +--- com.android.tools.build:builder-test-api:2.2.3 () | | | +--- com.android.tools.build:builder-model:2.2.3 () | | | +--- org.bouncycastle:bcpkix-jdk15on:1.48 | | | | --- org.bouncycastle:bcprov-jdk15on:1.48 | | | --- org.bouncycastle:bcprov-jdk15on:1.48 | | +--- com.android.tools:common:25.2.3 () | | +--- com.android.tools.build:manifest-merger:25.2.3 | | | +--- com.android.tools:common:25.2.3 () | | | +--- com.android.tools:sdklib:25.2.3 () | | | +--- com.android.tools:sdk-common:25.2.3 () | | | +--- net.sf.kxml:kxml2:2.3.0 | | | --- com.google.code.gson:gson:2.2.4 -> 2.6.2 | | +--- com.android.tools.ddms:ddmlib:25.2.3 () | | +--- com.android.tools.jack:jack-api:0.11.0 | | +--- com.android.tools.jill:jill-api:0.10.0 | | +--- com.android.tools.analytics-library:protos:25.2.3 | | | --- com.google.protobuf:protobuf-java:2.5.0 | | +--- com.android.tools.analytics-library:shared:25.2.3 | | | +--- com.android.tools.analytics-library:protos:25.2.3 () | | | +--- com.android.tools:annotations:25.2.3 | | | +--- com.android.tools:common:25.2.3 () | | | +--- com.google.guava:guava:17.0 -> 18.0 | | | --- com.google.code.gson:gson:2.2.4 -> 2.6.2 | | +--- com.android.tools.analytics-library:tracker:25.2.3 | | | +--- com.android.tools:annotations:25.2.3 | | | +--- com.android.tools:common:25.2.3 () | | | +--- com.android.tools.analytics-library:protos:25.2.3 () | | | +--- com.android.tools.analytics-library:shared:25.2.3 () | | | +--- com.google.protobuf:protobuf-java:2.5.0 | | | --- com.google.guava:guava:17.0 -> 18.0 | | +--- com.squareup:javawriter:2.5.0 | | +--- org.bouncycastle:bcpkix-jdk15on:1.48 () | | +--- org.bouncycastle:bcprov-jdk15on:1.48 | | +--- org.ow2.asm:asm:5.0.4 | | --- org.ow2.asm:asm-tree:5.0.4 | | --- org.ow2.asm:asm:5.0.4 | +--- com.android.tools.lint:lint:25.2.3 | | +--- com.android.tools.lint:lint-checks:25.2.3 | | | +--- com.android.tools.lint:lint-api:25.2.3 | | | | +--- com.android.tools:sdk-common:25.2.3 () | | | | +--- com.android.tools.build:builder-model:2.2.3 () | | | | +--- com.android.tools.external.lombok:lombok-ast:0.2.3 | | | | | --- com.google.guava:guava:17.0 -> 18.0 | | | | +--- com.android.tools.external.com-intellij:uast:145.597.4 | | | | +--- org.ow2.asm:asm:5.0.4 | | | | --- org.ow2.asm:asm-tree:5.0.4 () | | | --- org.ow2.asm:asm-analysis:5.0.4 | | | --- org.ow2.asm:asm-tree:5.0.4 () | | --- org.eclipse.jdt.core.compiler:ecj:4.5.1 | +--- com.android.tools.build:transform-api:2.0.0-deprecated-use-gradle-api | +--- com.android.tools.build:gradle-api:2.2.3 | | +--- com.android.tools.build:builder-model:2.2.3 () | | --- com.google.guava:guava:17.0 -> 18.0 | +--- com.android.databinding:compilerCommon:2.2.3 | | +--- com.android.databinding:baseLibrary:2.2.3 | | +--- org.antlr:antlr4:4.5.3 | | +--- commons-io:commons-io:2.4 | | +--- com.googlecode.juniversalchardet:juniversalchardet:1.0.3 | | +--- com.google.guava:guava:17.0 -> 18.0 | | --- com.android.tools:annotations:24.5.0 -> 25.2.3 | +--- org.ow2.asm:asm:5.0.4 | +--- org.ow2.asm:asm-commons:5.0.4 | | --- org.ow2.asm:asm-tree:5.0.4 () | +--- net.sf.proguard:proguard-gradle:5.2.1 | | --- net.sf.proguard:proguard-base:5.2.1 | +--- org.jacoco:org.jacoco.core:0.7.5.201505241946 | | --- org.ow2.asm:asm-debug-all:5.0.1 | +--- org.jacoco:org.jacoco.report:0.7.5.201505241946 | | +--- org.jacoco:org.jacoco.core:0.7.5.201505241946 () | | --- org.ow2.asm:asm-debug-all:5.0.1 | +--- net.sf.jopt-simple:jopt-simple:4.9 | +--- com.google.protobuf:protobuf-java:2.5.0 | --- org.antlr:antlr:3.5.2 | +--- org.antlr:antlr-runtime:3.5.2 | --- org.antlr:ST4:4.0.8 | --- org.antlr:antlr-runtime:3.5.2 +--- com.neenbedankt.gradle.plugins:android-apt:1.8 +--- io.realm:realm-gradle-plugin:2.3.0 | +--- io.realm:realm-transformer:2.3.0 | | +--- io.realm:realm-annotations:2.3.0 | | +--- org.javassist:javassist:3.20.0-GA | | --- com.android.tools.build:gradle:2.1.0 -> 2.2.3 () | +--- com.neenbedankt.gradle.plugins:android-apt:1.8 | --- com.android.tools.build:gradle:2.1.0 -> 2.2.3 () +--- com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.2 | +--- com.android.tools.build:gradle:2.2.3 () | --- com.google.code.gson:gson:2.6.2 --- com.netflix.nebula:gradle-lint-plugin:latest.release -> 6.6.0 +--- org.ow2.asm:asm:5.0.4 +--- com.netflix.nebula:gradle-info-plugin:3.3.5 | +--- com.perforce:p4java:2015.2.1365273 | | --- com.jcraft:jzlib:1.1.2 | +--- com.netflix.nebula:gradle-contacts-plugin:3.0.1 | +--- org.eclipse.jgit:org.eclipse.jgit:4.4.1.201607150455-r | | +--- com.jcraft:jsch:0.1.53 | | +--- com.googlecode.javaewah:JavaEWAH:0.7.9 | | +--- org.apache.httpcomponents:httpclient:4.3.6 () | | --- org.slf4j:slf4j-api:1.7.2 | --- org.tmatesoft.svnkit:svnkit:1.8.12 | +--- com.jcraft:jsch.agentproxy.svnkit-trilead-ssh2:0.0.7 | | +--- com.trilead:trilead-ssh2:1.0.0-build217 -> 1.0.0-build220 | | --- com.jcraft:jsch.agentproxy.core:0.0.7 | +--- com.trilead:trilead-ssh2:1.0.0-build220 | +--- net.java.dev.jna:jna-platform:4.1.0 | | --- net.java.dev.jna:jna:4.1.0 | +--- net.java.dev.jna:jna:4.1.0 | +--- com.jcraft:jsch.agentproxy.connector-factory:0.0.7 | | +--- com.jcraft:jsch.agentproxy.core:0.0.7 | | +--- com.jcraft:jsch.agentproxy.usocket-jna:0.0.7 | | | +--- com.jcraft:jsch.agentproxy.core:0.0.7 | | | +--- net.java.dev.jna:jna:3.4.0 -> 4.1.0 | | | --- net.java.dev.jna:platform:3.4.0 | | +--- com.jcraft:jsch.agentproxy.usocket-nc:0.0.7 | | | --- com.jcraft:jsch.agentproxy.core:0.0.7 | | +--- com.jcraft:jsch.agentproxy.sshagent:0.0.7 | | | --- com.jcraft:jsch.agentproxy.core:0.0.7 | | --- com.jcraft:jsch.agentproxy.pageant:0.0.7 | | +--- com.jcraft:jsch.agentproxy.core:0.0.7 | | +--- net.java.dev.jna:jna:3.4.0 -> 4.1.0 | | --- net.java.dev.jna:platform:3.4.0 | +--- de.regnis.q.sequence:sequence-library:1.0.3 | --- org.tmatesoft.sqljet:sqljet:1.1.10 | --- org.antlr:antlr-runtime:3.4 -> 3.5.2 +--- commons-lang:commons-lang:2.6 +--- org.codehaus.gpars:gpars:1.2.1 | +--- org.multiverse:multiverse-core:0.7.0 | --- org.codehaus.jsr166-mirror:jsr166y:1.7.0 --- junit:junit:4.12 --- org.hamcrest:hamcrest-core:1.3

(*) - dependencies omitted (listed previously)

BUILD SUCCESSFUL

Do you have any idea how to get it fixed?

Thank you in advance.

jkschneider commented 7 years ago

This may be related to #88.