dexcount-gradle-plugin: Bad method call from inside of a branch

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV132301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidAnswers132Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidBeta113Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlytics252Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore235Library UP-TO-DATE
:app:prepareComGithubChrisbanesPhotoviewLibrary124Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase780Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation780Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps780Library UP-TO-DATE
:app:prepareComMsSquareExpandableTextView014Library UP-TO-DATE
:app:prepareIoFabricSdkAndroidFabric136Library UP-TO-DATE
:app:prepareJpCoCyberagentAndroidGpuimageGpuimageLibrary123Library UP-TO-DATE
:app:prepareMeGrantlandAutofittextview021Library UP-TO-DATE
:app:prepareOrgApmemToolsLayouts19Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:fabricGenerateResourcesDebug
:app:processDebugResources
:app:generateDebugSources
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:dexDebug UP-TO-DATE
:app:validateDebugSigning
:app:packageDebug
:app:zipalignDebug
:app:assembleDebug FAILED
Error:Execution failed for task ':app:assembleDebug'.
> Bad <init> method call from inside of a branch
Exception Details:
  Location:
    com/getkeepsafe/dexcount/PackageTree.<init>(Ljava/lang/String;)V @27: invokespecial
  Reason:
    Error exists in the bytecode
  Bytecode:
    0x0000000: b800 214d b800 359a 0006 a700 172a 2b2c
    0x0000010: 1236 3212 022b b900 3c03 00b7 002c a700
    0x0000020: 0f2a 2b2b b800 40b8 0029 b700 2cb1     
  Stackmap Table:
    append_frame(@13,Object[#67])
    same_frame(@33)
    full_frame(@45,{Object[#2],Object[#69],Object[#67]},{})
Information:BUILD FAILED
Information:Total time: 27.534 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

Gradle 2.4

Build time: 2015-05-05 08:09:24 UTC Build number: none Revision: 5c9c3bc20ca1c281ac7972643f1e2d190f2c943c

Groovy: 2.3.10 Ant: Apache Ant™ version 1.9.4 compiled on April 29 2014 JVM: 1.7.0_79 (Oracle Corporation 24.79-b02) OS: Windows 7 6.1 amd64

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Bahaha, I’m getting old. How apropos for this kind of bug.

Allegedly this was fixed, and the fix was applied to JVM 8u20, but clearly you’re experiencing the bug, so… I have a speculative fix that I’ll push momentarily. I can’t repro this myself, so maybe it works, maybe it doesn’t. I’m 99% sure though, that this regressed because I added a constructor to PackageTree and used arguments with default values.

It’s informative to look at the output from javap -c PackageTree.class. The no-args constructor, in bytecode, is a huge mess of dynamic constructor selection and from-the-side argument passing. Astonishing! I guess it, and bugs like this, are the price of such a flexible language.

TL;DR: Try 0.5.1-SNAPSHOT tomorrow; make sure you’ve added the appropriate snapshot repo as described above in this issue. Let me know if it works.