У меня устройство на Android 7.1
. Тестировал всё время на нём, всё работало и работает. При запуске на эмуляторе с Android 7.1
тоже всё работает, но на версиях примерно 5.1 - 4.3
приложение вылетает (На версиях выше 5.1
не пробовал).
Мой стактрейс.
04-30 15:46:05.889 3100-3100/developer.chistov.messager I/dalvikvm: Failed resolving Ldeveloper/chistov/messager/adapter/HistoryAdapter; interface 2636 'Landroid/widget/ThemedSpinnerAdapter;'
04-30 15:46:05.889 3100-3100/developer.chistov.messager W/dalvikvm: Link of class 'Ldeveloper/chistov/messager/adapter/HistoryAdapter;' failed
04-30 15:46:05.889 3100-3100/developer.chistov.messager E/dalvikvm: Could not find class 'developer.chistov.messager.adapter.HistoryAdapter', referenced from method developer.chistov.messager.fragments.HistoryFragment.lambda$-developer_chistov_messager_fragments_HistoryFragment_lambda$7
04-30 15:46:05.889 3100-3100/developer.chistov.messager W/dalvikvm: VFY: unable to resolve check-cast 3671 (Ldeveloper/chistov/messager/adapter/HistoryAdapter;) in Ldeveloper/chistov/messager/fragments/HistoryFragment;
04-30 15:46:05.889 3100-3100/developer.chistov.messager D/dalvikvm: VFY: replacing opcode 0x1f at 0x0011
04-30 15:46:05.889 3100-3100/developer.chistov.messager I/dalvikvm: Failed resolving Ldeveloper/chistov/messager/adapter/HistoryAdapter; interface 2636 'Landroid/widget/ThemedSpinnerAdapter;'
04-30 15:46:05.889 3100-3100/developer.chistov.messager W/dalvikvm: Link of class 'Ldeveloper/chistov/messager/adapter/HistoryAdapter;' failed
04-30 15:46:05.889 3100-3100/developer.chistov.messager E/dalvikvm: Could not find class 'developer.chistov.messager.adapter.HistoryAdapter', referenced from method developer.chistov.messager.fragments.HistoryFragment.onViewCreated
04-30 15:46:05.889 3100-3100/developer.chistov.messager W/dalvikvm: VFY: unable to resolve new-instance 3671 (Ldeveloper/chistov/messager/adapter/HistoryAdapter;) in Ldeveloper/chistov/messager/fragments/HistoryFragment;
04-30 15:46:05.889 3100-3100/developer.chistov.messager D/dalvikvm: VFY: replacing opcode 0x22 at 0x002d
04-30 15:46:05.889 3100-3100/developer.chistov.messager I/dalvikvm: Failed resolving Ldeveloper/chistov/messager/adapter/HistoryAdapter; interface 2636 'Landroid/widget/ThemedSpinnerAdapter;'
04-30 15:46:05.889 3100-3100/developer.chistov.messager W/dalvikvm: Link of class 'Ldeveloper/chistov/messager/adapter/HistoryAdapter;' failed
04-30 15:46:05.889 3100-3100/developer.chistov.messager D/dalvikvm: DexOpt: unable to opt direct call 0x7370 at 0x5d in Ldeveloper/chistov/messager/fragments/HistoryFragment;.onViewCreated
04-30 15:46:05.953 3100-3100/developer.chistov.messager D/dalvikvm: GC_FOR_ALLOC freed 79K, 10% free 3733K/4104K, paused 3ms, total 3ms
04-30 15:46:05.957 3100-3100/developer.chistov.messager D/dalvikvm: GC_FOR_ALLOC freed 2K, 9% free 3829K/4204K, paused 4ms, total 4ms
04-30 15:46:05.957 3100-3100/developer.chistov.messager I/dalvikvm-heap: Grow heap (frag case) to 4.931MB for 1127532-byte allocation
04-30 15:46:05.961 3100-3109/developer.chistov.messager D/dalvikvm: GC_FOR_ALLOC freed <1K, 8% free 4930K/5308K, paused 3ms, total 3ms
04-30 15:46:05.989 3100-3100/developer.chistov.messager D/AndroidRuntime: Shutting down VM
04-30 15:46:05.989 3100-3100/developer.chistov.messager W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa4d77b20)
04-30 15:46:05.993 3100-3100/developer.chistov.messager E/AndroidRuntime: FATAL EXCEPTION: main
Process: developer.chistov.messager, PID: 3100
java.lang.NoClassDefFoundError: developer.chistov.messager.adapter.HistoryAdapter
at developer.chistov.messager.fragments.HistoryFragment.onViewCreated(HistoryFragment.java:64)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1314)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149)
at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:710)
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:5001)
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:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "developer.chistov.messager"
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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 group: 'cz.msebera.android', name: 'httpclient', version: '4.4.1.1'
})
compile 'com.google.code.gson:gson:2.8.0'
compile 'org.apache.commons:commons-io:1.3.2'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.0.8'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.squareup.okio:okio:1.12.0'
}
InstantRun
- поробуйте его отключить в студии. Ну иbuild-clean
сделать.