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

IncompatibleClassChangeError #32

Closed
Davion8948 opened this issue Aug 27, 2016 · 5 comments
Closed

IncompatibleClassChangeError #32

Davion8948 opened this issue Aug 27, 2016 · 5 comments

Comments

@Davion8948
Copy link

Hello:
Is it must rebuild the whole project after delete some public static final String fields?
Because after I deleted a filed my app crashed by:

`java.lang.IncompatibleClassChangeError: com.xxx.rc.example.view.ExampleActivity
                      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:322)
                      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:1078)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2515)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2697)
                      at android.app.ActivityThread.access$800(ActivityThread.java:179)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1540)
                      at android.os.Handler.dispatchMessage(Handler.java:111)
                      at android.os.Looper.loop(Looper.java:194)
                      at android.app.ActivityThread.main(ActivityThread.java:5796)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at java.lang.reflect.Method.invoke(Method.java:372)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1010)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)`
@lomanyong
Copy link
Member

@Davion8948 Is this case can be recurrent? I have repeated this case in sample project but didn't find a crash.

@Davion8948
Copy link
Author

@lomanyong
Yes. I can recurrent this.

After I created a new sample project, I created a super Activity like this:

public abstract class BaseActivity extends AppCompatActivity{
  //Delete this or add this
  public static final String TAG = "BaseActivity";
}

Then let Activity extends this and run python freeline.py, it's ok now.
Next I deleted the TAG field and rerun python freeline.py the app will crash with that error.

@charvenhe
Copy link
Member

charvenhe commented Aug 28, 2016

@Davion8948 it may be abstract class change ,winch cause sub class does not match with the parent class,you can remove "abstract" in BaseActivity and try again .

Freeline has some problem on processing abstract class change case now, we will fix it soon

@Davion8948
Copy link
Author

@charvenhe

好的,谢谢。主页上和Wiki上好像没有关于目前有哪些情况可能导致问题,希望有时间能加一下,这样在使用的时候可以避开相应的问题。

@lomanyong
Copy link
Member

@Davion8948 嗯,我们也在整理这部分内容,尽快都完善起来,感谢提议~

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

3 participants