Flutter gradle构建失败,出现异常。>找不到com.otaliastudios:transcoder:0.9.1。

4

你好,当我尝试在Android模拟器上运行我的应用程序时,我遇到了以下错误:

我正在为我的项目使用video_compress 3.1.2依赖项,

它在iOS模拟器上工作正常,但gradle会出现这个错误,我无法解决它

我在Maven存储库中找到了这个链接,但我找不到如何使用它

https://mvnrepository.com/artifact/com.otaliastudios/transcoder/0.9.1

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.otaliastudios:transcoder:0.9.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
       - https://repo.maven.apache.org/maven2/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
       - https://storage.googleapis.com/download.flutter.io/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
     Required by:
         project :app > project :video_compress

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUİLD FAILED in 20s
Exception: Gradle task assembleDebug failed with exit code 1
Exited

---Gradle kotlin---- // https://mvnrepository.com/artifact/com.otaliastudios/transcoder implementation("com.otaliastudios:transcoder:0.9.1")

我将这个依赖项放在了build.gradle文件的android->app下,但是无法运行。

像这样--


dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation platform('com.google.firebase:firebase-bom:31.0.2')
    implementation("com.otaliastudios:transcoder:0.9.1") //------------------------>new added
}
3个回答

13
我遇到了同样的错误,正如它所述,问题似乎是特定版本的转码器库在Maven或Google存储库中不可用。
通过快速的谷歌搜索,我找到了this网页,显示它可在jcenter存储库中使用。因此,只需在android/build.gradle文件中添加jcenter()即可解决该问题。应该类似于这样:
allprojects {
    repositories {
        google()
        mavenCentral()
        jcenter()
    }
}

希望它有所帮助!

确实有帮助。问题是这个软件包没有使用最新的仓库吗? - Behzod Faiziev

3

0
添加这一行到 app/build.gradle 中:
dependencies {
.../
implementation 'com.otaliastudios:transcoder:0.10.5'
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接