```
 FATAL EXCEPTION: main
 E/AndroidRuntime(5553): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appkraft.parallax_sample/com.appkraft.parallax_sample.MainActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class com.appkraft.parallax_sample
 E/AndroidRuntime(5553):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343)
 E/AndroidRuntime(5553):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395)
 E/AndroidRuntime(5553):    at android.app.ActivityThread.access$600(ActivityThread.java:162)
 E/AndroidRuntime(5553):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
 E/AndroidRuntime(5553):    at android.os.Handler.dispatchMessage(Handler.java:107)
 E/AndroidRuntime(5553):    at android.os.Looper.loop(Looper.java:194)
 E/AndroidRuntime(5553):    at android.app.ActivityThread.main(ActivityThread.java:5371)
 E/AndroidRuntime(5553):    at java.lang.reflect.Method.invokeNative(Native Method)
 E/AndroidRuntime(5553):    at java.lang.reflect.Method.invoke(Method.java:525)
 E/AndroidRuntime(5553):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
 E/AndroidRuntime(5553):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
 E/AndroidRuntime(5553):    at dalvik.system.NativeStart.main(Native Method)
 E/AndroidRuntime(5553): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class com.appkraft.parallax_sample
 E/AndroidRuntime(5553):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
 E/AndroidRuntime(5553):    at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
 E/AndroidRuntime(5553):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
 E/AndroidRuntime(5553):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
 E/AndroidRuntime(5553):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:281)
 E/AndroidRuntime(5553):    at android.app.Activity.setContentView(Activity.java:1881)
 E/AndroidRuntime(5553):    at com.appkraft.parallax_sample.MainActivity.onCreate(MainActivity.java:18)
 E/AndroidRuntime(5553):    at android.app.Activity.performCreate(Activity.java:5122)
 E/AndroidRuntime(5553):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
 E/AndroidRuntime(5553):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
 E/AndroidRuntime(5553): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.appkraft.parallax_sample" on path: DexPathList[[zip file "/data/app/com.appkraft.parallax_sample-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.appkraft.parallax_sample-1, /vendor/lib, /system/lib]]
 E/AndroidRuntime(5553):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
 E/AndroidRuntime(5553):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
 E/AndroidRuntime(5553):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
 E/AndroidRuntime(5553):    at android.view.LayoutInflater.createView(LayoutInflater.java:552)
 E/AndroidRuntime(5553):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)

```

What ever the classes the logcat is referring are present in their respective paths. Why I am still getting this error ,has it something to do with the main.xml?

Any help is appreciated.

Here is the `onCreate()` method.

```
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        parallax = (ParallaxScrollView) findViewById(R.id.scrollView1);
        image = (ImageView) findViewById(R.id.imageView1);

        parallax.setImageViewToParallax(image);

    }

```

here is main.xml

```
<com.appkraft.parallax_sample xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res/com.appkraft.parallax_sample"
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:overScrollMode="never">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="1000dp"
        tools:context=".MainActivity" >

        <RelativeLayout
            android:id="@+id/relativeLayout1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            tools:context=".MainActivity" >

            <ImageView
                android:id="@+id/imageView1"
                android:layout_width="match_parent"
                android:layout_height="100dp"
                android:src="@drawable/teste" />

            <TextView
                android:id="@+id/textView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentLeft="true"
                android:text="Bottom"
                android:textColor="#ffffff"
                android:textSize="18sp" />

            <TextView
                android:id="@+id/textView2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:text="Top"
                android:textColor="#ffffff"
                android:textSize="18sp" />
        </RelativeLayout>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/relativeLayout1"
            android:text="@string/hello_world" />
    </RelativeLayout>

</com.appkraft.parallax_sample>

```

While switching to graphical layout it says:

Exception raised during rendering: com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroup
Exception details are logged in Window > Show View > Error Log
The following classes could not be found:
- com.appkraft.parallax\_sample (Fix Build Path, Edit XML, Create Class)