task 'compileDebug' is ambiguous in root project - android-gradle-plugin

I'm compiling my project for distribution and I've gotten an error.
Here's the error:
Error:Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_73\bin\java.exe'' finished with non-zero exit value 2
I've gone in and gotten the stacktrace-* Try:
Run gradlew tasks to get a list of available tasks. Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.execution.TaskSelectionException: Task 'compileDebug' is ambiguous in root project 'Inspirerr_Final'. Candidates are: 'compileDebugAidl', 'compileDebugAndroidTestAidl', 'compileDebugAndroidTestJavaWithJavac', 'compileDebugAndroidTestNdk', 'compileDebugAndroidTestRenderscript', 'compileDebugAndroidTestSources', 'compileDebugJavaWithJavac', 'compileDebugNdk', 'compileDebugRenderscript', 'compileDebugSources', 'compileDebugUnitTestJavaWithJavac', 'compileDebugUnitTestSources'.
at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:101)
at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:76)
at org.gradle.execution.commandline.CommandLineTaskParser.parseTasks(CommandLineTaskParser.java:42)
at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:44)
at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48)
at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:47)
at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48)
at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:44)
at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
at org.gradle.execution.DefaultBuildExecuter.select(DefaultBuildExecuter.java:35)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
BUILD FAILED
And my gradle file
:apply plugin: 'com.android.application'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects {
repositories {
jcenter()
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:design:23.2.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.volley:volley:1.0.0'
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build- types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
Any help you can offer would be greatly appreciated. Thank you!

Maybe.there are such code in your BuildConfig,
// Fields from build type: debug
public static final boolean ENABLE_DEVELOP_MODE = true;
And you use it in some place.
When you build release, it will dismiss and build failed.

Related

Unable to build android app in react-native after google-play-service update

I am getting the error after running react-native run-android --
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
>
Android resource linking failed
 Output:  /../../bitbucket/app/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:293: error: resource android:attr/fontVariationSettings not found.
 /../../bitbucket/app/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:293: error: resource android:attr/ttcIndex not found.
 error: failed linking references.
 Command: /../../.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/5a5e4d34c69b7e8b3552937157493c40/aapt2-3.2.1-4818971-osx/aapt2 link -I\
         /../../Library/Android/sdk/platforms/android-27/android.jar\
         --manifest\
         /../../bitbucket/app/android/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
         -o\
         /../../bitbucket/app/android/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
         -R\
         #/../../bitbucket/app/android/app/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
         --auto-add-overlay\
         --java\
         /../../bitbucket/app/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
         --custom-package\
         com.app\
         -0\
         apk\
         --output-text-symbols\
         /../../bitbucket/app/android/app/build/intermediates/symbols/debug/R.txt\
         --no-version-vectors
 Daemon:  AAPT2 aapt2-3.2.1-4818971-osx Daemon #0
 Output:  /../../.gradle/caches/transforms-1/files-1.1/drawee-1.10.0.aar/ac1ce9b9fcfb8b8c996ede4ab043d5d6/res/values/values.xml:3:5-58:857: AAPT: error: resource android:attr/fontVariationSettings not found.
 /../../.gradle/caches/transforms-1/files-1.1/drawee-1.10.0.aar/ac1ce9b9fcfb8b8c996ede4ab043d5d6/res/values/values.xml:3:5-58:857: AAPT: error: resource android:attr/ttcIndex not found.
 error: failed linking references.
 Command: /../../.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/5a5e4d34c69b7e8b3552937157493c40/aapt2-3.2.1-4818971-osx/aapt2 link -I\
         /../../Library/Android/sdk/platforms/android-27/android.jar\
         --manifest\
         /../../bitbucket/app/android/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
         -o\
         /../../bitbucket/app/android/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
         -R\
         #/../../bitbucket/app/android/app/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
         --auto-add-overlay\
         --java\
         /../../bitbucket/app/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
         --custom-package\
         com.app\
         -0\
         apk\
         --output-text-symbols\
         /../../bitbucket/app/android/app/build/intermediates/symbols/debug/R.txt\
         --no-version-vectors
 Daemon:  AAPT2 aapt2-3.2.1-4818971-osx Daemon #0
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 47s
73 actionable tasks: 72 executed, 1 up-to-date
I have already updated the sdk versions and react-native-device-info version. Still facing the issue.
dependencies : app/build.gradle:
dependencies
{
compile project(':react-native-wheel-picker')
compile project(':react-native-vector-icons')
compile project(':react-native-image-picker')
compile project(':react-native-geolocation-service')
compile project(':react-native-fused-location')
compile project(':react-native-android-open-settings')
compile project(':react-native-gesture-handler')
compile project(':react-native-fs')
compile project(':react-native-device-info')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
compile 'com.android.support:multidex:1.0.3'
}
android/build.gradle:
buildscript
{
ext
{
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 26
supportLibVersion = "26.1.0"
googlePlayServicesVersion = "16.+"
}
repositories
{
google()
jcenter()
}
dependencies
{
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:1.4.0-beta3'
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
}
}
}
}
wrapper {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}

Unable to delete file: androidx.databinding.library.baseAdapters--setter_store.json

What is this error with databinding in Kotlin + Android Studio?
> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
> Task :clean
> Task :app:clean FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:clean'.
> Unable to delete file: C:\MyFolder\app\build\intermediates\data_binding_dependency_artifacts\debug\dataBindingMergeDependencyArtifactsDebug\out\androidx.databinding.library.baseAdapters--setter_store.json
Ending Process in Windows resource monitor, gradlew clean, or invalidating cache and restarting clears it but it creeps right back on the second build/clean attempt.
My app build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
...
}
My project build.gradle
buildscript {
ext.kotlin_version = '1.3.21'
dependencies {
classpath "com.android.tools.build:gradle:$gradle_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
}

Dagger 2 Injection - buildToolsVersion "23.0.2" gradle 2.8 ...compileDebugJavaWithJavac : java.lang.IllegalStateException

I really need your help!
I'm trying to do some tests using espresso 2 + dagger 2 + mockito 1.10.19...
But I'm stuck in a Gradle build error and any related problems/solutions that i found could actually help me.
The only clue i have is that it might have something to do with dagger annotations...
So, here is my app build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.rbr.test"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "com.rbr.test_prototype.MockTestRunner"
}
buildTypes {
debug {
testCoverageEnabled true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'LICENSE.txt'
}
}
final DAGGER_VERSION = '2.0.1'
final DEXMAKER_VERSION = '1.4'
final RUNNER_VERSION = '0.4.1'
final ESPRESSO_VERSION = '2.2.1'
dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.google.dagger:dagger:${DAGGER_VERSION}"
apt "com.google.dagger:dagger-compiler:${DAGGER_VERSION}"
provided 'org.glassfish:javax.annotation:10.0-b28'
testCompile 'junit:junit:4.12'
testCompile 'com.google.truth:truth:0.25'
androidTestCompile "com.android.support:support-annotations:23.1.1"
androidTestCompile "com.android.support.test:runner:${RUNNER_VERSION}"
androidTestCompile "com.android.support.test:rules:${RUNNER_VERSION}"
androidTestCompile "com.android.support.test.espresso:espresso-core:${ESPRESSO_VERSION}"
androidTestCompile "com.android.support.test.espresso:espresso-intents:${ESPRESSO_VERSION}"
//androidTestCompile "com.android.support.test.espresso:espresso-contrib:${ESPRESSO_VERSION}"
//androidTestCompile "com.android.support.test.espresso:espresso-web:${ESPRESSO_VERSION}"
// androidTestCompile "com.android.support.test.espresso:espresso-idling-resource:${ESPRESSO_VERSION}"
androidTestCompile "com.crittercism.dexmaker:dexmaker:${DEXMAKER_VERSION}"
androidTestCompile "com.crittercism.dexmaker:dexmaker-mockito:${DEXMAKER_VERSION}"
androidTestCompile "org.mockito:mockito-core:1.10.19"
androidTestApt "com.google.dagger:dagger-compiler:${DAGGER_VERSION}"
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.squareup:otto:1.3.8'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.androidadvance:topsnackbar:0.0.9'
compile 'com.miguelcatalan:materialsearchview:1.0.0'
}
and my project build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// Assists in working with annotation processors for Android Studio.
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
allprojects {
repositories {
jcenter()
}
}
And finally, this is my stacktrace:
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.ja
va:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExec
uter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecut
er.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.jav
a:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.jav
a:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.
java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.
java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor
.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50
)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.j
ava:94)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:77)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:47)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecu
ter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecu
ter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException
at com.sun.tools.javac.main.Main.compile(Main.java:553)
at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:45)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.j
ava:101)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:50)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:36)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:34)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:157)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:139)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:93)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(Ann
otationProcessingTaskFactory.java:244)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(Annotati
onProcessingTaskFactory.java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(Annot
ationProcessingTaskFactory.java:231)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(Annotati
onProcessingTaskFactory.java:209)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.jav
a:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.ja
va:61)
... 60 more
Caused by: java.lang.IllegalStateException
at dagger.internal.codegen.BindingGraphValidator.validateComponentScope(BindingGraphValidator.java:611)
at dagger.internal.codegen.BindingGraphValidator.validate(BindingGraphValidator.java:122)
at dagger.internal.codegen.BindingGraphValidator.validate(BindingGraphValidator.java:115)
at dagger.internal.codegen.ComponentProcessingStep.processComponents(ComponentProcessingStep.java:147)
at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:89)
at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:228)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:7
05)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
at com.sun.tools.javac.main.Main.compile(Main.java:523)
... 79 more
BUILD FAILED
Tks in advance!

Upgrading to Android Gradle Plugin 1.3 fails build due to check failure in Espresso tests

Before upgrading to Android Gradle Plugin 1.3, the custom lint scope was only Android source files.
After I upgraded to 1.3.1, my tests files started getting checked and as a scenario fails my custom lint rule, the build fails.
There is no documentation about this. I read some warnings have become fatal but nothing around test files getting scanned.
Anyone facing such an issue?
EDIT:
top level build.gradle
buildscript {
repositories {
mavenCentral()
maven { url 'http://download.crashlytics.com/maven' }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'org.sonarqube.gradle:gradle-sonarqube-plugin:1.0'
}
}
allprojects {
repositories {
flatDir {
dirs './prebuilt-libs'
}
mavenCentral()
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
Error:
HardCoding: Detects HardCoded "abc" string
../../src/androidTest/java/com/xyz/mobile/trips/test.java:108: HardCoding Found. (This is my custom lint rule)
hasExtra(CODE, "abc")

VerifyError from com.google.android.gms:play-services:4.4.52 dependency

After including com.google.android.gms:play-services:4.4.52 dependency (for Google+-Login within the Android app) I have a problem running the test cases with Robotium and JUnit on Jenkins. It seems that no matter which test case, the test fails with VerifyError (I've also already observed ClassNotFound- and NoClassDefFoundError's afterwards).
Stacktraces:
VerifyError:
java.lang.VerifyError: org/catrobat/catroid/uitest/content/brick/SetSizeToBrickTest
at java.lang.Class.getDeclaredConstructors(Native Method)
at java.lang.Class.getConstructors(Class.java:508)
at android.test.suitebuilder.TestGrouping$TestCasePredicate.hasValidConstructor(TestGrouping.java:228)
at android.test.suitebuilder.TestGrouping$TestCasePredicate.apply(TestGrouping.java:217)
at android.test.suitebuilder.TestGrouping$TestCasePredicate.apply(TestGrouping.java:213)
at android.test.suitebuilder.TestGrouping.select(TestGrouping.java:172)
at android.test.suitebuilder.TestGrouping.selectTestClasses(TestGrouping.java:162)
at android.test.suitebuilder.TestGrouping.testCaseClassesInPackage(TestGrouping.java:156)
at android.test.suitebuilder.TestGrouping.addPackagesRecursive(TestGrouping.java:117)
at android.test.suitebuilder.TestSuiteBuilder.includePackages(TestSuiteBuilder.java:102)
at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:358)
at pl.polidea.instrumentation.PolideaInstrumentationTestRunner.onCreate(PolideaInstrumentationTestRunner.java:432)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4335)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
ClassNotFoundException:
java.lang.ClassNotFoundException: org.catrobat.catroid.test.utils.SimulatedSensorManager
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:251)
at android.test.ClassPathPackageInfoSource.createPackageInfo(ClassPathPackageInfoSource.java:88)
at android.test.ClassPathPackageInfoSource.access$000(ClassPathPackageInfoSource.java:39)
at android.test.ClassPathPackageInfoSource$1.load(ClassPathPackageInfoSource.java:50)
at android.test.ClassPathPackageInfoSource$1.load(ClassPathPackageInfoSource.java:47)
at android.test.SimpleCache.get(SimpleCache.java:31)
at android.test.ClassPathPackageInfoSource.getPackageInfo(ClassPathPackageInfoSource.java:72)
at android.test.ClassPathPackageInfo.getSubpackages(ClassPathPackageInfo.java:48)
at android.test.ClassPathPackageInfo.addTopLevelClassesTo(ClassPathPackageInfo.java:61)
at android.test.ClassPathPackageInfo.getTopLevelClassesRecursive(ClassPathPackageInfo.java:55)
at android.test.suitebuilder.TestGrouping.testCaseClassesInPackage(TestGrouping.java:156)
at android.test.suitebuilder.TestGrouping.addPackagesRecursive(TestGrouping.java:117)
at android.test.suitebuilder.TestSuiteBuilder.includePackages(TestSuiteBuilder.java:102)
at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:358)
at pl.polidea.instrumentation.PolideaInstrumentationTestRunner.onCreate(PolideaInstrumentationTestRunner.java:432)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4335)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: org/catrobat/catroid/test/utils/SimulatedSensorManager
... 27 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.catrobat.catroid.test.utils.SimulatedSensorManager" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/org.catrobat.catroid.test-1.apk", zip file "/data/app/org.catrobat.catroid-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.catrobat.catroid.test-1, /data/app-lib/org.catrobat.catroid-1, /vendor/lib, /system/lib]]
The (relevant part of) build.gradle file:
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
// classpath 'com.google.gms:google-services:1.3.0-beta1'
}
}
repositories {
mavenCentral()
}
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply from: 'gradle/adb_tasks.gradle'
apply from: 'gradle/code_quality_tasks.gradle'
apply from: 'gradle/intellij_config_tasks.gradle'
//apply plugin: 'com.google.gms.google-services'
check.dependsOn 'checkstyle'
check.dependsOn 'pmd'
android {
compileSdkVersion 23
buildToolsVersion '23.0.0'
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
applicationId 'org.catrobat.catroid'
testApplicationId "org.catrobat.catroid.test"
testInstrumentationRunner 'pl.polidea.instrumentation.PolideaInstrumentationTestRunner'
versionCode 24
println "VersionCode is " + versionCode
versionName "0.9.17"
println "VersionName is " + versionName
buildConfigField "String", "GIT_DESCRIBE", "\"${versionName}\""
buildConfigField "String", "GIT_CURRENT_BRANCH", "\"${getCurrentGitBranch()}\""
}
defaultConfig {
multiDexEnabled = true
}
}
ext {
projectVersion = "0.9"
}
configurations {
compile.exclude group: 'xpp3' //compile problem with xstream
natives
}
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile 'com.android.support:support-v4:19.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.guava:guava:18.0'
compile ('com.squareup.okhttp:okhttp:2.3.0') {
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.google.android.gms'
}
compile ( 'com.google.code.gson:gson:2.3.1') {
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.google.android.gms'
}
compile 'com.github.johnpersano:supertoasts:1.3.4#aar'
compile 'com.thoughtworks.xstream:xstream:1.4.7'
def gdxVersion = '1.6.2'
compile 'com.badlogicgames.gdx:gdx:' + gdxVersion
compile 'com.badlogicgames.gdx:gdx-backend-android:' + gdxVersion
natives 'com.badlogicgames.gdx:gdx-platform:' + gdxVersion + ':natives-x86'
natives 'com.badlogicgames.gdx:gdx-platform:' + gdxVersion + ':natives-armeabi'
natives 'com.badlogicgames.gdx:gdx-platform:' + gdxVersion + ':natives-armeabi-v7a'
compile 'com.facebook.android:facebook-android-sdk:4.4.0'
compile 'com.google.android.gms:play-services:4.4.52'
//compile 'com.google.android.gms:play-services-plus:7.8.0'
//compile 'com.google.android.gms:play-services:7.8.0'
compile fileTree(include: '*.jar', dir: 'catroid/libs')
compile fileTree(include: '*.jar', dir: 'catroid/libs-natives')
androidTestCompile fileTree(include: '*.jar', dir: 'catroidTest/libs')
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.2.1'
androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
androidTestCompile 'org.mockito:mockito-core:1.10.19'
pmd 'net.sourceforge.pmd:pmd:5.1.1'
checkstyle 'com.puppycrawl.tools:checkstyle:6.7'
}
task copyAndroidNatives() {
file("catroid/jniLibs/armeabi/").mkdirs();
file("catroid/jniLibs/armeabi-v7a/").mkdirs();
file("catroid/jniLibs/x86/").mkdirs();
configurations.natives.files.each { jar ->
def outputDir = null
if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("catroid/jniLibs/armeabi-v7a")
if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("catroid/jniLibs/armeabi")
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("catroid/jniLibs/x86")
if(outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
}
if (project.hasProperty('jenkins')) {
project.android.dexOptions.preDexLibraries = false
project.android.dexOptions.javaMaxHeapSize = "2048M"
}
On my device (Nexus 4 with Lollipop) The app itself is running without any problems when signing in to Google+. Also within Android Studio tests seem to run without these exceptions. I've already tried to disable bytecode verification during testing like:
tasks.withType(Test) {
scanForTestClasses = false
include "**/*Test.class"
test {
// set JVM arguments for the test JVM(s)
jvmArgs '-XX:-UseSplitVerifier'
}
}
but I still had the same errors.
Also to note, I haven't compiled the current version 'com.google.android.gms:play-services:7.8.0' or 'com.google.android.gms:play-services-plus:7.8.0', respectively, because we first need to replace ActionBarSherlock with AppCompat (otherwise it won't compile). I'm also not sure whether I need to apply the 'com.google.gms.google-services' plugin (seems to work without the plugin) - I haven't included it yet because it changes the task structure, where our automated Jenkins test system depends on.
Even after hours of searching I don't really understand why this happens.