0

I'm sure this is an easy fix and I Have checked other answers on Stackoverflow but just can't seem to find a solution

Here is my Log cat error

    E/AndroidRuntime(1164): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.teatimer/com.example.teatimer.MainActivity}: 
java.lang.ClassNotFoundException: Didn't find class "com.example.teatimer.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.teatimer-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.teatimer-2, /system/lib]]

And I realise that the problem is in my AndroidManifest.xml

  <application android:allowBackup="true"  android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.teatimer.MainActivity"
            android:label="@string/app_name"    >

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>

The class not found is com.example.teatimer.MainActivity but to me its in the manifest

Thanks for any help, much appreciated Its just I have been searching for an answer but just can's find one

Tarsem Singh
  • 14,139
  • 7
  • 51
  • 71
JohnnyQ
  • 484
  • 10
  • 23
  • possible duplicate of : http://stackoverflow.com/questions/4688277/java-lang-runtimeexception-unable-to-instantiate-activity-componentinfo – Mehdi Karamosly Aug 01 '13 at 19:44

1 Answers1

0

I don't know how it did it but the solution was

instead of

android:name="com.example.teatimer.MainActivity"

it should be

android:name="TeaTimerActivity"

I don't know why but com.example.teatimer/com.example.teatimer.MainActivity

is there but the path in there automatically and then the proper class is after it

Hope this helps other people!

JohnnyQ
  • 484
  • 10
  • 23
  • This answer makes no sense. This is not the correct use of the `android:name` attribute, and if this is working then you likely have other problems. What is the name of your class and what package is it in? What have you specified as the package name in the `` element of the AndroidManifest.xml file? – Alex MDC Aug 01 '13 at 20:06
  • You have most likely set up your package improperly – btse Aug 01 '13 at 20:21
  • My class is called TeaTimerActivity, not MainActivity, no other bugs found since. – JohnnyQ Aug 01 '13 at 21:38