ximsfei / Android-skin-support

Android-skin-support is an easy dynamic skin framework to use for Android, Only one line of code to integrate it. Android 换肤框架, 极低的学习成本, 极好的用户体验. "一行"代码就可以实现换肤, 你值得拥有!!!
MIT License
6.42k stars 1.08k forks source link

高德导航再fragment中,使用该换肤方案,所有的控件参数都获取不到 #436

Open zjc opened 3 years ago

zjc commented 3 years ago

江湖救急哈,群主

zjc commented 3 years ago

02-02 19:14:55.397 15738 15738 W System.err: android.view.InflateException: Binary XML file line #2 in com.amap.api.navi:layout/amap_navi_lbs_naviinfo_land: Binary XML file line #2 in com.amap.api.navi:layout/amap_navi_lbs_naviinfo_land: Error inflating class RelativeLayout 02-02 19:14:55.397 15738 15738 W System.err: Caused by: android.view.InflateException: Binary XML file line #2 in com.amap.api.navi:layout/amap_navi_lbs_naviinfo_land: Error inflating class RelativeLayout 02-02 19:14:55.397 15738 15738 W System.err: Caused by: android.content.res.Resources$NotFoundException: Drawable (missing name) with resource ID #0x7f02028c 02-02 19:14:55.397 15738 15738 W System.err: Caused by: android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f02028c 02-02 19:14:55.397 15738 15738 W System.err: at android.content.res.ResourcesImpl.getResourcePackageName(ResourcesImpl.java:407) 02-02 19:14:55.397 15738 15738 W System.err: at android.content.res.ResourcesImplEx.getResourcePackageName(ResourcesImplEx.java:50) 02-02 19:14:55.397 15738 15738 W System.err: at android.content.res.HwResourcesImpl.getThemePackageName(HwResourcesImpl.java:1872) 02-02 19:14:55.397 15738 15738 W System.err: at android.content.res.HwResourcesImpl.loadDrawable(HwResourcesImpl.java:1471) 02-02 19:14:55.397 15738 15738 W System.err: at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:920) 02-02 19:14:55.397 15738 15738 W System.err: at android.content.res.Resources.loadDrawable(Resources.java:1004) 02-02 19:14:55.397 15738 15738 W System.err: at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:1195) 02-02 19:14:55.397 15738 15738 W System.err: at android.content.res.TypedArray.getDrawable(TypedArray.java:1170) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.View.(View.java:5390) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.ViewGroup.(ViewGroup.java:707) 02-02 19:14:55.397 15738 15738 W System.err: at android.widget.RelativeLayout.(RelativeLayout.java:255) 02-02 19:14:55.397 15738 15738 W System.err: at android.widget.RelativeLayout.(RelativeLayout.java:251) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.widget.SkinCompatRelativeLayout.(SkinCompatRelativeLayout.java:23) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.widget.SkinCompatRelativeLayout.(SkinCompatRelativeLayout.java:19) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.app.SkinAppCompatViewInflater.createViewFromFV(SkinAppCompatViewInflater.java:72) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.app.SkinAppCompatViewInflater.createView(SkinAppCompatViewInflater.java:51) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.app.SkinCompatViewInflater.createViewFromInflater(SkinCompatViewInflater.java:77) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.app.SkinCompatViewInflater.createView(SkinCompatViewInflater.java:46) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.app.SkinCompatDelegate.createView(SkinCompatDelegate.java:70) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.app.SkinCompatDelegate.onCreateView(SkinCompatDelegate.java:31) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1071) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1007) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:971) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:669) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:503) 02-02 19:14:55.397 15738 15738 W System.err: at com.amap.api.col.3nsltp.jj.a(ResourcesUtil.java:263) 02-02 19:14:55.397 15738 15738 W System.err: at com.amap.api.navi.services.view.NaviInfoLayout_L.(NaviInfoLayout_L.java:1204) 02-02 19:14:55.397 15738 15738 W System.err: at com.hellobike.vvsmart.business.skin.view.SkinNaviInfoLayout_L.(SkinNaviInfoLayout_L.kt:25) 02-02 19:14:55.397 15738 15738 W System.err: at com.hellobike.vvsmart.business.skin.inflater.SkinAMapNaviViewInflater.createView(SkinAMapNaviViewInflater.kt:33) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.app.SkinCompatViewInflater.createViewFromInflater(SkinCompatViewInflater.java:77) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.app.SkinCompatViewInflater.createView(SkinCompatViewInflater.java:46) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.app.SkinCompatDelegate.createView(SkinCompatDelegate.java:70) 02-02 19:14:55.397 15738 15738 W System.err: at skin.support.app.SkinCompatDelegate.onCreateView(SkinCompatDelegate.java:31) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1071) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1007) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:971) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:1133) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1094) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:692) 02-02 19:14:55.397 15738 15738 W System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:503) 02-02 19:14:55.397 15738 15738 W System.err: at com.amap.api.col.3nsltp.jj.a(ResourcesUtil.java:263) 02-02 19:14:55.397 15738 15738 W System.err: at com.amap.api.col.3nsltp.gw.(AmapNaviViewCore.java:2311) 02-02 19:14:55.397 15738 15738 W System.err: at com.amap.api.navi.AMapNaviView.init(AMapNaviView.java:291) 02-02 19:14:55.397 15738 15738 W System.err: at com.amap.api.navi.AMapNaviView.(AMapNaviView.java:57) 02-02 19:14:55.397 15738 15738 W System.err: at com.hellobike.vvsmart.business.skin.view.SkinAMapNaviView.(SkinAMapNaviView.kt:29) 02-02 19:14:55.397 15738 15738 W System.err: at com.hellobike.vvsmart.business.skin.view.SkinAMapNaviView.(SkinAMapNaviView.kt:29)

初步怀疑是高德采用了加载assert目录中的资源作为加载,但是我们使用SkinBuildInLoader加载的时候,改变了高德的加载方式,导致资源找不到,去掉getDelegate方法就好了,好难!!!又想要导航,又想用这个换肤的框架...两难抉择

zjc commented 3 years ago

问题已解决了,由于高德库的问题,目前下最新的版本就可以了。遇到相同问题的可以使用AMap3DMap_7.8.0_AMapNavi_7.8.0_AMapSearch_7.7.0_AMapLocation_5.2.0_20210104.aar 这个是好的。实打实纠结了2天

OnlyChenDaDa commented 3 years ago

问题已解决了,由于高德库的问题,目前下最新的版本就可以了。遇到相同问题的可以使用AMap3DMap_7.8.0_AMapNavi_7.8.0_AMapSearch_7.7.0_AMapLocation_5.2.0_20210104.aar 这个是好的。实打实纠结了2天

救命恩人啊

zjc commented 2 years ago

这边还有一个方法,如果使用的jar包,可以单独写两个方法,白天黑夜或者其他样式,直接自己手动去换肤。去掉getDelegate的方法