Question

I am simply trying to start my program but appear to have difficultly getting past this error. I did some researching and it seems to be linked with intent. I have double-checked my manifest file (which will be posted below) and the package names appear to be correct.

One thing that did catch my eye was the second line of the exception log. It is looking for

class "com.project.BluetoothTransfer_v1000" on path:

at /data/app/com.project.BluetoothTransfer_v1000-1.apk

Is that '-1' supposed to be there?

04-10 16:04:49.182: E/AndroidRuntime(30008): FATAL EXCEPTION: main
04-10 16:04:49.182: E/AndroidRuntime(30008): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.project.BluetoothTransfer_v1000/com.project.BluetoothTransfer_v1000.BluetoothTransferActivity}: java.lang.ClassNotFoundException: Didn't find class "com.project.BluetoothTransfer_v1000.BluetoothTransferActivity" on path: /data/app/com.project.BluetoothTransfer_v1000-1.apk
04-10 16:04:49.182: E/AndroidRuntime(30008):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2229)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2359)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at android.app.ActivityThread.access$700(ActivityThread.java:165)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1326)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at android.os.Looper.loop(Looper.java:137)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at android.app.ActivityThread.main(ActivityThread.java:5455)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at java.lang.reflect.Method.invokeNative(Native Method)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at java.lang.reflect.Method.invoke(Method.java:525)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at dalvik.system.NativeStart.main(Native Method)
04-10 16:04:49.182: E/AndroidRuntime(30008): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.project.BluetoothTransfer_v1000.BluetoothTransferActivity" on path: /data/app/com.project.BluetoothTransfer_v1000-1.apk
04-10 16:04:49.182: E/AndroidRuntime(30008):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:64)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
04-10 16:04:49.182: E/AndroidRuntime(30008):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2220)
04-10 16:04:49.182: E/AndroidRuntime(30008):    ... 11 more

Manifest:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.project.BluetoothTransfer_v1000"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.project.BluetoothTransfer_v1000"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
Was it helpful?

Solution

You are missing the name of the activity into the Manifest.xml

<activity
            android:name="com.project.BluetoothTransfer_v1000"

That´s the cause of the ClassNotFoundException:

 Caused by: java.lang.ClassNotFoundException: Didn't find class "com.project.BluetoothTransfer_v1000.BluetoothTransferActivity" on path: /data/app/com.project.BluetoothTransfer_v1000-1.apk

Add the name of your activity "BluetoothTransferActivity" into the Manifest.xml:

 <activity
            android:name="com.project.BluetoothTransfer_v1000.BluetoothTransferActivity"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top