[英]android studio import maven project without gradle
i try include aacdecoder ( https://github.com/vbartacek/aacdecoder-android ) to my project. 我尝试将aacdecoder( https://github.com/vbartacek/aacdecoder-android )包含到我的项目中。 In decoder readme says my dependency is
在解码器自述文件中说我的依赖是
<dependency>
<groupId>com.spoledge.aacdecoder</groupId>
<artifactId>aacdecoder-lib</artifactId>
<version>0.8</version>
<type>apklib</type>
</dependency>
but when i use in my build.gradle like this 但是当我像这样在我的build.gradle中使用时
compile 'com.spoledge.aacdecoder:aacdecoder-lib:0.8'
it fail when i am try sync it. 当我尝试同步它失败。
After jitpack.io (thanks OleGG), like in image (downside) it isnt apper like exoplayer. 在jitpack.io之后(感谢OleGG),就像图像(下方)一样,它不是像exoplayer这样的包装程序。
As you can see from maven library definition, it's distributed as <type>apklib</type>
, and apklib is unsupported by Gradle. 从maven库定义中可以看到,它以
<type>apklib</type>
的形式分发,而Gradle不支持apklib。
The easiest solution will be to package this library within your repo. 最简单的解决方案是将该库打包到您的仓库中。 Also you can follow the instructions from this question How to convert apklib to aar , but anyway it'll lead to app repackage.
您也可以按照此问题的说明进行操作,即如何将apklib转换为aar ,但无论如何,这将导致应用程序重新打包。
Also you can try to use https://jitpack.io to package it automatically. 您也可以尝试使用https://jitpack.io自动打包。 In this case you need to add jitpack repo to your root
build.gradle
file like this: 在这种情况下,您需要像这样将jitpack存储库添加到您的root
build.gradle
文件中:
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
and then provide github repo as a dependency in appropriate modules: 然后在适当的模块中提供github repo作为依赖项:
dependencies {
compile 'com.github.vbartacek:aacdecoder-android:0.8'
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.