Giter VIP home page Giter VIP logo

Comments (6)

h6ah4i avatar h6ah4i commented on July 18, 2024

@Yussef123 Hi. Could you tell me about the detail of how to reproduce the issue? Thanks.

from android-materialshadowninepatch.

yussefbens avatar yussefbens commented on July 18, 2024

When I wanted to inflate the layout that contains com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView in my recyclerview :

@Override
    public AppHolder onCreateViewHolder(ViewGroup viewGroup, int i) {

        View row = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.app_row_layout, viewGroup, false);

        AppHolder holder = new AppHolder(row, i);
        return holder;
    }

it produce this error :

android.view.InflateException: Binary XML file line #15: Error inflating class com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView
            at android.view.LayoutInflater.createView(LayoutInflater.java:613)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at com.teallix.swipedge.app.drawer.AppAdapter.onCreateViewHolder(AppAdapter.java:41)
            at com.teallix.swipedge.app.drawer.AppAdapter.onCreateViewHolder(AppAdapter.java:26)
            at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:5482)
            at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4707)
            at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4617)
            at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1994)
            at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:528)
            at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1353)
            at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:574)
            at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170)
            at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3028)
            at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:2625)
            at android.view.View.measure(View.java:15518)
            at android.widget.RelativeLayout.measureChild(RelativeLayout.java:666)
            at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:477)
            at android.view.View.measure(View.java:15518)
            at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1874)
            at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1089)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1265)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
            at android.view.Choreographer.doCallbacks(Choreographer.java:562)
            at android.view.Choreographer.doFrame(Choreographer.java:532)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
            at android.os.Handler.handleCallback(Handler.java:725)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)

This is the recyclerView row layout :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/app_global_container"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content">
    <ImageView android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:layout_centerVertical="true"
               android:layout_centerHorizontal="true"
               android:id="@+id/large_icon"
               android:visibility="invisible"/>
    <com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView
            xmlns:android="http://schemas.android.com/apk/res/android"
            style="@style/ms9_DefaultShadowStyle"
            android:id="@+id/shadow_item_container"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
    >

        <RelativeLayout android:layout_width="75dp"
                        android:layout_height="88dp"
                        android:id="@+id/app_square"
                        android:background="#00f5f5f5"
                        android:layout_marginLeft="5dp"
                        android:layout_marginRight="5dp"
                        android:layout_marginTop="5dp"
                        android:layout_marginBottom="5dp"

        >
            <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content"
                          android:orientation="vertical"
                          android:layout_centerHorizontal="true"
                          android:layout_marginTop="4dp"
                          android:id="@+id/app_container"
            >
                <ImageView android:layout_width="48dp"
                           android:layout_height="48dp"
                           android:id="@+id/app_icon"
                           android:layout_gravity="center"
                           android:layout_marginBottom="4dp"
                />
                <TextView android:layout_width="66dp"
                          android:layout_height="wrap_content"
                          android:text="dsqsdqdspqdpqsdp"
                          android:id="@+id/app_name"
                          android:textSize="11sp"
                          android:textColor="#444"
                          android:textAlignment="center"
                />
            </LinearLayout>
        </RelativeLayout>
    </com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView>

</RelativeLayout>

THE FULL STACK :

android.view.InflateException: Binary XML file line #15: Error inflating class com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView
            at android.view.LayoutInflater.createView(LayoutInflater.java:613)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at com.teallix.swipedge.app.drawer.AppAdapter.onCreateViewHolder(AppAdapter.java:41)
            at com.teallix.swipedge.app.drawer.AppAdapter.onCreateViewHolder(AppAdapter.java:26)
            at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:5482)
            at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4707)
            at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4617)
            at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1994)
            at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:528)
            at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1353)
            at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:574)
            at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170)
            at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3028)
            at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:2625)
            at android.view.View.measure(View.java:15518)
            at android.widget.RelativeLayout.measureChild(RelativeLayout.java:666)
            at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:477)
            at android.view.View.measure(View.java:15518)
            at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1874)
            at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1089)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1265)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
            at android.view.Choreographer.doCallbacks(Choreographer.java:562)
            at android.view.Choreographer.doFrame(Choreographer.java:532)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
            at android.os.Handler.handleCallback(Handler.java:725)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.reflect.InvocationTargetException
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
            at android.view.LayoutInflater.createView(LayoutInflater.java:587)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at com.teallix.swipedge.app.drawer.AppAdapter.onCreateViewHolder(AppAdapter.java:41)
            at com.teallix.swipedge.app.drawer.AppAdapter.onCreateViewHolder(AppAdapter.java:26)
            at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:5482)
            at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4707)
            at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4617)
            at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1994)
            at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:528)
            at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1353)
            at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:574)
            at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170)
            at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3028)
            at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:2625)
            at android.view.View.measure(View.java:15518)
            at android.widget.RelativeLayout.measureChild(RelativeLayout.java:666)
            at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:477)
            at android.view.View.measure(View.java:15518)
            at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1874)
            at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1089)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1265)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
            at android.view.Choreographer.doCallbacks(Choreographer.java:562)
            at android.view.Choreographer.doFrame(Choreographer.java:532)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
            at android.os.Handler.handleCallback(Handler.java:725)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.content.res.Resources$NotFoundException: File res/drawable-tvdpi-v4/ms9_spot_shadow_z1.xml from drawable resource ID #0x7f0200e0
            at android.content.res.Resources.loadDrawable(Resources.java:1953)
            at android.content.res.Resources.getDrawable(Resources.java:660)
            at com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView.getNinePatchDrawableFromResource(MaterialShadowContainerView.java:311)
            at com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView.updateShadowLevelCompat(MaterialShadowContainerView.java:346)
            at com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView.updateShadowLevel(MaterialShadowContainerView.java:401)
            at com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView.<init>(MaterialShadowCon

Thank you 👍

from android-materialshadowninepatch.

h6ah4i avatar h6ah4i commented on July 18, 2024

Unfortunately, I cannot reproduce it yet :( Which version of Gradle plugin and build tools do you use? Also, do you use proguard in your project? Thanks. Okay, now I can reproduced it on a KitKat device. I'll take a look at it 👍

from android-materialshadowninepatch.

yussefbens avatar yussefbens commented on July 18, 2024

Okay thank you.

from android-materialshadowninepatch.

yussefbens avatar yussefbens commented on July 18, 2024

I found the solution, I was using newer version of Gradle
classpath 'com.android.tools.build:gradle:2.2.0-alpha1'
then I changed it to
classpath 'com.android.tools.build:gradle:1.2.3'

from android-materialshadowninepatch.

shakhawat3742 avatar shakhawat3742 commented on July 18, 2024

Best

from android-materialshadowninepatch.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.