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

android.view.InflateException: Binary XML file line #23: Binary XML file line #23: Error inflating class com.facebook.drawee.view.SimpleDraweeView #4

Closed
han361769045 opened this issue Aug 17, 2016 · 6 comments

Comments

@han361769045
Copy link

han361769045 commented Aug 17, 2016

08-17 07:01:37.797 24906-24906/com.zczczy.leo.fuwuwangapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.zczczy.leo.fuwuwangapp, PID: 24906
android.view.InflateException: Binary XML file line #23: Binary XML file line #23: Error inflating class com.facebook.drawee.view.SimpleDraweeView
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at com.uuch.adlibrary.AdManager$AdAdapter.instantiateItem(AdManager.java:181)
at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:1003)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1151)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1085)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1611)
at android.view.View.measure(View.java:18788)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure(View.java:18788)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:18788)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure(View.java:18788)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure(View.java:18788)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643)
at android.view.View.measure(View.java:18788)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #23: Error inflating class com.facebook.drawee.view.SimpleDraweeView
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
at com.uuch.adlibrary.AdManager$AdAdapter.instantiateItem(AdManager.java:181) 
at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:1003) 
at android.support.v4.view.ViewPager.populate(ViewPager.java:1151) 
at android.support.v4.view.ViewPager.populate(ViewPager.java:1085) 
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1611) 
at android.view.View.measure(View.java:18788) 
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) 
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) 
at android.view.View.measure(View.java:18788) 
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) 
at android.view.View.measure(View.java:18788) 
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) 
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) 
at android.view.View.measure(View.java:18788) 
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) 
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) 
at android.view.View.measure(View.java:18788) 
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) 
at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643) 
at android.view.View.measure(View.java:18788) 
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100) 
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216) 
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452) 
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) 
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) 
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) 
at android.view.Choreographer.doCallbacks(Choreographer.java:670) 
at android.view.Choreographer.doFrame(Choreographer.java:606) 
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) 
at android.os.Handler.handleCallback(Handler.java:739) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
at com.uuch.adlibrary.AdManager$AdAdapter.instantiateItem(AdManager.java:181) 
at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:1003) 
at android.support.v4.view.ViewPager.populate(ViewPager.java:1151) 
at android.support.v4.view.ViewPager.populate(ViewPager.java:1085) 
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1611) 
at android.view.View.measure(View.java:18788) 
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) 
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) 
at android.view.View.measure(View.java:18788) 
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) 
at android.view.View.measure(View.java:18788) 
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) 
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) 
at android.view.View.measure(View.java:18788) 
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) 
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) 
at android.view.View.measure(View.java:18788) 
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) 
at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643) 
at android.view.View.measure(View.java:18788) 
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100) 
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216) 
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452) 
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) 
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) 
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) 
at android.view.Choreographer.doCallbacks(Choreographer.java:670) 
at android.view.Choreographer.doFrame(Choreographer.java:606) 
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) 
at android.os.Handler.handleCallback(Handler.java:739) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
Caused by: java.lang.NullPointerException: SimpleDraweeView was not initialized!
at com.facebook.common.internal.Preconditions.checkNotNull(Preconditions.java:226)
at com.facebook.drawee.view.SimpleDraweeView.init(SimpleDraweeView.java:81)
at com.facebook.drawee.view.SimpleDraweeView.(SimpleDraweeView.java:63)
at java.lang.reflect.Constructor.newInstance(Native Method) 
at android.view.LayoutInflater.createView(LayoutInflater.java:619) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
at com.uuch.adlibrary.AdManager$AdAdapter.instantiateItem(AdManager.java:181) 
at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:1003) 
at android.support.v4.view.ViewPager.populate(ViewPager.java:1151) 
at android.support.v4.view.ViewPager.populate(ViewPager.java:1085) 
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1611) 
at android.view.View.measure(View.java:18788) 
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) 
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) 
at android.view.View.measure(View.java:18788) 
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) 
at android.view.View.measure(View.java:18788) 
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) 
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) 
at android.view.View.measure(View.java:18788) 
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) 
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) 
at android.view.View.measure(View.java:18788) 
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) 
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) 
at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643) 
at android.view.View.measure(View.java:18788) 
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100) 
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216) 
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452) 
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) 
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) 
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) 
at android.view.Choreographer.doCallbacks(Choreographer.java:670) 
at android.view.Choreographer.doFrame(Choreographer.java:606) 
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) 
at android.os.Handler.handleCallback(Handler.java:739) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

@han361769045
Copy link
Author

List advList = new ArrayList<>();
for (AdvertModel am : app.getHomePupAd()) {
AdInfo adInfo = new AdInfo();
adInfo.setActivityImg(am.AdvertImg);
advList.add(adInfo);
}
AdManager adManager = new AdManager(getActivity(), advList);
adManager.setOverScreen(true)
.setPageTransformer(new DepthPageTransformer());
adManager.showAdDialog(AdConstant.ANIM_UP_TO_DOWN);

@han361769045
Copy link
Author

image

@yipianfengye
Copy link
Owner

应该是fresco库没下载下来,clean或者是rebuild一下试试呢

@star-andy
Copy link

我也出现了相同的问题,发现fresco库已经同步下来,clean和rebuild都不起作用
@han361769045 @yipianfengye

@star-andy
Copy link

@yipianfengye 找到原因了,如果依赖你库的app有Application就会覆盖掉你库中的LApplication,导致fresco初始化失败。 请有时间修正下 去掉库中的LApplication,放在其他地方初始化。

@yecaler
Copy link

yecaler commented Nov 29, 2019

在你的Application里初始化这些内容:

Fresco.initialize(this); DisplayMetrics dm = getResources().getDisplayMetrics(); DisplayUtil.density = dm.density; DisplayUtil.densityDPI = dm.densityDpi; DisplayUtil.screenWidthPx = dm.widthPixels; DisplayUtil.screenhightPx = dm.heightPixels; DisplayUtil.screenWidthDip = DisplayUtil.px2dip(getApplicationContext(), dm.widthPixels); DisplayUtil.screenHightDip = DisplayUtil.px2dip(getApplicationContext(), dm.heightPixels);

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

4 participants