当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Could not find class error in android studio when launch my App in pre lolipop devices.Why?

问题描述:

I am using target sdk version 23 and min sdk version 14.I also used coordinator layout in my splash Activity(Launcher Activity).

App is working perfectly in device with api level 21,22,23 but every time when it is launched in pre lolipop device(Api level 19)it crashes with following error log

E/dalvikvm: Could not find class

'com.thedemoapps.secretwallet.fragments.SplashFragmentTwo', referenced

from method

com.thedemoapps.secretwallet.activities.SplashActivity$PagerAdapter.getItem

03-10 05:11:53.741 1127-1127/com.thedemoapps.secretwallet W/dalvikvm:

VFY: unable to resolve new-instance 9172

(Lcom/thedemoapps/secretwallet/fragments/SplashFragmentTwo;) in

Lcom/thedemoapps/secretwallet/activities/SplashActivity$PagerAdapter;

03-10 05:11:53.745 1127-1127/com.thedemoapps.secretwallet D/dalvikvm:

VFY: replacing opcode 0x22 at 0x0005 03-10 05:11:53.745

1127-1127/com.thedemoapps.secretwallet E/dalvikvm: Could not find

class 'com.thedemoapps.secretwallet.fragments.SplashFragmentThree',

referenced from method

com.thedemoapps.secretwallet.activities.SplashActivity$PagerAdapter.getItem

03-10 05:11:53.745 1127-1127/com.thedemoapps.secretwallet W/dalvikvm:

VFY: unable to resolve new-instance 9171

(Lcom/thedemoapps/secretwallet/fragments/SplashFragmentThree;) in

Lcom/thedemoapps/secretwallet/activities/SplashActivity$PagerAdapter;

03-10 05:11:53.745 1127-1127/com.thedemoapps.secretwallet D/dalvikvm:

VFY: replacing opcode 0x22 at 0x000b 03-10 05:11:53.745

1127-1127/com.thedemoapps.secretwallet D/dalvikvm: DexOpt: unable to

opt direct call 0xf51a at 0x07 in

Lcom/thedemoapps/secretwallet/activities/SplashActivity$PagerAdapter;.getItem

03-10 05:11:53.745 1127-1127/com.thedemoapps.secretwallet D/dalvikvm:

DexOpt: unable to opt direct call 0xf519 at 0x0d in

Lcom/thedemoapps/secretwallet/activities/SplashActivity$PagerAdapter;.getItem

03-10 05:11:53.761 1127-1127/com.thedemoapps.secretwallet

D/AndroidRuntime: Shutting down VM 03-10 05:11:53.761

1127-1127/com.thedemoapps.secretwallet W/dalvikvm: threadid=1: thread

exiting with uncaught exception (group=0xa61c2908) 03-10 05:11:53.789

1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime: FATAL

EXCEPTION: main 03-10 05:11:53.789

1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

java.lang.NoClassDefFoundError:

com.thedemoapps.secretwallet.fragments.SplashFragmentTwo 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at

com.thedemoapps.secretwallet.activities.SplashActivity$PagerAdapter.getItem(SplashActivity.java:201)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.support.v4.app.FragmentStatePagerAdapter.instantiateItem(FragmentStatePagerAdapter.java:105)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.support.v4.view.ViewPager.addNewItem(ViewPager.java:870) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at android.support.v4.view.ViewPager.populate(ViewPager.java:1020)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.support.v4.view.ViewPager.populate(ViewPager.java:952) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1474)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at android.view.View.measure(View.java:15518)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:610)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:677)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at android.view.View.measure(View.java:15518)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.widget.FrameLayout.onMeasure(FrameLayout.java:310) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at android.view.View.measure(View.java:15518) 03-10 05:11:53.789

1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime: at

android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.widget.LinearLayout.measureVertical(LinearLayout.java:695)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.widget.LinearLayout.onMeasure(LinearLayout.java:588) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at android.view.View.measure(View.java:15518) 03-10 05:11:53.789

1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime: at

android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.widget.FrameLayout.onMeasure(FrameLayout.java:310) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at

com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2176)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at android.view.View.measure(View.java:15518)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1874) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1089)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1265)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at

android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.view.Choreographer.doCallbacks(Choreographer.java:562) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at android.view.Choreographer.doFrame(Choreographer.java:532) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at

android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

android.os.Handler.handleCallback(Handler.java:725) 03-10 05:11:53.789

1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime: at

android.os.Handler.dispatchMessage(Handler.java:92) 03-10 05:11:53.789

1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime: at

android.os.Looper.loop(Looper.java:137) 03-10 05:11:53.789

1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime: at

android.app.ActivityThread.main(ActivityThread.java:5041) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at java.lang.reflect.Method.invokeNative(Native Method) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at java.lang.reflect.Method.invoke(Method.java:511) 03-10 05:11:53.789

1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime: at

com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)

03-10 05:11:53.789 1127-1127/com.thedemoapps.secretwallet

E/AndroidRuntime: at

com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 03-10

05:11:53.789 1127-1127/com.thedemoapps.secretwallet E/AndroidRuntime:

at dalvik.system.NativeStart.main(Native Method) 03-10 05:16:53.857

1127-1127/? I/Process: Sending signal. PID: 1127 SIG: 9

This error accurs in getItem() of viewPager Adapter where I return a object of new Fragment().Please help to know the cause of this error

分享给朋友:
您可能感兴趣的文章:
随机阅读: