Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Build failure: signature-polymorphic method called without --min-sdk-version >= 26 #145

Open
@nathanwharvey

Description

@nathanwharvey

I am getting a strange bug when building, even with a fresh project. The error only occurs when groovy is being compiled. Here is the module's build.gradle:

buildscript {
	repositories {
		jcenter()
	}
	
	dependencies {
		classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:1.1.0'
	}
}

apply plugin: 'com.android.application'
apply plugin: 'groovyx.android'

androidGroovy {
	options {
		configure(groovyOptions) {
			javaAnnotationProcessing = true
		}
	}
}

android {
	compileSdkVersion 25
	buildToolsVersion "25.0.2"
	defaultConfig {
		applicationId "io.nwh.myapplication"
		minSdkVersion 15
		targetSdkVersion 25
		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:25.3.1'
	testCompile 'junit:junit:4.12'
	compile 'com.android.support.constraint:constraint-layout:1.0.2'
	compile 'org.codehaus.groovy:groovy:2.4.7:grooid'
}

And here is the project's build.gralde:

buildscript {
	repositories {
		jcenter()
	}
	dependencies {
		classpath 'com.android.tools.build:gradle:2.4.0-alpha5'
	}
}

allprojects {
	repositories {
		jcenter()
	}
}

task clean(type: Delete) {
	delete rootProject.buildDir
}

I am using Gradle version 3.4.1. Here is the output from building:

$ gradle installDebug
:app:preBuild UP-TO-DATE
:app:resolveDebugDependencies
:app:preDebugBuild
:app:checkDebugManifest
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugResValues
:app:handleDebugMicroApk
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:incrementalDebugJavaCompilationSafeguard
:app:javaPreCompileDebug
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:compileDebugGroovyWithGroovyc
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:transformClassesWithDexBuilderForDebug
warning: Ignoring InnerClasses attribute for an anonymous inner class
                                                                      (groovyjarjarantlr.build.ANTLR$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
Unable to pre-dex 'C:\Users\Nathan\.gradle\caches\modules-2\files-2.1\org.codehaus.groovy\groovy\2.4.7\b4b263e2106bac49c2eb21f6737f9b6e45e24a4a\groovy-2.4.7-grooid.jar' to 'C:\Users\Nathan\Documents\Flags2\app\build\intermediates\transforms\dexBuilder\debug\jars\40000\10\groovy-2.4.7-grooid_5a2004fbc80cc406e9adac10d01fb1c4aeb1d6e6.jar'
Dex: Error converting bytecode to dex:WithDexBuilderForDebug
Cause: signature-polymorphic method called without --min-sdk-version >= 26
    UNEXPECTED TOP-LEVEL EXCEPTION:
signature-polymorphic method called without --min-sdk-version >= 26

java.lang.RuntimeException: com.android.dx.cf.code.SimException: signature-polymorphic method called without --min-sdk-version >= 26
        at com.android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:183)
        at com.android.builder.dexing.DexArchiveBuilder.processOutputs(DexArchiveBuilder.java:95)
        at com.android.builder.dexing.DexArchiveBuilder.convert(DexArchiveBuilder.java:78)
        at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransformCallable.lambda$cacheMissAction$0(DexArchiveBuilderTransformCallable.java:240)
        at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransformCallable$$Lambda$1022/1324664455.run(Unknown Source)
        at com.android.builder.utils.FileCache.lambda$createFile$1(FileCache.java:260)
        at com.android.builder.utils.FileCache$$Lambda$1033/1397556199.call(Unknown Source)
        at com.android.builder.utils.FileCache.lambda$null$5(FileCache.java:443)
        at com.android.builder.utils.FileCache$$Lambda$1089/840087435.accept(Unknown Source)
        at com.android.builder.utils.SynchronizedFile.doActionWithMultiProcessLocking(SynchronizedFile.java:265)
        at com.android.builder.utils.SynchronizedFile.write(SynchronizedFile.java:232)
        at com.android.builder.utils.FileCache.lambda$queryCacheEntry$6(FileCache.java:415)
        at com.android.builder.utils.FileCache$$Lambda$1037/1858463036.accept(Unknown Source)
        at com.android.builder.utils.SynchronizedFile.doActionWithMultiProcessLocking(SynchronizedFile.java:265)
        at com.android.builder.utils.SynchronizedFile.read(SynchronizedFile.java:215)
        at com.android.builder.utils.FileCache.queryCacheEntry(FileCache.java:391)
        at com.android.builder.utils.FileCache.createFile(FileCache.java:273)
        at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransformCallable.getFromCacheAndCreateIfMissing(DexArchiveBuilderTransformCallable.java:187)
        at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransformCallable.call(DexArchiveBuilderTransformCallable.java:149)
        at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransformCallable.call(DexArchiveBuilderTransformCallable.java:53)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.dx.cf.code.SimException: signature-polymorphic method called without --min-sdk-version >= 26
        at com.android.dx.cf.code.Simulator$SimVisitor.visitConstant(Simulator.java:684)
        at com.android.dx.cf.code.BytecodeArray.parseInstruction(BytecodeArray.java:764)
        at com.android.dx.cf.code.Simulator.simulate(Simulator.java:101)
        at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:790)
        at com.android.dx.cf.code.Ropper.doit(Ropper.java:745)
        at com.android.dx.cf.code.Ropper.convert(Ropper.java:350)
        at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:285)
        at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:141)
        at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:95)
        at com.android.builder.dexing.DexArchiveBuilderCallable.translateClass(DexArchiveBuilderCallable.java:87)
        at com.android.builder.dexing.DexArchiveBuilderCallable.call(DexArchiveBuilderCallable.java:70)
        at com.android.builder.dexing.DexArchiveBuilderCallable.call(DexArchiveBuilderCallable.java:40)
        ... 6 more
:app:transformClassesWithDexBuilderForDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.builder.utils.FileCache$FileCreatorException: com.android.builder.dexing.DexArchiveBuilder$DexBuilderException: Unable to convert input to dex archive.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 7.949 secs

I also tried copying the sample app and got the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions