FragmentActivity causing ClassNotFoundException

后端 未结 8 2080
心在旅途
心在旅途 2020-12-05 06:48

I just used Android SDK Manager to update Android SDK Tools to revision 17, and Android Compatiblity to revision 7. Now, the program I\'ve been running for ages crashes on

相关标签:
8条回答
  • 2020-12-05 07:29

    Same issue got solved by Doing Build path->Configure Build path->order and export->Check Add private libraries->ok.

    Then clean up the project.

    Done a big problem solved.

    0 讨论(0)
  • 2020-12-05 07:35

    I assume that fragment activity is listed in the manifest properly? Here's my main FragmentActivity class in the Manifest:

        <activity android:name=".Polling" android:label="@string/app_name"
            android:windowSoftInputMode="stateHidden">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    
    0 讨论(0)
  • 2020-12-05 07:36
    1. Remove anything lib about v7 or v4. Move your Android project, Alt+Enter, click android, look is lib: make sure there is nothing about v7 or v4 lib
    2. add v4 lib
    3. clean project
    4. run again

    if you remove v7, will be error with styles... you may look this

    enter image description here

    0 讨论(0)
  • 2020-12-05 07:39

    I also got the same issue, and resolved it by the below way. If because of some reason you have UNCHECKED to the private libraries from build path, so just add Androidv-4 jar in build path and enable(check) it in "Order and Export" tab

    0 讨论(0)
  • 2020-12-05 07:41

    I got the

     java.lang.NoClassDefFoundError: com.android.example.SupportFragment
        at com.android.example.SupportFragmentActivity.onCreate()
    

    on PopupMenu

    SupportFragment extends SherlockFragment implements PopupMenu.OnMenuItemClickListener
    ...
        @Override
        public boolean onMenuItemClick(android.view.MenuItem item) {
            return onOptionsItemSelected(item);
        }
    

    when trying to make a api 17 app compatible with api 8, the only indication was the logcat error above, so check that all your imported classes are supported if you get this error.

    0 讨论(0)
  • 2020-12-05 07:50

    Turns out it's a problem with Android SDK Tools r17. I had previously been using the method given in the tutorial at:

    http://mobile.tutsplus.com/tutorials/android/android-compatibility-working-with-fragments/

    However, this no longer works. Instead, all I needed to do was right-click on my project in Eclipse and choose Android Tools-->Add Support Library...

    Doing this means it is no longer necessary to go to Java Build Path and click "Add External JARs..."

    Many thanks to eMich for this solution from: Jar-file issue with ADT r17

    0 讨论(0)
提交回复
热议问题