好的,我正在制作一个Kotlin Android应用程序,为了将文件从3GP转换为wav,我添加了带有implementation 'com.arthenica:mobile-ffmpeg-full:4.4'的Android ffmpeg库,然后我添加了这段代码来转换文件FFmpeg.execute("-i" + f2 +"/storage/emulated/0/Android/data/com.icompilecodewithnowarnings.ffmpegthing/files/Documents/recording.wav")以获得进一步的上下文f2为/storage/emulated/0/Android/data/com.icompilecodewithnowarnings.ffmpegthing/files/Documents/recording.3gp

错误日志(log)太大了,不适合这里,但以下是其中的一部分

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.

我试图编译,但编译器立即拒绝了我的应用程序并拒绝编译.我本以为它会立即编译成一个APK.

编辑:

这是我的build.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'
}

推荐答案

错误在Gradle文件中,请从Gradle.Build中删除以下依赖项

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

不需要使用上述依赖项,因为您已经使用了,

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

请try 下面的命令将3GP转换为WAV

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

Android相关问答推荐

如何自定义所选的NavigationBar项目?

图像在Android Studio中显示,但不在设备中显示

Android Gradle/Groovy,如何将文件复制到APK

使用Kotlin/Compose与Java/XML指南的比较

在Jetpack Compose中将导航绘图显示在顶部栏下方、底部栏上方

Jetpack Compose-如何在进入新产品线之前删除单词?

如何在喷气背包中绕过集装箱

由于Xcode运行脚本阶段没有指定输出,在IOS Emulator中的KMM项目中生成失败

如何在使用 PointerInput 修改器时添加点击时的波纹效果

如何检测低性能 Android 设备进行条件动画渲染?

为什么 Android Studio 中的 theme.xml 目录没有任何原色

如何在每次显示可组合项时执行代码(并且只执行一次)

使用 Kotlin 在 Android 中导航时如何防止 ViewModel 被杀死?

为什么集成React Native时compileSdkVersion错误?

如何像 XML 一样在 Compose Android Studio 中折叠/展开小部件代码区域/区域

如何在组件之间导航

如何在 Android 应用程序未激活/未聚焦时显示视图?

线圈单元测试 - 如何做到这一点?

在 Android 10 (API 29) 中隐藏状态栏并在应用程序中使用其空间

Android Jetpack Compose:如何让文本利用完整的行空间并将单词换行以防溢出?