Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNEXPECTED TOP-LEVEL EXCEPTION: Error:com.android.dx.cf.iface.ParseException: class name (com/paypal/android/sdk/a) does not match path (com/paypal/android/sdk/A.class) #48

Closed
lrsb opened this issue Sep 17, 2015 · 37 comments

Comments

@lrsb
Copy link

lrsb commented Sep 17, 2015

UNEXPECTED TOP-LEVEL EXCEPTION:
Error:com.android.dx.cf.iface.ParseException: class name (com/paypal/android/sdk/a) does not match path (com/paypal/android/sdk/A.class)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:520)
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
    at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
    at com.android.dx.command.dexer.Main.processClass(Main.java:749)
    ... 21 more
UNEXPECTED TOP-LEVEL EXCEPTION:
Error:com.android.dx.cf.iface.ParseException: class name (com/paypal/android/sdk/aa) does not match path (com/paypal/android/sdk/aA.class)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:520)
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
    at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
    at com.android.dx.command.dexer.Main.processClass(Main.java:749)
    ... 21 more
UNEXPECTED TOP-LEVEL EXCEPTION:
Error:com.android.dx.cf.iface.ParseException: class name (com/paypal/android/sdk/ab) does not match path (com/paypal/android/sdk/aB.class)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:520)
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
    at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
    at com.android.dx.command.dexer.Main.processClass(Main.java:749)
    ... 21 more
@quinnjn
Copy link
Contributor

quinnjn commented Sep 17, 2015

Hey, can you give a little more detail on how you got this? Also, can you try to a Rebuild project?

@ghost
Copy link

ghost commented Sep 17, 2015

I've this problem too. I have it when i try to built and run my app. A tried to rebuild and clean my project, but without success. I have this problem since a week.

@quinnjn
Copy link
Contributor

quinnjn commented Sep 17, 2015

I put together a blank 'Hello, Client!' project. I didn't have any issues building, and running it.

This was using the latest version:
compile 'com.braintreepayments.api:braintree:1.6.5'

@anilkumarGL
Copy link

Me too facing the same problem. I have just updated to latest android 23 and the problem started...
Exactly since a week...

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
    at com.android.dx.command.dexer.Main.processClass(Main.java:752)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
    at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
    at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:672)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:574)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)
Caused by: com.android.dx.cf.iface.ParseException: class name (com/paypal/android/sdk/a) does not match path (com/paypal/android/sdk/A.class)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:520)
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
    at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
    at com.android.dx.command.dexer.Main.processClass(Main.java:749)
    ... 21 more

@gbramwell
Copy link

We're sorry you're running into problems. We'll need a little help reproducing this issue. What is your build environment (OS, version of Android Studio / Gradle, etc)?

We do not technically support Eclipse, but whatever your environment we'll do our best to replicate and solve your issue.

@anilkumarGL
Copy link

Hi

My Build Environment
Machine: Mac OS 10.10.3
Android studio: 1.4 Beta 4
Gradle: 2.2.1
Android version: 23

Regards
Anil

On 18 September 2015 at 20:32, Gary Bramwell notifications@github.com
wrote:

We're sorry you're running into problems. We'll need a little help
reproducing this issue. What is your build environment (OS, version of
Android Studio / Gradle, etc)?

We do not technically support Eclipse, but whatever your environment we'll
do our best to replicate and solve your issue.


Reply to this email directly or view it on GitHub
#48 (comment)
.

@ghost
Copy link

ghost commented Sep 18, 2015

My Build Environment
Machine: Mac OS 10.10.5
Android studio: 1.3.2 Build 141.2178183
Android SDK Tools: 24.3.4
Android SDK Platform-tools: 23.0.1
Android SDK Build-tools: 23.0.1

I already used latest version 1.6.5, but this problem occured also with 1.6.4. Maybe is a Paypal API problem.

@gbramwell
Copy link

Are you using Proguard on your project? If so, it would be useful to see what your proguard-rules.pro looks like.

We haven't seen this particular problem before with the PayPal SDK, but that doesn't rule out issues.

@anilkumarGL
Copy link

No. It also happens in the debug environment too, where we don't use default proguard as well...
It is happening recently. May be due to recent android 23 environment?, I don't know the root cause why it is happening...

@ghost
Copy link

ghost commented Sep 22, 2015

Yes It happens in the debug environment for me too, recently

@ghost
Copy link

ghost commented Sep 22, 2015

Ok i solved by changing in Project build.grandle classpath 'com.android.tools.build:gradle:+' with classpath 'com.android.tools.build:gradle:1.3.0'

@anilkumarGL
Copy link

Ah, I have tried that
classpath 'com.android.tools.build:gradle:1.3.0'
but didn't work for me. Same error...

@anilkumarGL
Copy link

I think I found some trigger that could probably give a perspective:
Since, this error is happening recently and also while executing ":app:transformClassesWithDexForVersion2Debug"
According to this link: http://tools.android.com/tech-docs/new-build-system,
there are recent changes made in 1.4.0-beta2 (released on 15 Sep 2015) - something related to transform API.
I think may be the braintree lib packaging need to be taken care ?

@fahimk
Copy link

fahimk commented Oct 5, 2015

Seeing the same issue. I just updated platform/sdk tools and I'm using com.android.tools.build:gradle:1.4.0-beta5

@lkorth
Copy link
Member

lkorth commented Oct 5, 2015

Please let us know if you are still experiencing this issue with the recently released 1.7.0.

@fahimk
Copy link

fahimk commented Oct 6, 2015

I'm seeing the same issue with 1.7.0 of the braintree sdk when using 1.4.0-beta5 build tools. If I switch back to 1.3.1 build tools, it works fine.

@lkorth
Copy link
Member

lkorth commented Oct 6, 2015

We have confirmed this issue is caused by com.android.tools.build:gradle:1.4.0-beta2 or greater, you should be fine using 1.3.1 or 1.4.0-beta1. We are investigating further, but there is a good chance the answer will be to wait for the stable release of 1.4.0.

Thanks everyone for the report and information.

@fred8
Copy link

fred8 commented Oct 6, 2015

Same issue here with braintree-api:1.7.1 and com.android.tools.build:gradle:1.4.0-beta6
Please guys, update.

@lkorth
Copy link
Member

lkorth commented Oct 7, 2015

@fred8: please see the previous comment. 1.4.0 is in beta for a reason, it isn't stable at this point.

@braebot
Copy link
Contributor

braebot commented Oct 7, 2015

The issue is with the 1.4.0-beta6 build tools not supporting classes that are only different through different capitalization. The PayPal SDK has classes named both A.class and a.class, yet the intermediate extraction step skips files that it thinks are duplicates. I'll need to open a bug with the build tools folks.

@braebot
Copy link
Contributor

braebot commented Oct 8, 2015

See this tools issue already tracking the problem.

@gcalaprice
Copy link

Hi, I faced that there was a conflict issue with Google Play Service plugin.
Removing classpath 'com.google.gms:google-services:1.4.0-beta3' from my top-level build.gradle, solved the issue and the app builds correctly. But this is not a solution because I need Google Play Service plugin for GCM and Analytics integration..

@lkorth
Copy link
Member

lkorth commented Oct 14, 2015

@gcalaprice if com.google.gms.google-services:1.4.0-beta3 uses com.android.tools.build:gradle:1.4.0-beta3 or higher you're going to receive this exception. There is a bug filed with the Android tools team. This issue will need to wait until the bug is fixed and 1.4.0 is released as stable.

@plastiv
Copy link

plastiv commented Oct 14, 2015

Another option would be to not use classes that are only different by letter capitalization with
-dontusemixedcaseclassnames option for proguard.

@braebot
Copy link
Contributor

braebot commented Oct 14, 2015

Agreed about the proguard workaround. At the suggestion of @plastiv, we'll go ahead and do this, and publish a new PayPal release sometime shortly (few days). We have other Android 23 changes coming too that we'd like to deliver with that, so please understand the delay.

@chrisharris77
Copy link

I see there was a 2.11.0 PayPal SDK release using -dontusemixedcaseclassnames. When will there be a Braintree SDK please which uses this version?

@adamvarhegyi
Copy link

Same issue here. Can you tell me when the updates for braintree is coming? Because i won't use the proguard workaround if it is coming early, like tomorrow or something.

@lkorth
Copy link
Member

lkorth commented Oct 20, 2015

The 2.11.0 version of the PayPal SDK was released using -dontusemixedcaseclassnames, however it also changed the minSdk to 11. We're currently waiting on another release that will have a minSdk of 10 or lower so braintree_android can be updated with it. The PayPal release should be out later today or tomorrow so an update to braintree_android will be forthcoming tomorrow.

@lkorth
Copy link
Member

lkorth commented Oct 22, 2015

braintree_android 1.7.2 was just released with a version of the PayPal SDK that uses -dontusemixedcaseclassnames to fix this.

It should be available on maven in a few hours.

@lkorth lkorth closed this as completed Oct 22, 2015
@adamvarhegyi
Copy link

I got the very same error with latest braintree update (1.7.2)

Here is my build.gradle file:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.illion.dotodo.application.courier"
        minSdkVersion 19
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}
    }
}

repositories { mavenCentral() }
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.braintreepayments.api:braintree:1.7.2'
    compile project(':DoToDoEssentials')
}

Error is:

UNEXPECTED TOP-LEVEL EXCEPTION:
Error:com.android.dx.cf.iface.ParseException: class name (com/paypal/android/sdk/a) does not match path (com/paypal/android/sdk/A.class)

... and so on for many classes in paypal SDK.

@anilkumarGL
Copy link

Hi

There is absolutely no problem in your build.gradle file,
but the problem with the top level gradle file at
project_root->build.gradle.
You need to use the gradle version <=1.3.1 like the one below:

// 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.3.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
jcenter()
}
}

@chrisharris77
Copy link

1.7.2 resolves the problem for me (using android grade plugin 1.4.0-beta6).

@adamvarhegyi
Copy link

@anilkumarGL I do have gradle 1.3.1 so the problem is lays elsewhere. I just realized you wrote previously that if a project contians

'com.google.gms:google-services:1.4.0-beta3'

Then this error will still present. Actually i do use google play services. Is there no workaround to make braintree android sdk work with google play services? Maybe previous builds or something..?

@anilkumarGL
Copy link

@adamvarhegyi , for me this is working fine for me..
classpath 'com.google.gms:google-services:+'

@lkorth
Copy link
Member

lkorth commented Oct 22, 2015

@adamvarhegyi have you synced and cleaned/rebuilt your project? There is no longer an A.class in PayPal.

@adamvarhegyi
Copy link

Thanks guys for all the help, i had 2 problems the first was solved with the new braintree sdk release.
The second was because of "Apps with Over 65K Methods" : https://developer.android.com/tools/building/multidex.html

The release is working perfectly, thanks for your time.

@enriqif
Copy link

enriqif commented Sep 13, 2018

Ok i solved by changing in Project build.grandle classpath 'com.android.tools.build:gradle:+' with classpath 'com.android.tools.build:gradle:1.3.0'

Thank you sooooo much!! you giveme a clue to solve my problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests