2016-02-12 110 views
0

我尝试在我的项目中包含aacdecoder(https://github.com/vbartacek/aacdecoder-android)。在解码器自述说我的依赖是android studio import maven project without gradle

<dependency> 
     <groupId>com.spoledge.aacdecoder</groupId> 
     <artifactId>aacdecoder-lib</artifactId> 
     <version>0.8</version> 
     <type>apklib</type> 
</dependency> 

,但是当我在我的build.gradle使用这样

compile 'com.spoledge.aacdecoder:aacdecoder-lib:0.8' 

当我尝试同步它,它失败。


后jitpack.io(感谢OleGG),像在图像(下行),它不是像外行人apper。

enter image description here

回答

1

你可以从Maven的库定义看,它的分布为<type>apklib</type>,并且apklib是不支持的摇篮。

最简单的解决方案是将此库打包到您的库中。你也可以按照这个问题How to convert apklib to aar的指示,但无论如何它会导致应用程序重新包装。

您也可以尝试使用https://jitpack.io自动打包。在这种情况下,你需要jitpack回购添加到您的根build.gradle文件是这样的:

allprojects { 
    repositories { 
     jcenter() 
     maven { url "https://jitpack.io" } 
    } 
} 

,然后提供GitHub库中相应的模块依赖关系:

dependencies { 
    compile 'com.github.vbartacek:aacdecoder-android:0.8' 
} 
+0

感谢它是工作,但我怎么能导入我的课,因为这是工作导入com.spoledge.aacdecoder.AACPlayer;但我不能使用import com.github或com.spoledge。他们不会在com之后来。 – eren

+0

可能是,jitpack无法将github repo转换为存档。所以,当您需要手动创建库时,我们又回到了这种情况 – OleGG