На моем logcat во время вызова сервера у меня есть такие строки:
Rejecting re-init on previously-failed class java.lang.Class<okhttp3.internal.platform.ConscryptPlatform$platformTrustManager$2>: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/conscrypt/ConscryptHostnameVerifier;
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.conscrypt.ConscryptHostnameVerifier" on path: DexPathList[[zip file "/data/app/package-JHk9QBF7PSIufoXeKqbmNA==/base.apk"],nativeLibraryDirectories=[/data/app/package-JHk9QBF7PSIufoXeKqbmNA==/lib/x86, /system/lib, /system/vendor/lib]]
Через некоторое время я вижу такое сообщение:
okhttp.OkHttpClient: <-- HTTP FAILED: java.net.SocketTimeoutException: timeout
И я проверил, что inte rnet работает ну на моем девайсе. Приложение не вылетает, но я не могу отправить запрос. Например, всю эту неделю все работало нормально, а сейчас что-то повреждено :( Как исправить эту ошибку?
ОБНОВЛЕНИЕ
Мой файл приложения gradle:
buildscript {
ext.kotlin_version = '1.3.71'
repositories { jcenter() }
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlinx-serialization'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
defaultConfig {
applicationId "package"
minSdkVersion 21
targetSdkVersion 29
versionCode 87
versionName "1.0.0"
testInstrumentationRunner "android.support.APICallRequests.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
buildConfigField "String", "API_URL", 'url'
}
release {
buildConfigField "String", "API_URL", 'url'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation files('libs/mail.jar')
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'org.apache.commons:commons-io:1.3.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'junit:junit:4.13'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
// Retrofit
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'us.belka:androidtoggleswitch:1.2.2'
implementation 'com.github.droidbond:LoadingButton:0.1.5'
implementation 'io.github.tonnyl:whatsnew:0.1.1'
implementation 'com.github.GrenderG:Toasty:1.3.1'
implementation 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE'
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
implementation 'androidx.browser:browser:1.2.0'
implementation 'com.google.firebase:firebase-analytics:17.4.2'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-messaging:20.2.0'
implementation 'com.google.firebase:firebase-core:17.4.2'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.72'
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.14.0" // JVM dependency
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
}