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

Problem with inner static holder class singleton implementation #12

Open
Piasy opened this issue Oct 11, 2015 · 0 comments
Open

Problem with inner static holder class singleton implementation #12

Piasy opened this issue Oct 11, 2015 · 0 comments

Comments

@Piasy
Copy link

Piasy commented Oct 11, 2015

After add this line, my app crashed:

XLogConfig.config(XLogConfig.newConfigBuilder(mApp).build());

Exception log:

FATAL EXCEPTION: main
Process: com.github.piasy.template, PID: 29192
java.lang.NoClassDefFoundError: com/github/piasy/common/android/provider/RestProvider$RestAdapterHolder
    at com.github.piasy.common.android.provider.RestProvider.provideRestAdapter(RestProvider.java:48)
    at com.github.piasy.common.android.provider.ProviderModule.provideRestAdapter(ProviderModule.java:77)
    at com.github.piasy.common.android.provider.ProviderModule_ProvideRestAdapterFactory.get(ProviderModule_ProvideRestAdapterFactory.java:23)
    at com.github.piasy.common.android.provider.ProviderModule_ProvideRestAdapterFactory.get(ProviderModule_ProvideRestAdapterFactory.java:9)
    at dagger.internal.ScopedProvider.get(ScopedProvider.java:46)
    at com.github.piasy.model.rest.github.GithubAPIModule_ProvideGithubAPIFactory.get(GithubAPIModule_ProvideGithubAPIFactory.java:22)
    at com.github.piasy.model.rest.github.GithubAPIModule_ProvideGithubAPIFactory.get(GithubAPIModule_ProvideGithubAPIFactory.java:8)
    at dagger.internal.ScopedProvider.get(ScopedProvider.java:46)
    at com.github.piasy.model.dao.di.DAOModule_ProvideGithubUserDAOFactory.get(DAOModule_ProvideGithubUserDAOFactory.java:31)
    at com.github.piasy.model.dao.di.DAOModule_ProvideGithubUserDAOFactory.get(DAOModule_ProvideGithubUserDAOFactory.java:11)
    at dagger.internal.ScopedProvider.get(ScopedProvider.java:46)
    at com.github.piasy.template.features.splash.di.SplashModule_ProvideSplashPresenterFactory.get(SplashModule_ProvideSplashPresenterFactory.java:35)
    at com.github.piasy.template.features.splash.di.SplashModule_ProvideSplashPresenterFactory.get(SplashModule_ProvideSplashPresenterFactory.java:12)
    at dagger.internal.ScopedProvider.get(ScopedProvider.java:46)
    at com.github.piasy.template.app.di.DaggerAppComponent$VisitorComponentImpl$SplashComponentImpl.presenter(DaggerAppComponent.java:279)
    at com.github.piasy.template.app.di.DaggerAppComponent$VisitorComponentImpl$SplashComponentImpl.presenter(DaggerAppComponent.java:248)
    at com.github.piasy.template.base.BaseFragment.injectDependencies(BaseFragment.java:137)
    at com.hannesdorfmann.mosby.MosbyFragment.onViewCreated(MosbyFragment.java:88)
    at com.hannesdorfmann.mosby.mvp.MvpFragment.onViewCreated(MvpFragment.java:95)
    at com.github.piasy.template.base.BaseFragment.onViewCreated(BaseFragment.java:161)
    at com.github.piasy.template.features.splash.GithubSearchFragment.onViewCreated(GithubSearchFragment.java:106)
    at com.taobao.android.dexposed.DexposedBridge.invokeOriginalMethodNative(Native Method)
    at com.taobao.android.dexposed.DexposedBridge.handleHookedMethod(DexposedBridge.java:274)
    at com.github.piasy.template.features.splash.GithubSearchFragment.onViewCreated(Native Method)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1045)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1207)
    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1572)
    at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:493)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5113)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
    at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.ClassNotFoundException: Didn't find class "com.github.piasy.common.android.provider.RestProvider$RestAdapterHolder" on path: DexPathList[[zip file "/data/app/com.github.piasy.template-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.github.piasy.template-2, /vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
 at java.lang.ClassLoader

Commit that can reproduce this problem: https://github.com/Piasy/AndroidTDDBootStrap/blob/1b690846b706488586a0a6abbe9eac44264f4102/presentation%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgithub%2Fpiasy%2Ftemplate%2Ffeatures%2Fsplash%2FSplashActivity.java#L138

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

1 participant