The problem does not happen on other phones or emulator.
The app runs fine if I install and launch app separately using command line:
./gradlew clean installMyApp && adb shell "am start -n com.abc.xyz/com.abc.xyz.activities.landing.splash.SplashScreen
Within the same day, the class name seems to be consistent. However, when I tried again a few days apart, it's a different class "missing"
Stacktrace as of today 30th Oct 2017:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.abc.xyz, PID: 24924
java.lang.NoClassDefFoundError: rx.android.schedulers.LooperScheduler
at rx.android.schedulers.AndroidSchedulers.from(AndroidSchedulers.java:63)
at com.abc.xyz.di.app.AppModule.provideLooperScheduler(AppModule.java:77)
at com.abc.xyz.di.app.AppModule_ProvideLooperSchedulerFactory.get(AppModule_ProvideLooperSchedulerFactory.java:15)
at com.abc.xyz.driver.di.app.AppModule_ProvideLooperSchedulerFactory.get(AppModule_ProvideLooperSchedulerFactory.java:8)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.abc.xyz.AppLogicComponent_Factory.get(AppLogicComponent_Factory.java:110)
at com.abc.xyz.AppLogicComponent_Factory.get(AppLogicComponent_Factory.java:23)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.abc.xyz.MyApplication_MembersInjector.injectMembers(MyApplication_MembersInjector.java:167)
at com.abc.xyz.MyApplication_MembersInjector.injectMembers(MyApplication_MembersInjector.java:23)
at com.abc.xyz.di.app.DaggerAppComponent.inject(DaggerAppComponent.java:2865)
at com.abc.xyz.di.app.DaggerAppComponent.inject(DaggerAppComponent.java:842)
at dagger.android.DaggerApplication.injectIfNecessary(DaggerApplication.java:78)
at dagger.android.DaggerApplication.onCreate(DaggerApplication.java:53)
at com.abc.xyz.MyApplication.onCreate(MyApplication.java:81)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1017)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4996)
at android.app.ActivityThread.access$1600(ActivityThread.java:188)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1591)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:210)
at android.app.ActivityThread.main(ActivityThread.java:5839)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1113)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:879)
Note that I see many different and unrelated classes "missing" from time to time. This is only one example and should not have anything to do with the problem itself:
(dependency injection with Dagger 2)
@ParametersAreNonnullByDefault
@Module(includes = NetModule.class)
class AppModule {
//...
@AppComponent.AppScope
@Provides
static Scheduler provideLooperScheduler() {
// Please be sure not to execute long run executions with this scheduler
// This scheduler is meant to be beneficial in timer/interval/retry/timeout/sample/window these rx.Operators
final HandlerThread handlerThread = new HandlerThread("RxLooperHandler");
handlerThread.start();
return AndroidSchedulers.from(handlerThread.getLooper());
}
//...
}