1

I try to start program sample from this GIT hub's link : https://github.com/yandex-money/yandex-money-sdk-android. I use Eclipse. But when it is begin running, an error appears : one of them - Unable to instantiate activity ComponentInfo java.lang.ClassNotFoundException. The logcat below:

W/dalvikvm(4201): threadid=1: thread exiting with uncaught exception (group=0x40af49f0)
E/AndroidRuntime(4201): FATAL EXCEPTION: main
E/AndroidRuntime(4201): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{ru.yandex.money.android.sample/ru.yandex.money.android.sample.MainActivity}: java.lang.ClassNotFoundException: ru.yandex.money.android.sample.MainActivity
E/AndroidRuntime(4201):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
E/AndroidRuntime(4201):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
E/AndroidRuntime(4201):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
E/AndroidRuntime(4201):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
E/AndroidRuntime(4201):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(4201):     at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(4201):     at android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime(4201):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(4201):     at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(4201):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
E/AndroidRuntime(4201):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
E/AndroidRuntime(4201):     at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(4201): Caused by: java.lang.ClassNotFoundException: ru.yandex.money.android.sample.MainActivity
E/AndroidRuntime(4201):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
E/AndroidRuntime(4201):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/AndroidRuntime(4201):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/AndroidRuntime(4201):     at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
E/AndroidRuntime(4201):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
E/AndroidRuntime(4201):     ... 11 more

This is a content of my manifest-file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="ru.yandex.money.android.sample" >

    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <activity
            android:name="ru.yandex.money.android.sample.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>

        <activity
            android:name="ru.yandex.money.android.sample.PayActivity"/>

    </application>

</manifest

> From primary code I have been changed two things: I have been changed android version from 2.1 to 3.0 and in styles.xml file I have been replaced string <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar"> to <style name="AppTheme" parent="android:Theme.Holo">. Where is cause of error?

pragmus
  • 3,513
  • 3
  • 24
  • 46
  • Looks like you aren't compiling the MainActivity class as part of your application. Perhaps you just wanted the PayActivity class as an example? try replacing MainActivity with PayActivity in the manifest and then remove the last activity tag (the normal PayActivity tag). It's only a shot in the dark but worth a go. – Lex - Boycott Slack - see bio Aug 04 '14 at 18:01
  • possible duplicate of [Android: Unable to instantiate activity / ClassNotFoundException](http://stackoverflow.com/questions/4820554/android-unable-to-instantiate-activity-classnotfoundexception) – Paul Sweatte Jul 28 '15 at 18:01
  • Possible duplicate of [java.lang.ClassNotFoundException android + eclipse + maven + osx](http://stackoverflow.com/questions/20855072/java-lang-classnotfoundexception-android-eclipse-maven-osx) – Paul Sweatte Dec 06 '16 at 16:33

0 Answers0