问题
I am working with code from https://github.com/bytedeco/sample-projects/blob/master/JavaCV-android-example/app/src/main/java/org/bytedeco/javacv_android_example/record/RecordActivity.java. Demo working fine
I want to use wowza.gocoder with FFmpeg so by only add wowza dependancy in app.gradle then demo application crash at run time as screenshot
here is my app.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
applicationId "com.cygnus.ffmpegframerecorderexample"
minSdkVersion 21
targetSdkVersion 29
multiDexEnabled true
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
checkReleaseBuilds false
abortOnError false
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'AndroidManifest.xml'
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
sourceSets {
androidTest {
assets.srcDirs = ['src/androidTest/assets']
}
}
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "${variant.name}-${variant.versionName}.apk"
}
}
productFlavors {
}
}
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
ext {
versions = [
'ffmpeg': '3.2.1-1.3'
]
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.fragment:fragment:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:18.1.0'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.9.8'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.picasso:picasso:2.71828'
//implementation 'com.wowza.gocoder.sdk.android:com.wowza.gocoder.sdk:2.0.0@aar'//sdf
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'org.apache.commons:commons-lang3:3.3.2'
implementation 'se.emilsjolander:stickylistheaders:2.5.1'
implementation 'joda-time:joda-time:2.5'
implementation 'com.stripe:stripe-android:1.0.0'
implementation 'com.facebook.android:facebook-android-sdk:4.42.0'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'com.pusher:pusher-java-client:1.6.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'com.android.support.test:testing-support-lib:0.1'
androidTestImplementation 'info.cukes:cucumber-android:1.2.0@jar'
androidTestImplementation 'info.cukes:cucumber-picocontainer:1.2.0'
implementation(group: 'org.bytedeco', name: 'javacv-platform', version: '1.3') {
exclude group: 'org.bytedeco.javacpp-presets'
}
implementation group: 'org.bytedeco', name: 'javacv', version: '1.3.1'
implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv-platform', version: '3.1.0-1.3'
implementation group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg-platform', version: '3.2.1-1.3'
//implementation 'com.vxg.mediasdk:playersdk:2.0.140'//sdf
implementation 'com.iceteck.silicompressorr:silicompressor:2.2.2'
}
回答1:
So finally, there is an issue, but with merging dependencies inside project. To start first, issue with linking native sources, and for some implementation, it's not possible to find native methods, which could be changed, because this resource get updated in scope of other library, which use latest version of it.
To make sure, it's an issue, you need to check dependencies in project with ./gradlew app:dependencies
. And double check, that something similar could be found in the com.wowza.gocoder.sdk.android
and org.bytedeco.*
.
And to resolve it, need to configure ResolutionStrategy by changing some options for one or another library, based on their dependency tree.
回答2:
You are using an older platform of JavaCV. You must try again with JavaCV 1.5.1. Maybe there is something that can be fixed.
来源:https://stackoverflow.com/questions/57479696/wowza-gocoder-not-working-with-org-bytedeco-javacv-ffmpegframerecorder