Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inflating error #3

Closed
HAndroid opened this issue Apr 9, 2013 · 19 comments
Closed

Inflating error #3

HAndroid opened this issue Apr 9, 2013 · 19 comments
Assignees

Comments

@HAndroid
Copy link

HAndroid commented Apr 9, 2013

Hello Dmitry,

First Many thanks for this important library, i really needed it ..
But seems i am missing something cause i am getting an inflating error :(
I followed the steps exactly, and checked your example too.. Can't find what is wrong ..
I saw another issue where you replied it might be an issue in manifest file, but i can't see any special line added to the example manifest file ..
Would you kindly help me?

android.view.InflateException: Binary XML file line #29: Error inflating class ru.biovamp.widget.CircleLayout

and that is line 29

<ru.biovamp.widget.CircleLayout

Thanks.

@ghost ghost assigned dmitry-zaitsev Apr 9, 2013
@dmitry-zaitsev
Copy link
Owner

@HAndroid Hello, thanks for your reply.

Can you provide your XML layout file?
Also, make sure that you added CircleLayout as Android Library to your project.

@HAndroid
Copy link
Author

HAndroid commented Apr 9, 2013

Yes. Circle Layout is added as Library ..
Kindly find below the XML

<RelativeLayout 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.Tests.CircleTest"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg"
tools:context=".MainActivity" >

<ImageView
    android:id="@+id/menu_top"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:scaleType="centerCrop"
    android:src="@drawable/top" />

<ru.biovamp.widget.CircleLayout
    android:id="@+id/circle"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/menu_bottom"
    android:layout_below="@+id/menu_top"
    android:visibility="gone"
    app:angleOffset="90" >

    <ImageButton
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="@android:color/transparent"
        android:scaleType="fitXY"
        android:src="@drawable/on" />

    <ImageButton
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="@android:color/transparent"
        android:scaleType="fitXY"
        android:src="@drawable/on" />

    <ImageButton
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="@android:color/transparent"
        android:scaleType="fitXY"
        android:src="@drawable/on" />

    <ImageButton
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="@android:color/transparent"
        android:scaleType="fitXY"
        android:src="@drawable/on" />

    <ImageButton
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="@android:color/transparent"
        android:scaleType="fitXY"
        android:src="@drawable/on" />

    <ImageButton
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="@android:color/transparent"
        android:scaleType="fitXY"
        android:src="@drawable/on" />


</ru.biovamp.widget.CircleLayout>

<ImageView
    android:id="@+id/menu_bottom"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:scaleType="centerCrop"
    android:src="@drawable/bottom" />

</RelativeLayout>

@HAndroid
Copy link
Author

HAndroid commented Apr 9, 2013

I also tried to use your same XML example, and got same inflating error, can't find what is missing..

<FrameLayout 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.Tests.CircleTest"
android:layout_width="match_parent"
android:layout_height="match_parent" >


<ru.biovamp.widget.CircleLayout
    android:id="@+id/normal"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white"
    android:visibility="gone"
    app:angleOffset="90" >

    <View
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="#ff0000" />

    <View
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="#00ff00" />

    <View
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="#0000ff" />

    <View
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="#ffff00" />

    <View
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="#ff00ff" />
</ru.biovamp.widget.CircleLayout>



 </FrameLayout>

@dmitry-zaitsev
Copy link
Owner

Are you getting this error during build or at runtime?

@HAndroid
Copy link
Author

HAndroid commented Apr 9, 2013

And this is screenshot for library:
library

@HAndroid
Copy link
Author

HAndroid commented Apr 9, 2013

During Runtime

@dmitry-zaitsev
Copy link
Owner

Can you please post your LogCat trace here?

@HAndroid
Copy link
Author

HAndroid commented Apr 9, 2013

Below is complete LogCat for the XML same to example, so inflating is at line 8 instead of 29:

04-09 16:38:44.265: W/dalvikvm(22382): VFY: unable to resolve static field 890 (CircleLayout) in Lru/biovamp/widget/R$styleable;
04-09 16:38:44.285: D/dalvikvm(22382): VFY: replacing opcode 0x62 at 0x0029
04-09 16:38:44.285: D/dalvikvm(22382): VFY: dead code 0x002b-0097 in Lru/biovamp/widget/CircleLayout;. (Landroid/content/Context;Landroid/util/AttributeSet;)V
04-09 16:38:44.295: D/AndroidRuntime(22382): Shutting down VM
04-09 16:38:44.295: W/dalvikvm(22382): threadid=1: thread exiting with uncaught exception (group=0x2aac8578)
04-09 16:38:44.305: E/AndroidRuntime(22382): FATAL EXCEPTION: main
04-09 16:38:44.305: E/AndroidRuntime(22382): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Tests.CircleTest/com.Tests.CircleTest.MainActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class ru.biovamp.widget.CircleLayout
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.app.ActivityThread.access$1500(ActivityThread.java:121)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.os.Handler.dispatchMessage(Handler.java:99)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.os.Looper.loop(Looper.java:138)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.app.ActivityThread.main(ActivityThread.java:3701)
04-09 16:38:44.305: E/AndroidRuntime(22382): at java.lang.reflect.Method.invokeNative(Native Method)
04-09 16:38:44.305: E/AndroidRuntime(22382): at java.lang.reflect.Method.invoke(Method.java:507)
04-09 16:38:44.305: E/AndroidRuntime(22382): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
04-09 16:38:44.305: E/AndroidRuntime(22382): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
04-09 16:38:44.305: E/AndroidRuntime(22382): at dalvik.system.NativeStart.main(Native Method)
04-09 16:38:44.305: E/AndroidRuntime(22382): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class ru.biovamp.widget.CircleLayout
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-09 16:38:44.305: E/AndroidRuntime(22382): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.app.Activity.setContentView(Activity.java:1657)
04-09 16:38:44.305: E/AndroidRuntime(22382): at com.Tests.CircleTest.MainActivity.onCreate(MainActivity.java:12)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
04-09 16:38:44.305: E/AndroidRuntime(22382): ... 11 more
04-09 16:38:44.305: E/AndroidRuntime(22382): Caused by: java.lang.reflect.InvocationTargetException
04-09 16:38:44.305: E/AndroidRuntime(22382): at java.lang.reflect.Constructor.constructNative(Native Method)
04-09 16:38:44.305: E/AndroidRuntime(22382): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
04-09 16:38:44.305: E/AndroidRuntime(22382): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
04-09 16:38:44.305: E/AndroidRuntime(22382): ... 21 more
04-09 16:38:44.305: E/AndroidRuntime(22382): Caused by: java.lang.NoClassDefFoundError: ru.biovamp.widget.R$styleable
04-09 16:38:44.305: E/AndroidRuntime(22382): at ru.biovamp.widget.CircleLayout.(CircleLayout.java:87)
04-09 16:38:44.305: E/AndroidRuntime(22382): ... 24 more

@dmitry-zaitsev
Copy link
Owner

Looks like that CircleLayout isn't added. Since you've provided screenshot, it looks like that you need to build it manually.

Select CircleLayout in your project list. Then in menu (that one on the top) Project->Build.

@HAndroid
Copy link
Author

HAndroid commented Apr 9, 2013

The option was build automatically .. But i removed the automatic build, built it manually again, re added it to my project and still same error :(

@dmitry-zaitsev
Copy link
Owner

Try to change your build target to latest version (4.1.2).

Actually, always consider building with latest version of SDK (buildTarget != min SDK version supported, so don't worry).

@HAndroid
Copy link
Author

HAndroid commented Apr 9, 2013

Greaaat, the runtime inflating error solved now with build Target 16 :)
But sorry another issue arised, nothing is drawn, just an empty screen :(

@dmitry-zaitsev
Copy link
Owner

Which layout you are using? If your own - remove visibility="gone" :)

@HAndroid
Copy link
Author

HAndroid commented Apr 9, 2013

Thanks a million for help and time :))))) it is great now ..

@HAndroid
Copy link
Author

HAndroid commented Apr 9, 2013

Just a last question please, do you have the calculations restricting the views to 50 dp width and height like the example? cause when i try to make higher , it doesn't fit the screen.. screenshot below for 100 dp.... yellow and green ones got cropped ..
screenshot circle test

@dmitry-zaitsev
Copy link
Owner

There is no restrictions. This is how CircleLayout calculates its size now - it can't perform automatic resizing of views. If this is required - please, create new issue and I'll try to implement this feature.

@HAndroid
Copy link
Author

HAndroid commented Apr 9, 2013

It will be helpful to have such feature..
Anyway no worry, i don't want to waste your time, i will try to manage it ..
Many thanks for your help, I am new to github and didn't know how to recommend your code, so just starred the repo, if any other way, please let me know.. thanks again for your help ..

@dmitry-zaitsev
Copy link
Owner

@HAndroid thanks for your attention. If you're happy with this library - this is enough for me )

@nikolaykuz
Copy link

Seems like I had the same problem. I will read this topic and example when back to Android development.
Thanks, Dmitry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants