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

Android ART issue - java.lang.AbstractMethodError: #207

Closed
hlaurent opened this issue Nov 20, 2014 · 4 comments
Closed

Android ART issue - java.lang.AbstractMethodError: #207

hlaurent opened this issue Nov 20, 2014 · 4 comments
Labels

Comments

@hlaurent
Copy link

@hlaurent hlaurent commented Nov 20, 2014

My app used to work just fine using joda -time.
It now crashes with Lollipop (Android 5.0) or any device using ART ONLY when it is built for prod using proguard.

I can see 2 things:

  • When I try to run the app, I have an a java.lang.AbstractMethodError
    11-20 22:35:46.492: E/AndroidRuntime(28677): java.lang.AbstractMethodError: abstract method "long aih.f()"
    11-20 22:35:46.492: E/AndroidRuntime(28677): at ais.(SourceFile:46)
    11-20 22:35:46.492: E/AndroidRuntime(28677): at aih.assemble(SourceFile:273)
    11-20 22:35:46.492: E/AndroidRuntime(28677): at org.joda.time.chrono.GregorianChronology.assemble(SourceFile:192)
    11-20 22:35:46.492: E/AndroidRuntime(28677): at org.joda.time.chrono.AssembledChronology.a(SourceFile:323)
    11-20 22:35:46.492: E/AndroidRuntime(28677): at org.joda.time.chrono.AssembledChronology.(SourceFile:102)
    11-20 22:35:46.492: E/AndroidRuntime(28677): at aih.(SourceFile:131)
    11-20 22:35:46.492: E/AndroidRuntime(28677): at ain.(SourceFile:75)
    11-20 22:35:46.492: E/AndroidRuntime(28677): at org.joda.time.chrono.GregorianChronology.(SourceFile:148)
  • In the LoCat I see dex2oat warnings during compilation
    11-21 00:30:43.988: W/dex2oat(9163): Before Android 4.1, method int org.joda.time.chrono.EthiopicChronology.c() would have incorrectly overridden the package-private method in aij
    11-21 00:30:43.988: W/dex2oat(9163): Before Android 4.1, method int org.joda.time.chrono.EthiopicChronology.d() would have incorrectly overridden the package-private method in aij
    11-21 00:30:43.988: W/dex2oat(9163): Before Android 4.1, method long org.joda.time.chrono.EthiopicChronology.g(int) would have incorrectly overridden the package-private method in aij

If you go to "Verifying App Behavior on the Android Runtime (ART) " (https://developer.android.com/guide/practices/verifying-apps-art.html)
They warn of model change : Object model changes
Dalvik incorrectly allowed subclasses to override package-private methods. ART issues a warning in such cases. That seems to be the case.

Has anyone seen that problem?
Can anyone help solve this?

Thks

@gjcameron

This comment has been minimized.

Copy link

@gjcameron gjcameron commented Nov 25, 2014

I'm having the same issue, similarly only with release builds using proguard, and only on Android 5 devices. The app crashes when I try to create a DateTime() object.

java.lang.AbstractMethodError: abstract method "long buw.f()"
    at bvh.<init>(SourceFile:46)
    at buw.assemble(SourceFile:273)
    at org.joda.time.chrono.GregorianChronology.assemble(SourceFile:192)
    at org.joda.time.chrono.AssembledChronology.a(SourceFile:323)
    at org.joda.time.chrono.AssembledChronology.<init>(SourceFile:102)
    at buw.<init>(SourceFile:131)
    at bvc.<init>(SourceFile:75)
    at org.joda.time.chrono.GregorianChronology.<init>(SourceFile:148)
    at org.joda.time.chrono.GregorianChronology.getInstance(SourceFile:129)
    at org.joda.time.chrono.GregorianChronology.getInstance(SourceFile:100)
    at org.joda.time.chrono.GregorianChronology.<clinit>(SourceFile:71)
    at org.joda.time.chrono.GregorianChronology.getInstanceUTC(SourceFile:81)
    at org.joda.time.chrono.ISOChronology.<clinit>(SourceFile:66)
    at org.joda.time.base.BaseDateTime.<init>(SourceFile:61)
    at org.joda.time.DateTime.<init>(SourceFile:155)
@hlaurent

This comment has been minimized.

Copy link
Author

@hlaurent hlaurent commented Nov 26, 2014

I solved the abstract method issue. It was an obfuscation problem with proguard that only appeared at run time with Android 5.0.
I used to have in my proguard-project.txt the 2 following lines related to joda.time :
-dontwarn org.joda.time.*
-dontwarn org.joda.convert.*

I had to add :
-keep class org.joda.time.** { (...); }

The problem got solved

@gjcameron

This comment has been minimized.

Copy link

@gjcameron gjcameron commented Nov 26, 2014

Thanks, that solved my issue.

-keep class org.joda.time.** { *; }

@jodastephen

This comment has been minimized.

Copy link
Member

@jodastephen jodastephen commented Nov 26, 2014

Closing the Joda-Time issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.