Error inflating class com.telerik.widget.list.RadListView

3 posts, 0 answers
  1. Sandeep
    Sandeep avatar
    2 posts
    Member since:
    Dec 2015

    Posted 03 Feb Link to this post

    Hello,

    I am using Telerik for android in eclipse, I had followed all the guide lines in the documentation but I got the following error when I had used RadListview

    02-03 18:05:35.217: E/AndroidRuntime(29700): FATAL EXCEPTION: main
    02-03 18:05:35.217: E/AndroidRuntime(29700): Process: com.test.teleriktest, PID: 29700
    02-03 18:05:35.217: E/AndroidRuntime(29700): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.teleriktest/com.test.teleriktest.MainActivity}: android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class com.telerik.widget.list.RadListView
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2426)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2490)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.app.ActivityThread.-wrap11(ActivityThread.java)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.os.Handler.dispatchMessage(Handler.java:102)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.os.Looper.loop(Looper.java:148)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.app.ActivityThread.main(ActivityThread.java:5443)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at java.lang.reflect.Method.invoke(Native Method)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
    02-03 18:05:35.217: E/AndroidRuntime(29700): Caused by: android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class com.telerik.widget.list.RadListView
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:393)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.app.Activity.setContentView(Activity.java:2170)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at com.test.teleriktest.MainActivity.onCreate(MainActivity.java:18)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.app.Activity.performCreate(Activity.java:6245)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1130)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
    02-03 18:05:35.217: E/AndroidRuntime(29700): ... 9 more
    02-03 18:05:35.217: E/AndroidRuntime(29700): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.telerik.widget.list.RadListView
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
    02-03 18:05:35.217: E/AndroidRuntime(29700): ... 17 more
    02-03 18:05:35.217: E/AndroidRuntime(29700): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.telerik.widget.list.RadListView" on path: DexPathList[[zip file "/data/app/com.test.teleriktest-2/base.apk"],nativeLibraryDirectories=[/data/app/com.test.teleriktest-2/lib/arm, /vendor/lib, /system/lib]]
    02-03 18:05:35.217: E/AndroidRuntime(29700): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.view.LayoutInflater.createView(LayoutInflater.java:583)
    02-03 18:05:35.217: E/AndroidRuntime(29700): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
    02-03 18:05:35.217: E/AndroidRuntime(29700): ... 21 more

     

    project.properties

    target=android-23
    android.library.reference.1=../../android-sdk-linux/extras/android/support/v7/appcompat
    android.library.reference.2=../../Application Stuff/Telerik/UI for Android Q3 2015/Controls/Eclipse/Input
    android.library.reference.3=../../Application Stuff/Telerik/UI for Android Q3 2015/Controls/Eclipse/Common
    android.library.reference.5=../../Application Stuff/Telerik/UI for Android Q3 2015/Controls/Eclipse/List
    android.library.reference.4=../../Application Stuff/Telerik/UI for Android Q3 2015/Controls/Eclipse/Data
    android.library.reference.6=../../android-sdk-linux/extras/android/support/v7/recyclerview

    MainActivity.java

    package com.test.teleriktest;

    import java.util.ArrayList;
    import java.util.List;

    import com.example.teleriktest.City;
    import com.telerik.widget.list.ListViewAdapter;
    import com.telerik.widget.list.RadListView;

    import android.app.Activity;
    import android.os.Bundle;

    public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
     RadListView listView = (RadListView)findViewById(R.id.listView);
     ListViewAdapter listViewAdapter = new ListViewAdapter(getListOfCities());
     listView.setAdapter(listViewAdapter);
     
    }private List<City> getListOfCities() {
       List<City> cities = new ArrayList<City>();
       cities.add(new City("London", "United Kingdom"));
       cities.add(new City("Berlin", "Germany"));
       cities.add(new City("Madrid", "Spain"));
       cities.add(new City("Rome", "Italy"));
       cities.add(new City("Paris", "France"));
       cities.add(new City("Hamburg", "Germany"));
       cities.add(new City("Barcelona", "Spain"));
       cities.add(new City("Munich", "Germany"));
       cities.add(new City("Milan", "Italy"));
       cities.add(new City("Cologne", "Germany"));
       return cities;
    }
    }

     activity_main.xml

     

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/main_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        tools:context="${relativePackage}.${activityClass}" >

        <com.telerik.widget.list.RadListView
            android:id="@+id/listView"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </LinearLayout>

     

    Please help me to resolve this issue.

  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 08 Feb Link to this post

    Hello Sandeep,

    The error sounds like you haven't correctly built the referenced libraries so RadListView is not found. Please make sure you have followed each step from our getting started guidelines. Also try to build your workspace and check for other errors (if the List library, or one of its dependencies, has errors, it can't be built and therefore RadListView can't be found). Ensure that the referenced libraries are built successfully and let us know if there are issues which prevent you from building them.

    P.S. Have a look at this statement from Google which suggests migrating to Android Studio and shows the steps to do it.

    Regards,
    Todor
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Meghana
    Meghana avatar
    7 posts
    Member since:
    Jun 2015

    Posted 14 Mar Link to this post

    Hi Sandeep,

     The initial steps of ListView Configuration are quite problematic. I had the same problem but then I just imported all other telerik .aar files in my project and this error was solved. Hope this will help you.

Back to Top