Skadlig
Skadlig

Reputation: 1579

ClassNotFoundException when debugging android app

I get ClassNotFoundException when I try to debug my application on Eclipse. I'm using an Asus Transformer Pad TF300T with android version 4.1.1 at my home computer. Doing the same thing on my work computer but with a Samsung Galaxy 10.1 with android version 3.2 everything works fine. This is the message I receive:

11-22 09:15:14.313: E/AndroidRuntime(2609): FATAL EXCEPTION: main
11-22 09:15:14.313: E/AndroidRuntime(2609): java.lang.RuntimeException: Unable to get  
       provider com.company.bill.contentprovider.BillProvider:  
       java.lang.ClassNotFoundException: com.company.bill.contentprovider.BillProvider

Names has been changed to protect the innocent ;)
I'm guessing that there is some problem with my environment but I haven't been able to figure out why. On my Assus I turned on the development options, USB debugging, Stay awake and allow Unknown Sources.

I have tried turning of the break point for ClassNotFound in eclipse but it doesn't change anything. I have also tried running eclipse as admin but it didn't help.

I got Eclipse Juno and windows 7 64-bit.

EDIT:
manifest file

  <application  
             android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" android:theme="@android:style/Theme.Light" android:testOnly="false" android:debuggable="true">  
        <activity android:name=".LoginActivity" 
            android:label="@string/app_name" android:screenOrientation="landscape" android:exported="true">  
            <intent-filter>  
                <action android:name="android.intent.action.MAIN" />  
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

Upvotes: 4

Views: 1099

Answers (3)

Mehul Ranpara
Mehul Ranpara

Reputation: 4255

try this way...

  1. Right click on your project and go to Properties.
  2. go to java build path..//which is on the 5th position on left side
  3. go to Order and Export tab.
  4. check(Tick Mark) on your selected jar file. and click ok.
  5. Now, clean your project and Run.

Upvotes: 0

Skadlig
Skadlig

Reputation: 1579

I was able to fix it my self.
I downloaded the Android Support Library using Android SDK Manager and that fixed it.

Upvotes: 1

Talha
Talha

Reputation: 12717

did you add your activity declaration to your manifest file ?

Upvotes: 2

Related Questions