When I run my application in android 4.4 - 4.4.x devices my app crashes, but when I run with android 5.0 onwards its working fine.
Crash logcat:
FATAL EXCEPTION: main
Process: com.Forewarn.ForewarnApp, PID: 18854
java.lang.VerifyError: com/Forewarn/ForewarnApp/activities/SignInActivity
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2154)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2286)
at android.app.ActivityThread.access$800(ActivityThread.java:145)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5127)
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:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
Here is my Application class :
public class SoteriaApplication extends MultiDexApplication {
@Override
public void onCreate() {
super.onCreate();
AccountUtils.assignContext(this);
}
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
I tried with disable instant run from settings and tried with added above attachBaseContext() Method in Application class :
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
I used these libraries in my Gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile files('libs/gson-2.3.1.jar')
compile files('libs/retrofit-1.2.2.jar')
compile files('libs/picasso-2.5.2.jar')
compile files('libs/universal-image-loader-1.9.3.jar')
compile 'com.vdurmont:semver4j:2.2.0'
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:design:27.0.2'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.android.support:palette-v7:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:multidex:1.0.1'
compile 'org.jsoup:jsoup:1.8.3'
testCompile 'junit:junit:4.12'
}
please find the problem in my code, and already some users also bothered about this issue but No one find out the solution, that's why I again posted my issue.
Thanks Everyone!