0

Hi guys am trying to compile this code from Git hub but getting the error (app crashes the moment i try to start with)

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.viewpagerparallax/com.example.viewpagerparallax.MyTestActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.viewpagerparallax.MyTestActivity" on path: DexPathList[[zip file "/data/app/com.example.viewpagerparallax-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.viewpagerparallax-1, /vendor/lib, /system/lib]]

non of the stack overflow questions/solutions helped me.

Moreover when i switch to main.xml layout view it says

The following classes could not be found:
- com.example.viewpagerparallax (Fix Build Path, Edit XML, Create Class) 

although the .java file exist in the same package

and here is my manifest file (I have changed the package name to com.example.viewpagerparallax.MyTestActivity in my case ) here is the manifest file

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

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.viewpagerparallax.MyTestActivity"
            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>

This is the link which i am following

https://github.com/MatthieuLJ/ViewPagerParallax if u need the files please let me know.

Please Help Thanks in advance

Nihar
  • 553
  • 1
  • 10
  • 29

3 Answers3

0

Try this:

Go to Project/Properties/Java Build Path/Order and Export -- Make sure there's a check in front of Android Dependencies and the support library, if you use it.Mark all checkboxes.Click on Apply and clean the project.

Hope this helps.

Siddharth_Vyas
  • 9,972
  • 10
  • 39
  • 69
  • i can find android dependencies but not support library do u mean the android private libraries,even then both of them are ticked. – Nihar Dec 03 '13 at 11:47
0

In my case this error was raised because i had some code lines in resource files or Manifest.xml that are inserted by SVN Client like smartSVN or tortoise.

    <<<<<<< .mine
        <string name="pathConfiguration">http://jorgesys/app/config_development.xml</string>
    =======    

    >>>>>>> .r124
<<<<<<< .mine

So removing that lines

<string name="pathConfiguration">http://jorgesys/app/config_development.xml</string>

it will fix the exception.

Jorgesys
  • 124,308
  • 23
  • 334
  • 268
0

If you add additional libs to your project you need to export them with your project in case that some classes excluded.

I already answer the question, that will fix the problem with ease. see it here

Community
  • 1
  • 1
Logan Guo
  • 865
  • 4
  • 17
  • 35