FFmpeg Android错误

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

FFmpeg Android Errors

问题

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

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

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.3.2.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/github/hiteshsondhi88/libffmpeg/FFmpegAndroid/0.3.2/FFmpegAndroid-0.3.2.pom
       - https://repo.maven.apache.org/maven2/com/github/hiteshsondhi88/libffmpeg/FFmpegAndroid/0.3.2/FFmpegAndroid-0.3.2.pom
     Required by:
         project :app

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
```gradle
plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace 'com.icompilecodewithnowarnings.ffmpegthing'
    compileSdk 33

    defaultConfig {
        applicationId "com.icompilecodewithnowarnings.ffmpegthing"
        minSdk 26
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.8.0'
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation 'com.arthenica:mobile-ffmpeg-full:4.4'
    implementation files('src/main/java/musicg-1.4.2.0.jar')
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
英文:

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

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.3.2.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/hiteshsondhi88/libffmpeg/FFmpegAndroid/0.3.2/FFmpegAndroid-0.3.2.pom
- https://repo.maven.apache.org/maven2/com/github/hiteshsondhi88/libffmpeg/FFmpegAndroid/0.3.2/FFmpegAndroid-0.3.2.pom
Required by:
project :app
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

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace 'com.icompilecodewithnowarnings.ffmpegthing'
    compileSdk 33

    defaultConfig {
        applicationId "com.icompilecodewithnowarnings.ffmpegthing"
        minSdk 26
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.8.0'
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation 'com.arthenica:mobile-ffmpeg-full:4.4'
    implementation files('src/main/java/musicg-1.4.2.0.jar')
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

答案1

得分: 0

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

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

No need to use above dependency because You have used,

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

Please try below command to convert from 3gp to wav

arrayListOf(
            "-i",
            "input path",
            "output path"
        )
英文:

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

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

No need to use above dependency because You have used,

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

Please try below command to convert from 3gp to wav

arrayListOf(
"-i",
"input path",
"output path"
)

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:

确定