我在现有的android应用中遇到了twilio sdk的问题。我正在尝试添加它,但在运行时出现此错误:
java.lang.ClassNotFoundException: Didn't find class "org.webrtc.EncodedImage" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/io.syftr.android.debug-Vm1y_uqJyGerI0IkYLNUzg==/base.apk"],nativeLibraryDirectories=[/data/app/io.syftr.android.debug-Vm1y_uqJyGerI0IkYLNUzg==/lib/arm64, /data/app/io.syftr.android.debug-Vm1y_uqJyGerI0IkYLNUzg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
2019-01-30 13:33:48.294 14906-14906 / io.syftr.android.debug W / System.err:在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) 2019-01-30 13:33:48.294 14906-14906 / io.syftr.android.debug W / System.err:at java.lang.ClassLoader.loadClass(ClassLoader.java:379) 2019-01-30 13:33:48.294 14906-14906 / io.syftr.android.debug W / System.err:at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 2019-01-30 13:33:48.294 14906-14906 / io.syftr.android.debug W / System.err:at java.lang.Runtime.nativeLoad(本机方法) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:at java.lang.Runtime.loadLibrary0(Runtime.java:1014) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:在java.lang.System.loadLibrary(System.java:1669) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:在com.getkeepsafe.relinker.SystemLibraryLoader.loadLibrary(SystemLibraryLoader.java:24) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:163) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:在com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:在com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:70) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:51) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:在com.twilio.video.MediaFactory.instance(MediaFactory.java:44) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:at com.twilio.video.LocalAudioTrack.create(LocalAudioTrack.java:95) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:在com.twilio.video.LocalAudioTrack.create(LocalAudioTrack.java:42) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:位于io.syftr.android.components.bidchat_webrtc.video_call.VideoCallActivity.connectToRoom(VideoCallActivity.java:250) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:位于io.syftr.android.components.bidchat_webrtc.video_call.VideoCallActivity.onCreate(VideoCallActivity.java:202) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:在android.app.Activity.performCreate(Activity.java:7136) 2019-01-30 13:33:48.295 14906-14906 / io.syftr.android.debug W / System.err:在android.app.Activity.performCreate(Activity.java:7127) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2905) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3060) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:在android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:在android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:在android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1818) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:在android.os.Handler.dispatchMessage(Handler.java:106) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:位于android.os.Looper.loop(Looper.java:193) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:在android.app.ActivityThread.main(ActivityThread.java:6762) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:在java.lang.reflect.Method.invoke(本机方法) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:在com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run(RuntimeInit.java:493) 2019-01-30 13:33:48.296 14906-14906 / io.syftr.android.debug W / System.err:at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
这是渐变文件:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
google()
}
// Manifest version information!
def versionMajor = 1
def versionMinor = 0
def versionPatch = 0
def versionBuild = 64 // bump for dogfood builds, public betas, etc.
def gitSha() {
def p = 'git rev-parse --short HEAD'.execute([], project.rootDir)
p.waitFor()
if (p.exitValue() != 0) {
throw new RuntimeException(p.errorStream.text)
}
return p.text.trim()
}
def gitTimestamp() {
def p = 'git log -n 1 --format=%at'.execute([], rootDir)
p.waitFor()
if (p.exitValue() != 0) {
throw new RuntimeException(p.errorStream.text)
}
return p.text.trim()
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
signingConfigs {
//
}
dexOptions {
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "io.syftr.android"
minSdkVersion 16
targetSdkVersion 27
multiDexEnabled true
//suppress Gradle 3.0.0 "references to other resources are not supported" errors
vectorDrawables.useSupportLibrary true
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
signingConfig signingConfigs.syftr
buildConfigField 'String', 'GIT_SHA', "\"${gitSha()}\""
buildConfigField 'long', 'GIT_TIMESTAMP', "${gitTimestamp()}L"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
applicationIdSuffix 'debug'
versionNameSuffix '-DEBUG'
debuggable true
signingConfig signingConfigs.syftr
minifyEnabled false
}
release {
debuggable false
applicationIdSuffix 'debug'
minifyEnabled false
signingConfig signingConfigs.syftr
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
alpha {
debuggable true
minifyEnabled false
applicationIdSuffix 'debug'
signingConfig signingConfigs.syftr
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
// Specifies flavor dimensions for Gradle Plugin 3.0.0.
flavorDimensions "standard"
productFlavors {
syftr {
applicationId "io.syftr.android"
dimension "standard"
}
l4l {
applicationId "io.syftr.android"
dimension "standard"
}
dskreat {
applicationId "io.syftr.android"
dimension "standard"
}
}
}
ext {
supportLibVersion = '27.1.1'
daggerVersion = '2.9'
okhttp3Version = '3.12.1'
retrofit2Version = '2.5.0'
butterKnifeVersion = '8.5.1'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.code.findbugs', module: 'jsr305'
})
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.github.lsjwzh.RecyclerViewPager:lib:v1.1.2'
implementation "com.android.support:support-compat:$supportLibVersion"
implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation "com.android.support:support-v13:$supportLibVersion"
implementation "com.android.support:recyclerview-v7:$supportLibVersion"
implementation "com.android.support:design:$supportLibVersion"
implementation "com.android.support:percent:$supportLibVersion"
// compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
implementation 'com.google.code.gson:gson:2.7'
implementation "com.squareup.retrofit2:retrofit:$retrofit2Version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit2Version"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3Version"
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation "com.jakewharton:butterknife:$butterKnifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$butterKnifeVersion"
//Dagger
implementation "com.google.dagger:dagger:$daggerVersion"
annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"
compileOnly 'javax.annotation:jsr250-api:1.0'
implementation 'com.crystal:crystalrangeseekbar:1.0.0'
implementation 'com.afollestad.material-dialogs:core:0.9.4.4'
implementation 'com.kyleduo.switchbutton:library:1.4.6'
implementation 'com.google.android.gms:play-services-location:11.4.2'
implementation 'com.google.android.gms:play-services-maps:11.4.2'
implementation 'com.google.firebase:firebase-database:11.4.2'
implementation 'com.google.firebase:firebase-auth:11.4.2'
implementation 'com.google.firebase:firebase-messaging:11.4.2'
implementation 'org.solovyev.android:checkout:1.1.0'
//compile 'com.facebook.android:account-kit-sdk:4.26.0'
// compile ('com.facebook.android:account-kit-sdk:4.+'){
// exclude group: 'com.google.android.gms'
// }
implementation 'com.facebook.android:account-kit-sdk:4.26.0'
implementation 'jp.wasabeef:picasso-transformations:2.1.0'
implementation "com.android.support:cardview-v7:$supportLibVersion"
implementation 'com.yuyakaido.android:card-stack-view:0.7.9'
// implementation 'io.pristine:libjingle:11139@aar'
implementation 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.0'
testImplementation 'junit:junit:4.12'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.7@aar') {
transitive = true;
}
implementation 'biz.kasual:materialnumberpicker:1.2.1'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.google.android.gms:play-services-ads:11.4.2'
implementation project(':adcolony-sdk-3.1.2')
implementation(name: 'mmedia-6.4.0', ext: 'aar')
//added by jayesh 3518, dependency for circular image view
implementation 'de.hdodenhof:circleimageview:2.2.0'
//added by jayesh 7518, firestore dependency
implementation 'com.google.firebase:firebase-firestore:11.4.2'
implementation 'com.google.android.gms:play-services-auth:11.4.2'
// added by mukesh for WebRTC impl
implementation('io.socket:socket.io-client:0.8.3') {
// excluding org.json which is provided by Android
exclude group: 'org.json', module: 'json'
}
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
// crop image approach changed on 23/08/18
implementation 'com.naver.android.helloyako:imagecropview:1.2.0'
implementation 'joda-time:joda-time:2.9.4'
//added by jayesh 29818, library to display the gif
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.android.support:support-dynamic-animation:25.4.0'
// The Video library resides on jcenter
//implementation 'com.twilio:video-android:3.2.2'
// The Video library resides on jcenter
implementation 'com.twilio:video-android:2.2.1'
// implementation(name: 'twilio-video-android-3.2.2', ext: 'aar')
// implementation group: 'com.getkeepsafe.relinker', name: 'relinker',
version: '1.2.2'
}
//fileTree(dir: 'libs-aar', include: '*.aar').each { File file -> dependencies.add("compile", [name: file.name.replaceFirst(~/\.[^\.]+$/, ''), ext: 'aar']) }
apply plugin: 'com.google.gms.google-services'
这里还有proguard文件:
-keep class org.webrtc.** { *; }
-keep class com.twilio.video.** { *; }
-keepattributes InnerClasses
有什么想法为什么会发生这种情况以及对此我该怎么办?