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

在Android6.0 nexus5上报错 #9

Closed
YaakovHuang opened this issue Nov 26, 2015 · 1 comment
Closed

在Android6.0 nexus5上报错 #9

YaakovHuang opened this issue Nov 26, 2015 · 1 comment

Comments

@YaakovHuang
Copy link

log日志如下:

11-26 16:18:25.302 25355-25355/com.lguipeng.notes E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.lguipeng.notes, PID: 25355
java.lang.LinkageError: com.lguipeng.notes.ui.MainActivity
at dalvik.system.DexFile.defineClassNative(Native Method)
at dalvik.system.DexFile.defineClass(DexFile.java:226)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
at dalvik.system.DexPathList.findClass(DexPathList.java:338)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
at com.lbe.client.zz.ba.newActivity(InstrumentationDelegate.java:234)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

参考了
http://stackoverflow.com/questions/24635115/android-l-linkageerror-crashes-application

解决方法如下

将BaseActivity 下面的getColor() 方法改个名字 换成getTheColor() 就解决了

猜测

应该是跟5.0以上的新方法冲突了

@lguipeng
Copy link
Owner

lguipeng commented Dec 4, 2015

getColor 是 23 后才加进来的,冲突了

@lguipeng lguipeng closed this as completed Dec 4, 2015
lguipeng added a commit that referenced this issue Dec 6, 2015
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

2 participants