在服务器上使用grandle打包android源码
来源:互联网 发布:世界地图制作软件 编辑:程序博客网 时间:2024/06/05 02:48
安装 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
以编译https://github.com/drakeet/Ti...为例
git clonehttps://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 acceptedthe license agreementsofthe following SDK components:
[Android SDK Build-Tools 25.0.2, Android SDKPlatform25].
Before building your project, you needto accept the license agreementsand completethe installationofthe missing componentsusingthe Android Studio SDK Manager.
Alternatively, to learn howto transferthe license agreementsfromone workstationto another, gotohttp://d.android.com/r/studio-ui/export-licenses.html
* Try:
Run with--stacktrace option to get the stack trace. Run with --info or --debugoption to get more log output.
BUILD FAILED
Total time:2 mins 40.822secs
可以看出是因为缺少[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 installarchives
Downloading AndroidSDK Build-tools,revision 25.0.2
Installing AndroidSDK Build-tools,revision 25.0.2
Installed AndroidSDK Build-tools,revision 25.0.299%)
Done. 1 packageinstalled.
可以看出安装成功,再次执行./gradlew build尝试编译,报错如下:
root@hostker:~/work/TimeMachine# ./gradlew build
Checking the licensefor package Android SDK Platform25in /root/android/licenses
Warning: License for package Android SDK Platform25not accepted.
FAILURE: Build failed withan exception.
* What went wrong:
A problem occurred configuring project':timemachine'.
> You have not acceptedthe license agreementsofthe following SDK components:
[Android SDK Platform 25].
Before building your project, you needto accept the license agreementsand completethe installationofthe missing componentsusingthe Android Studio SDK Manager.
Alternatively, to learn howto transferthe license agreementsfromone workstationto another, gotohttp://d.android.com/r/studio-ui/export-licenses.html
* Try:
Run with--stacktrace option to get the stack trace. Run with --info or --debugoption to get more log output.
BUILD FAILED
Total time:3.94secs
可以看出是缺少 '[Android SDK Platform 25]',重复上次的过程
从上图可以看出匹配的是 33
执行android update sdk -u-a -t 33询问时输入 "y"并耐心等待
Installing Archives:
Preparing to installarchives
Downloading SDK Platform Android7.1.1, API25, revision 3
InstallingSDK Platform Android7.1.1, API25, revision 3
InstalledSDK Platform Android7.1.1, API25, revision 396%)
Done. 1 packageinstalled.
可以看出安装成功,再次执行./gradlew build尝试编译,报错如下:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project':timemachine'.
> You have not acceptedthe license agreementsofthe following SDK components:
[Android SDK Platform-Tools].
Before building your project, you needto accept the license agreementsand completethe installationofthe missing componentsusingthe Android Studio SDK Manager.
Alternatively, to learn howto transferthe license agreementsfromone workstationto another, gotohttp://d.android.com/r/studio-ui/export-licenses.html
* Try:
Run with--stacktrace option to get the stack trace. Run with --info or --debugoption to get more log output.
BUILD FAILED
Total time:4.913secs
android update sdk -u-a -t 2
Installing Archives:
Preparing to installarchives
Downloading AndroidSDKPlatform-tools, revision 25.0.3
Installing AndroidSDK Platform-tools, revision 25.0.3
Stopping ADB server failed (code -1).
Installed AndroidSDK Platform-tools, revision 25.0.397%)
Stopping ADB server succeeded.
Starting ADB server succeeded.
Done. 1 packageinstalled.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project':timemachine'.
> You have not acceptedthe license agreementsofthe following SDK components:
[Android Support Repository].
Before building your project, you needto accept the license agreementsand completethe installationofthe missing componentsusingthe Android Studio SDK Manager.
Alternatively, to learn howto transferthe license agreementsfromone workstationto another, gotohttp://d.android.com/r/studio-ui/export-licenses.html
* Try:
Run with--stacktrace option to get the stack trace. Run with --info or --debugoption to get more log output.
BUILD FAILED
android update sdk -u-a -t 160
Installing Archives:
Preparing to installarchives
Downloading AndroidSupportRepository, revision 43
Installing AndroidSupport Repository, revision 43
Installed AndroidSupport Repository, revision 4399%)
Done. 1 packageinstalled.
再次尝试编译./gradlew build
FAILURE: Build failed with an exception.
* What went wrong:
Gradle build daemon disappearedunexpectedly (it may have been killedor may have crashed)
* Try:
Run with --stacktraceoptiontoget the stack trace. Runwith --infoor --debugoptiontoget more log output.
额...好像 gradle 进程被杀了,可能我内存太小了吧,下次换个大点的再试
- 在服务器上使用grandle打包android源码
- Android studio 使用Grandle进行分渠道打包
- android studio grandle多渠道打包
- studio grandle渠道打包
- 在ubuntu上使用jenkins打包android
- Android studio grandle信息
- Android Studio 之 Grandle
- 在ios android设备上使用 Protobuf (使用源码方式)
- 使用AndServer在Android上搭建Web服务器
- 使用NanoHTTPD在Android上建立本地服务器
- 在C#中在服务器上打包压缩文件,并下载
- 使用git来打包Android源码
- Eclipse中的WEB项目打包部署在服务器上
- 关于IOS企业打包,发布在服务器上的若干问题
- spring boot 打包成jar 在服务器上运行
- [android tool]使用TortoiseGit把源码存到开源中国的git服务器上
- 在ios android设备上使用 Protobuf (使用源码方式) .Net 2.0 subset
- 在ubuntu 上下载 编译android 源码
- TUXEDO运行监控命令概述
- 关于Fragment点击事件穿透的三个解决方案
- HDU 6059 Kanade's trio【字典树】
- 什么是跳表
- 线段树总括
- 在服务器上使用grandle打包android源码
- 密度聚类
- 定义脚本执行顺序
- JavaScript 常用代码段
- 虚拟机网络连接的桥接(bridge),NAT,Host Only模式浅析
- 组播
- poj 1745 Divisibility(01背包)
- js+rem动态计算font-size的大小,适配各种手机设备
- scu 1952