FFmpeg Android错误

huangapple go评论193阅读模式
英文:

FFmpeg Android Errors

问题

以下是你要翻译的代码部分:

  1. Ok so im making a kotlin android app and for file conversion from 3gp to wav i added the android ffmpeg library with `implementation 'com.arthenica:mobile-ffmpeg-full:4.4'` then i added this code to convert the files `FFmpeg.execute("-i" + f2 +"/storage/emulated/0/Android/data/com.icompilecodewithnowarnings.ffmpegthing/files/Documents/recording.wav")` for further context f2 is `/storage/emulated/0/Android/data/com.icompilecodewithnowarnings.ffmpegthing/files/Documents/recording.3gp`
  2. The error log is to large to simply just fit here but heres some of it
  3. Execution failed for task ':app:checkDebugAarMetadata'.
  4. > Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
  5. > Could not find com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.3.2.
  6. Searched in the following locations:
  7. - https://dl.google.com/dl/android/maven2/com/github/hiteshsondhi88/libffmpeg/FFmpegAndroid/0.3.2/FFmpegAndroid-0.3.2.pom
  8. - https://repo.maven.apache.org/maven2/com/github/hiteshsondhi88/libffmpeg/FFmpegAndroid/0.3.2/FFmpegAndroid-0.3.2.pom
  9. Required by:
  10. project :app
  11. Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.3.2.
  12. I tried to compile however the compiler immediatley rejected my app and refused to compile. I would have expected it to have immidiatley compiled into a apk.
  13. EDIT:
  14. Here is my build.gradle file
  15. ```gradle
  16. plugins {
  17. id 'com.android.application'
  18. id 'org.jetbrains.kotlin.android'
  19. }
  20. android {
  21. namespace 'com.icompilecodewithnowarnings.ffmpegthing'
  22. compileSdk 33
  23. defaultConfig {
  24. applicationId "com.icompilecodewithnowarnings.ffmpegthing"
  25. minSdk 26
  26. targetSdk 33
  27. versionCode 1
  28. versionName "1.0"
  29. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  30. }
  31. buildTypes {
  32. release {
  33. minifyEnabled false
  34. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  35. }
  36. }
  37. compileOptions {
  38. sourceCompatibility JavaVersion.VERSION_1_8
  39. targetCompatibility JavaVersion.VERSION_1_8
  40. }
  41. kotlinOptions {
  42. jvmTarget = '1.8'
  43. }
  44. }
  45. dependencies {
  46. implementation 'androidx.core:core-ktx:1.8.0'
  47. implementation 'androidx.appcompat:appcompat:1.4.1'
  48. implementation 'com.google.android.material:material:1.5.0'
  49. implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
  50. implementation 'com.arthenica:mobile-ffmpeg-full:4.4'
  51. implementation files('src/main/java/musicg-1.4.2.0.jar')
  52. testImplementation 'junit:junit:4.13.2'
  53. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  54. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  55. }
英文:

Ok so im making a kotlin android app and for file conversion from 3gp to wav i added the android ffmpeg library with implementation 'com.arthenica:mobile-ffmpeg-full:4.4' then i added this code to convert the files FFmpeg.execute("-i" + f2 +"/storage/emulated/0/Android/data/com.icompilecodewithnowarnings.ffmpegthing/files/Documents/recording.wav") for further context f2 is /storage/emulated/0/Android/data/com.icompilecodewithnowarnings.ffmpegthing/files/Documents/recording.3gp

The error log is to large to simply just fit here but heres some of it

  1. Execution failed for task ':app:checkDebugAarMetadata'.
  2. > Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
  3. > Could not find com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.3.2.
  4. Searched in the following locations:
  5. - https://dl.google.com/dl/android/maven2/com/github/hiteshsondhi88/libffmpeg/FFmpegAndroid/0.3.2/FFmpegAndroid-0.3.2.pom
  6. - https://repo.maven.apache.org/maven2/com/github/hiteshsondhi88/libffmpeg/FFmpegAndroid/0.3.2/FFmpegAndroid-0.3.2.pom
  7. Required by:
  8. project :app
  1. Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.3.2.

I tried to compile however the compiler immediatley rejected my app and refused to compile. I would have expected it to have immidiatley compiled into a apk.

EDIT:

Here is my build.gradle file

  1. plugins {
  2. id 'com.android.application'
  3. id 'org.jetbrains.kotlin.android'
  4. }
  5. android {
  6. namespace 'com.icompilecodewithnowarnings.ffmpegthing'
  7. compileSdk 33
  8. defaultConfig {
  9. applicationId "com.icompilecodewithnowarnings.ffmpegthing"
  10. minSdk 26
  11. targetSdk 33
  12. versionCode 1
  13. versionName "1.0"
  14. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  15. }
  16. buildTypes {
  17. release {
  18. minifyEnabled false
  19. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  20. }
  21. }
  22. compileOptions {
  23. sourceCompatibility JavaVersion.VERSION_1_8
  24. targetCompatibility JavaVersion.VERSION_1_8
  25. }
  26. kotlinOptions {
  27. jvmTarget = '1.8'
  28. }
  29. }
  30. dependencies {
  31. implementation 'androidx.core:core-ktx:1.8.0'
  32. implementation 'androidx.appcompat:appcompat:1.4.1'
  33. implementation 'com.google.android.material:material:1.5.0'
  34. implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
  35. implementation 'com.arthenica:mobile-ffmpeg-full:4.4'
  36. implementation files('src/main/java/musicg-1.4.2.0.jar')
  37. testImplementation 'junit:junit:4.13.2'
  38. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  39. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  40. }

答案1

得分: 0

The error is in the gradle file, Please remove below dependency from Gradle.Build

  1. com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:x.x.x

No need to use above dependency because You have used,

  1. implementation 'com.arthenica:mobile-ffmpeg-full:4.4'

Please try below command to convert from 3gp to wav

  1. arrayListOf(
  2. "-i",
  3. "input path",
  4. "output path"
  5. )
英文:

The error is in the gradle file, Please remove below dependency from Gradle.Build

  1. com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:x.x.x

No need to use above dependency because You have used,

  1. implementation 'com.arthenica:mobile-ffmpeg-full:4.4'

Please try below command to convert from 3gp to wav

  1. arrayListOf(
  2. "-i",
  3. "input path",
  4. "output path"
  5. )

huangapple
  • 本文由 发表于 2023年8月11日 01:25:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/76878027.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定