如何使用摇篮为我的Andr​​oid应用程序构建的API客户端库 [英] How to build API client library using Gradle for my android app

查看:197
本文介绍了如何使用摇篮为我的Andr​​oid应用程序构建的API客户端库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚生成我的端点API客户端库捆绑,并根据其自述文件中的指导,这就是它说:

这是使用谷歌云端点客户端库包。为了在项目中使用此API客户端库,您需要使用摇篮建库。

如何使用摇篮打造API客户端库

在客户端包的根目录下,在命令控制台运行安装的gradle。通过运行此命令,这个API客户端包将是摇篮构建和部署到本地Maven仓库。 (摇篮没有本地存储库系统,但可以利用库系统,如Maven仓库)。

我试图建立在我的Windows库命令提示符处使用安装的gradle命令..但它说:gradle这个无法识别。

我的API客户端包目录(C:\\用户\\东芝\\文档\\ ANDROID \\核心-V5 \\芯)包含这些文件和文件夹的:


  1. SRC(文件夹)

  2. 的build.gradle

  3. LICENSE.TXT

  4. ProGuard的,谷歌的API-client.txt

  5. 的readme.html

我如何使用摇篮建立客户端库?


解决方案

我终于想通了......

首先,你必须按照此链接

再其次,你打开你的命令提示符窗口,目录更改到的地方的build.gradle位于您解压的客户端包的根目录。

第三,在运行此命令安装的gradle..

I just generated my Endpoint API client library Bundle, and according to the instructions on its README file, this is what it says:

This is a client library bundle using Google Cloud Endpoints. In order to use this API client library in your project, you need to build the library using Gradle.

How to build API client library using Gradle

Under the root directory of the client bundle, run "gradle install" in the command console. By running this command, this API client bundle would be build by Gradle, and be deployed to local Maven repository. (Gradle doesn't have native repository system, but could leverage repository systems like maven repository.)

I tried building the library on my windows command prompt using the "gradle install" command.. but it's saying "gradle" is not recognised..

My API Client Bundle Directory(C:\Users\Toshiba\Documents\ANDROID\core-v5\core) contains these files and folder:

  1. src (a folder)
  2. build.gradle
  3. LICENSE.txt
  4. proguard-google-api-client.txt
  5. readme.html

How do I build the client library using Gradle ?

解决方案

I finally figured it out...

First, you have to install Gradle by following this link

Then secondly, you open your command prompt and change directory to the root directory of where the build.gradle is located in your unziped client bundle.

And thirdly, you run this command "gradle install"..

这篇关于如何使用摇篮为我的Andr​​oid应用程序构建的API客户端库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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