安装 android-tools

mkdir ~/android && cd ~/android

wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip

unzip tools_r25.2.3-linux.zip

配置环境变量

echo 'export ANDROID_HOME=~/android' >> ~/.bashrc

echo 'export PATH=${ANDROID_HOME}/tools/bin:$PATH' >> ~/.bashrc

source ~/.bashrc

git clone https://github.com/drakeet/TimeMachine.git

cd TimeMachine

./gradlew build

漫长的等待后错误如下:

FAILURE: Build failed with an exception.

* What went wrong:

A problem occurred configuring project ':timemachine'.

> You have not accepted the license agreements of the following SDK components:

[Android SDK Build-Tools 25.0.2, Android SDK Platform 25].

Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.

Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2 mins 40.822 secs

可以看出是因为缺少 [Android SDK Build-Tools 25.0.2, Android SDK Platform 25]

这时执行android list sdk --all 寻找匹配的序号

从上图可以看出匹配的是 3

执行 android update sdk -u -a -t 3 询问时输入 "y" 并耐心等待

Installing Archives:

Preparing to install archives

Downloading Android SDK Build-tools, revision 25.0.2

Installing Android SDK Build-tools, revision 25.0.2

Installed Android SDK Build-tools, revision 25.0.299%)

Done. 1 package installed.

可以看出安装成功,再次执行 ./gradlew build 尝试编译, 报错如下:

root@hostker:~/work/TimeMachine# ./gradlew build

Checking the license for package Android SDK Platform 25 in /root/android/licenses

Warning: License for package Android SDK Platform 25 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:

A problem occurred configuring project ':timemachine'.

> You have not accepted the license agreements of the following SDK components:

[Android SDK Platform 25].

Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.

Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.94 secs

可以看出是缺少 '[Android SDK Platform 25]',重复上次的过程

从上图可以看出匹配的是 33

执行 android update sdk -u -a -t 33 询问时输入 "y" 并耐心等待

Installing Archives:

Preparing to install archives

Downloading SDK Platform Android 7.1.1, API 25, revision 3

Installing SDK Platform Android 7.1.1, API 25, revision 3

Installed SDK Platform Android 7.1.1, API 25, revision 396%)

Done. 1 package installed.

可以看出安装成功,再次执行 ./gradlew build 尝试编译, 报错如下:

FAILURE: Build failed with an exception.

* What went wrong:

A problem occurred configuring project ':timemachine'.

> You have not accepted the license agreements of the following SDK components:

[Android SDK Platform-Tools].

Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.

Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.913 secs

android update sdk -u -a -t 2

Installing Archives:

Preparing to install archives

Downloading Android SDK Platform-tools, revision 25.0.3

Installing Android SDK Platform-tools, revision 25.0.3

Stopping ADB server failed (code -1).

Installed Android SDK Platform-tools, revision 25.0.397%)

Stopping ADB server succeeded.

Starting ADB server succeeded.

Done. 1 package installed.

FAILURE: Build failed with an exception.

* What went wrong:

A problem occurred configuring project ':timemachine'.

> You have not accepted the license agreements of the following SDK components:

[Android Support Repository].

Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.

Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

android update sdk -u -a -t 160

Installing Archives:

Preparing to install archives

Downloading Android Support Repository, revision 43

Installing Android Support Repository, revision 43

Installed Android Support Repository, revision 4399%)

Done. 1 package installed.

再次尝试编译 ./gradlew build

FAILURE: Build failed with an exception.

* What went wrong:

Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

额... 好像 gradle 进程被杀了,可能我内存太小了吧, 下次换个大点的再试

服务器android打包,在服务器上使用 gradle 打包 android 源码相关推荐

  1. android源码大全 IOS游戏源代码打包下载 小游戏|视频教程 微信小程序源码带后台全套|公众号平台

    不断更新中,下面是2017-12-22更新部分 IOS_源码及视频一小部分: 开发环境:Xcode 基于cocos2d的tweejump跳跃游戏ios经典游戏源码.rar  https://pan.b ...

  2. 作为Android开发师,你真的懂怎么读源码吗?

    前言 对于许多Android开发者来说,所谓的Android工程师的工作"不过就是用XML实现设计师的美术图,用JSON解析服务器的数据,再把数据显示到界面上"就好了,源码什么的, ...

  3. gradle编译spring源码

    文章目录 一.gradle的下载 二.Gradle配置 三.gradle和maven区别 四.下载编译spring源码 1.下载spring源码 2.修改settings.gradle 3.修改gra ...

  4. C#使用Xamarin开发可移植移动应用进阶篇(8.打包生成安卓APK并精简大小),附源码...

    C#使用Xamarin开发可移植移动应用进阶篇(8.打包生成安卓APK并精简大小),附源码 原文:C#使用Xamarin开发可移植移动应用进阶篇(8.打包生成安卓APK并精简大小),附源码 前言 系列 ...

  5. Android Glide图片加载框架(二)源码解析之into()

    文章目录 一.前言 二.源码解析 1.into(ImageView) 2.GlideContext.buildImageViewTarget() 3.RequestBuilder.into(Targe ...

  6. Android Glide图片加载框架(二)源码解析之with()

    文章目录 一.前言 二.如何阅读源码 三.源码解析 1.with() Android Glide图片加载框架系列文章 Android Glide图片加载框架(一)基本用法 Android Glide图 ...

  7. php api命名历史,PHP历史上的今天查询api源码

    PHP历史上的今天查询API源码,本地新建PHP文件上传到服务器即可使用,非储存性,直接解析网址<?php function showjson($json){ header("Acce ...

  8. 基于JAVA餐厅线上点菜系统计算机毕业设计源码+系统+lw文档+部署

    基于JAVA餐厅线上点菜系统计算机毕业设计源码+系统+lw文档+部署 技术栈 项目架构:B/S架构 开发语言:Java语言 开发软件:idea eclipse 前端技术:Layui.HTML.CSS. ...

  9. 直播App中Android酷炫礼物动画如何通过直播程序源码实现方案

    直播App中Android酷炫礼物动画如何通过直播程序源码实现方案 这个动画,如果输出成GIF的话,要3MB,尺寸是750*750.在上一篇文章中已经介绍过几种被否掉的方法,这里再稍作补充说明,如果使 ...

  10. Android Jetpack架构组件之 Room(使用、源码篇)

    2019独角兽企业重金招聘Python工程师标准>>> 1.前言 最近简单看了下google推出的框架Jetpack,感觉此框架的内容可以对平时的开发有很大的帮助,也可以解决很多开发 ...

最新文章

  1. keil中文乱码解决和个人习惯字体设置
  2. linux shell sed 在一个文件中插入另一个文件
  3. USACO SEC.1.2 No.4 Palindromic Squares
  4. 在贪心学院学习,是一种怎样的体验?
  5. 基于8086CPU微处理器的汇编学习之JMP指令
  6. 【转】几个超炫的专业词汇
  7. 最新抗灾诗作:生死不离
  8. C++17 fold expression
  9. 将centos字符编码换成utf-8
  10. 读《Unix编程艺术》笔记
  11. Stealing Harry Potter‘s Precious BFS+DFS
  12. python读取图片各点灰度值_用python按照图像灰度值统计并筛选图片的操作(PIL,shutil,os)...
  13. Guarded Suspension Pattern
  14. 聚簇索引与非聚簇索引
  15. scara机器人dh参数表_scara机器人技术参数
  16. 【Neo4j构建知识图谱】官方服务图谱大型数据集下载与可视化方法【数据集包括:食谱数据、足球、权力的游戏、美国宇航局、英国公司注册、财产所有权、政治捐款】
  17. IM方案技术调研报告
  18. excel删除无尽空白行_?Excel你不知道的神技巧:提升工作效率必备,值得老师收藏!...
  19. 多分类学习(OvO、OVR、MVM 原理区别)
  20. 旧金山犯罪预测与可视化分析

热门文章

  1. JQuery验证手机号电话号码
  2. html时显示当前时间的时钟,javascript实现页面的实时时钟显示示例
  3. 广告轮播图的前后台实现
  4. 计算机教师帮扶记录,教师结对帮扶工作总结范文(通用6篇)
  5. “Adb connection Error:远程主机强迫关闭了一个现有的连接。”之我的解决方法。
  6. linux ls和ll命令学习小结
  7. uml建模外卖订餐系统
  8. You called this URL via POST, but the URL doesn't end in a slash and you hav。。。
  9. el表达式找不到属性的错误修改方法(`javax.el.PropertyNotFoundException: 类型[java.lang.String]上找不到属性[book])
  10. 直播平台开发时iOS 开发内购功能,直播平台源码搭建