facebookarchive / shimmer-android

An easy, flexible way to add a shimmering effect to any view in an Android app.
http://facebook.github.io/shimmer-android/
Other
5.32k stars 695 forks source link

In the new android studio 3.0. I am getting this exception with the shimmerlayout #35

Closed guruprasad757 closed 6 years ago

guruprasad757 commented 7 years ago

FATAL EXCEPTION: main Process: app.geniestation.com.corporate, PID: 24049 java.lang.RuntimeException: Unable to start activity ComponentInfo{app.geniestation.com.corporate/app.geniestation.com.corporate.activities.MainActivity}: android.view.InflateException: Binary XML file line #29: Binary XML file line #43: Error inflating class com.facebook.shimmer.ShimmerFrameLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by: android.view.InflateException: Binary XML file line #29: Binary XML file line #43: Error inflating class com.facebook.shimmer.ShimmerFrameLayout Caused by: android.view.InflateException: Binary XML file line #43: Error inflating class com.facebook.shimmer.ShimmerFrameLayout Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:334) at android.view.LayoutInflater.createView(LayoutInflater.java:647) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) at android.view.LayoutInflater.rInflate(LayoutInflater.java:863) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.rInflate(LayoutInflater.java:866) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.rInflate(LayoutInflater.java:866) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.rInflate(LayoutInflater.java:866) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:995) at android.view.LayoutInflater.rInflate(LayoutInflater.java:859) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at app.geniestation.com.corporate.fragments.MainFragment.onCreateView(MainFragment.java:67) at android.support.v4.app.Fragment.performCreateView(Fragment.java:2261) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1419) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1750) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1819) at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797) at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2590) at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2377) at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2332) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2239) at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3231) at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3181) at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:192) at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:572) at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177) 10-26 16:23:34.234 24049-24049/app.geniestation.com.corporate E/AndroidRuntime: at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1333) at android.app.Activity.performStart(Activity.java:6992) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2780) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by: java.lang.NumberFormatException: For input string: ".6" at java.lang.Integer.parseInt(Integer.java:597) at com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:133) at android.content.res.TypedArray.getInt(TypedArray.java:375) at com.facebook.shimmer.ShimmerFrameLayout.(ShimmerFrameLayout.java:175) at com.facebook.shimmer.ShimmerFrameLayout.(ShimmerFrameLayout.java:147) ... 45 more

aperfilyev commented 7 years ago

As a workaround, remove app:base_alpha="0.6" from your layout xml and set it at runtime using com.facebook.shimmer.ShimmerFrameLayout#setBaseAlpha

patrickmuhi commented 7 years ago

Had the same issue, it's because it's targeting old android v21. i did this.

PS: if you get "shape" error, duplicate style.e.t.c... rename the style.

xiphirx commented 6 years ago

544c5687cc0f1b2e976cd43e806a5f82e81d6462