Error “Caused by: java.lang.ClassNotFoundException:”

后端 未结 4 742
面向向阳花
面向向阳花 2021-01-20 14:21

During android vogella tutorial regarding to sqlite I have encountered annoying problem with following error:

09-05 09:18:06.127: E/AndroidRuntime(981): Cau         


        
相关标签:
4条回答
  • 2021-01-20 14:59

    Dont forget to declare the content provider in your Manifest.

    0 讨论(0)
  • 2021-01-20 15:06

    Change this line in your Code :

    <provider
            android:name="de.vogella.android.todos.contentprovider.MyTodoContentProvider"
            android:authorities="de.vogella.android.todos.contentproviderxxxxxxx" >
    </provider>
    


    Your problem will be solved.

    0 讨论(0)
  • 2021-01-20 15:12

    No com.example is not a standard package name, It is generated according to the AndroidManifest.xml file that is located at the root of the project.

    At the manifest file there is an attribute called package which gives the application a unique name.

    Please check the manifest file and to my best guess, fix the package attribute as

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="de.vogella.android.todos"
    
    0 讨论(0)
  • 2021-01-20 15:17

    I had this problem once. The code was working previously and suddenly it stopped working (crash at app startup) when I synced and built an older version of the code.

    The fix was to just close and restart Eclipse and clean the project and clean all the dependent library projects. Then it started working properly again.

    It's some sort of build problem in Eclipse, when refreshing the project files.

    Update: In particular, if you've accidentally modified the ".classpath" file (to revert to an older version), Eclipse/Android SDK can get confused and not build the project properly. When you restart Eclipse and clean the project, Eclipse will re-modify the ".classpath" file, and build properly.

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