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

启动页启动偶现闪退,指向换肤三方控件 #450

Open arronvera opened 3 years ago

arronvera commented 3 years ago

判断了是否是进程进行初始化,还是会闪退,在启动页create的时候

arronvera commented 3 years ago

三方textview

arronvera commented 3 years ago

image

andansky commented 3 years ago

问题同上: Caused by: java.lang.ExceptionInInitializerError at skin.support.content.res.SkinCompatUserThemeManager.get(SourceFile:124) at skin.support.content.res.SkinCompatVectorResources.a(SourceFile:62) at skin.support.content.res.SkinCompatVectorResources.getDrawableCompat(SourceFile:89) at skin.support.widget.SkinCompatImageHelper.applySkin(SourceFile:57) at skin.support.widget.SkinCompatImageHelper.loadFromAttributes(SourceFile:35) at com.bilin.skin.compatview.SkinTintImageButton.(SourceFile:37) at com.bilin.skin.compatview.SkinTintImageButton.(SourceFile:28) at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at android.view.LayoutInflater.createView(LayoutInflater.java:852) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:1261) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1117) ... 23 more Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String skin.support.utils.SkinPreference.getUserTheme()' on a null object reference at skin.support.content.res.SkinCompatUserThemeManager.d(SourceFile:64) at skin.support.content.res.SkinCompatUserThemeManager.(SourceFile:53) at skin.support.content.res.SkinCompatUserThemeManager.(SourceFile:39) ... 39 more

实现代码如下,catch也catch不住 public SkinTintImageButton(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mBackgroundTintHelper = new SkinCompatBackgroundHelper(this); mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr); mImageHelper = new SkinCompatImageHelper(this); try { mImageHelper.loadFromAttributes(attrs, defStyleAttr); } catch (Error e) { LogUtil.e("SkinTintImageButton", "Error" + e.getMessage()); } }

songsongtao commented 3 years ago

+1

Systhesis commented 2 years ago

+1

jarkeet commented 2 years ago

00 pc 0000000000055d60 /system/lib64/libandroidfw.so (android::ResStringPool::indexOfString(char16_t const*, unsigned long) const+72) [arm64-v8a::46b5ebe44a573c11445a00b34fd291d6]

2

01 pc 000000000004d1ec /system/lib64/libandroidfw.so (android::LoadedPackage::FindEntryByName(std::1::basic_string<char16_t, std::1::char_traits, std::__1::allocator > const&, std::1::basic_string<char16_t, std::1::char_traits, std::__1::allocator > const&) const+52) [arm64-v8a::46b5ebe44a573c11445a00b34fd291d6]

3

02 pc 000000000003f49c /system/lib64/libandroidfw.so (android::AssetManager2::GetResourceId(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) const+396) [arm64-v8a::46b5ebe44a573c11445a00b34fd291d6]

4

03 pc 000000000011f818 /system/lib64/libandroid_runtime.so [arm64-v8a::b349e6ec579854134f8ffe202339917e]

5

04 pc 00000000002059ac /system/framework/arm64/boot-framework.oat [arm64-v8a::4017b2c6b9e387d2e25b8aa71c4c2d91]

6 java: 7 android.content.res.AssetManager.getResourceIdentifier(AssetManager.java:796) 8 android.content.res.ResourcesImpl.getIdentifier(ResourcesImpl.java:329) 9 android.content.res.Resources.getIdentifier(Resources.java:2262) 10 skin.support.content.res.SkinCompatResources.getTargetResId(SkinCompatResources.java:121) 11 skin.support.content.res.SkinCompatVectorResources.getSkinDrawableCompat(SkinCompatVectorResources.java:79) 12 skin.support.content.res.SkinCompatVectorResources.getDrawableCompat(SkinCompatVectorResources.java:89) 13 skin.support.widget.SkinCompatBackgroundHelper.applySkin(SkinCompatBackgroundHelper.java:50) 14 skin.support.widget.SkinCompatBackgroundHelper.loadFromAttributes(SkinCompatBackgroundHelper.java:35) 15 skin.support.widget.SkinCompatLinearLayout.(SkinCompatLinearLayout.java:25) 16 skin.support.widget.SkinCompatLinearLayout.(SkinCompatLinearLayout.java:19) 17 skin.support.app.SkinAppCompatViewInflater.createViewFromFV(SkinAppCompatViewInflater.java:69) 18 skin.support.app.SkinAppCompatViewInflater.createView(SkinAppCompatViewInflater.java:51) 19 skin.support.app.SkinCompatViewInflater.createViewFromInflater(SkinCompatViewInflater.java:77) 20 skin.support.app.SkinCompatViewInflater.createView(SkinCompatViewInflater.java:46) 21 skin.support.app.SkinCompatDelegate.createView(SkinCompatDelegate.java:70) 22 skin.support.app.SkinCompatDelegate.onCreateView(SkinCompatDelegate.java:31) 23 android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:256) 24 android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1116) 25 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1052) 26 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1016) 27 android.view.LayoutInflater.rInflate(LayoutInflater.java:1178) 28 android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1139) 29 android.view.LayoutInflater.inflate(LayoutInflater.java:696) 30 android.view.LayoutInflater.inflate(LayoutInflater.java:548) 31 com.esunny.ui.common.EsBaseFragment.onCreateView(EsBaseFragment.java:57) 32 com.esunny.ui.quote.favorite.EsFavoriteFragment.onCreateView(EsFavoriteFragment.java:160) 33 androidx.fragment.app.Fragment.performCreateView(Fragment.java:2699) 34 androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:320) 35 androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1199) 36 androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368) 37 androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446) 38 androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:442) 39 androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2181) 40 androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2004) 41 androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1959) 42 androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1861) 43 androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2641) 44 androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2589) 45 androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:247) 46 androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:541) 47 androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:210) 48 android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1435) 49 android.app.Activity.performStart(Activity.java:8153) 50 android.app.ActivityThread.handleStartActivity(ActivityThread.java:3776) 51 android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221) 52 android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) 53 android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) 54 android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) 55 android.app.ActivityThread$H.handleMessage(ActivityThread.java:2315) 56 android.os.Handler.dispatchMessage(Handler.java:106) 57 android.os.Looper.loop(Looper.java:257) 58 android.app.ActivityThread.main(ActivityThread.java:8218) 59 java.lang.reflect.Method.invoke(Native Method) 60 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626) 61 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1031)

1379266135 commented 1 year ago

我也遇到了同样的问题

csh159 commented 9 months ago

楼主解决了不?

minionhuang commented 3 months ago

这问题 有人修复过吗,同样问题