[введите описание изображения здесь] [1]java.lang.NoClassDefFoundError: okhttp3.internal.Util
Моя программа может работать с Android 5.1 телефон, но телефон не сможет запустить Android 4.3, и будет работать из нижней части ошибки
> E/AndroidRuntime: FATAL EXCEPTION: EventThread
>java.lang.NoClassDefFoundError: okhttp3.internal.Util
>at okhttp3.OkHttpClient.<clinit>(OkHttpClient.java:65)
>at okhttp3.OkHttpClient$Builder.<init>(OkHttpClient.java:381)>
at>io.socket.engineio.client.transports.WebSocket.doOpen(WebSocket.java:51)
>at io.socket.engineio.client.Transport$1.run(Transport.java:75)
>at io.socket.thread.EventThread.exec(EventThread.java:50)
>at io.socket.engineio.client.Transport.open(Transport.java:70)
>at io.socket.engineio.client.Socket.probe(Socket.java:458)
>at io.socket.engineio.client.Socket.onOpen(Socket.java:471)
>at io.socket.engineio.client.Socket.onHandshake(Socket.java:512)
>at io.socket.engineio.client.Socket.onPacket(Socket.java:485)
>at io.socket.engineio.client.Socket.access$900(Socket.java:30)
>at io.socket.engineio.client.Socket$5.call(Socket.java:299)
>at io.socket.emitter.Emitter.emit(Emitter.java:117)
>at io.socket.engineio.client.Transport.onPacket(Transport.java:127)
>at>io.socket.engineio.client.transports.Polling.access$700(Polling.java:17)
>at>io.socket.engineio.client.transports.Polling$2.call(Polling.java:124)
>at io.socket.engineio.parser.Parser.decodePayload(Parser.java:251)
>at>.socket.engineio.client.transports.Polling._onData(Polling.java:134)
>at> io.socket.engineio.client.transports.Polling.onData(Polling.java:106)
>at>io.socket.engineio.client.transports.PollingXHR$5$1.run(PollingXHR.java:113)
>at io.socket.thread.EventThread$2.run(EventThread.java:75)
>at>java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
>at >java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
>at java.lang.Thread.run(Thread.java:841)
my build.gradle
compileSdkVersion 24
buildToolsVersion "24.0.0"
// For customization of Volley to build.
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "my---"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
repositories {
flatDir {
dirs '../Libraries/aar'
}
}
testOptions {
unitTests.returnDefaultValues = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:customtabs:24.1.1'
compile 'com.android.support:preference-v7:24.1.1'
compile 'com.android.support:preference-v14:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:support-annotations:24.1.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.malinskiy:materialicons:1.0.1'
compile 'com.google.zxing:core:3.2.1'
compile 'com.google.guava:guava:19.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.roughike:bottom-bar:1.4.0.1'
compile 'com.malinskiy:superrecyclerview:1.1.4'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.dmitrymalkovich.android:material-design-dimens:1.2'
compile 'com.eowise:recyclerview-stickyheaders:[email protected]'
compile('com.vincentbrison.openlibraries.android:dualcache:[email protected]') {
transitive = true
}
compile(name: 'com.leenanxi.android.open.qrcode', ext: 'aar')
testCompile 'junit:junit:4.12'
compile 'com.google.code.gson:gson:2.7'
compile('io.socket:socket.io-client:0.7.0') {
exclude group: 'org.json', module: 'json'
}
compile project(':imui')
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support:support-annotations:24.1.1'
compile files('libs/pushservice-5.1.0.48.jar')
моя сборка
Покажите свой Gradle. –
i add the gradle – Liup
См. Мой ответ и спросите, есть ли у вас какие-либо сомнения. –