如何在带有Gradle的Android Studio中包含romainguy的ViewServer? [英] How do you include romainguy's ViewServer in Android Studio with Gradle?

查看:46
本文介绍了如何在带有Gradle的Android Studio中包含romainguy的ViewServer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用RomainGuy的ViewServer( https://github.com/romainguy/ViewServer )与我使用Gradle的Android Studio项目一起使用,而我无法使其正常工作.

I'm trying to use RomainGuy's ViewServer (https://github.com/romainguy/ViewServer) with my Android Studio project using Gradle, and I can't get it to work.

我的理解是在项目根目录(库")中添加一个文件夹,将ViewServer目录放入其中(不是完整的ViewServer目录,而是ViewServer中的实际库viewserver文件夹),并在其中引用它settings.gradle

My understanding is to add a folder in project root ('libraries'), drop the ViewServer directory into it (not the full ViewServer directory but the actual library viewserver folder within ViewServer, and reference it in settings.gradle

include ':VendorSearch'
include ':libraries:ViewServer'

以及在我的build.gradle文件中

and also in my build.gradle file

compile project(":libraries:ViewServer")

执行此操作时,我会收到一条消息,提示

When I do this I get a message that says

Could not find any version that matches com.android.tools.build.gradle:0.5.+

我尝试然后在ViewServer中手动更新build.gradle以使用最新的构建工具(发布时为0.7.+),但是新的gradle版本出现相同的错误.

I tried then manually updating build.gradle in ViewServer to use the latest build tools (0.7.+ at the time of posting), but I get the same error with the new gradle version.

任何帮助和对如何包含非jar第三方库的一般说明将不胜感激!

Any help and general clarification of how to include non-jar third party libraries would be appreciated!

推荐答案

您可能需要添加存储库.将gradle.build更改为:

You probably need to add the repository. Change the gradle.build from:

buildscript {
  dependencies {
    classpath 'com.android.tools.build:gradle:0.5.+'
  }
}

apply plugin: 'android-library'

android {
  compileSdkVersion 18
  buildToolsVersion '18.0.1'
}

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:0.7.+'
  }
}

apply plugin: 'android-library'

android {
  compileSdkVersion 18
  buildToolsVersion '18.0.1'
}

这篇关于如何在带有Gradle的Android Studio中包含romainguy的ViewServer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆