官方建议使用Ubuntu16.04或18.04进行编译。(个人建议使用16.04进行编译,18.04我试过出了很多问题还没有解决,目前使用的wsl-Ubuntu16.04编译成功,不清楚的可以看这里非系统盘安装WSL-Ubuntu16.04:https://blog.csdn.net/weixin_39510813/article/details/118704027?spm=1001.2014.3001.5501,安装好之后记得再更换一下软件源:https://blog.csdn.net/weixin_39510813/article/details/82497416)
之后我们通过添加网络驱动器添加(映射网络驱动器->\wsl$\Ubuntu-16.04,名字由你打开后的wsl的名称为准,我这里是Ubuntu-16.04):
https://wiki.t-firefly.com/zh_CN/Firefly-RK3399/compile_android7.1_industry_firmware.html#
基本上是按照官方给的步骤来的:
安装并配置jdk:
sudo apt-get install openjdk-8-jdk
sudo update-alternatives --config java
sudo update-alternatives --config javac
安装软件包:
sudo apt-get update
sudo apt-get install git gnupg flex bison gperf libsdl1.2-dev \
libesd-java libwxgtk3.0-dev squashfs-tools build-essential zip curl \
libncurses5-dev zlib1g-dev pngcrush schedtool libxml2 libxml2-utils \
xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev \
lib32readline-dev gcc-multilib libswitch-perl libssl-dev unzip zip
下载SDK,这个地方耗时比较长,可以放到晚上下载:http://www.t-firefly.com/doc/download/page/id/3.html#other_369
之后进行校验MD5:
$ md5sum /path/to/rk3399-firefly-industry-71-20190926.7z.001
afb279a7d2966908bcf53ce2c2c05edc rk3399-firefly-industry-71-20190926.7z.001
$md5sum /path/to/rk3399-firefly-industry-71-20190926.7z.002
2bc5a41fd1056f1d1ab1f7e84f666bee rk3399-firefly-industry-71-20190926.7z.002
解压(解压001即可,002和001关联的):
mkdir -p ~/proj/firefly-rk3399-Industry
cd ~/proj/firefly-rk3399-Industry
7z x /path/to/rk3399-firefly-industry-71-20190926.7z.001 -r -o.
git reset --hard
处理bundle仓库:百度云下载[bundle压缩包]
1. 进入SDK根目录
cd ~/proj/firefly-rk3399-Industry
2. 下载远程bundle仓库
git clone https://gitlab.com/TeeFirefly/rk3399-industry-nougat-bundle.git .bundle
3. 若下载仓库失败,目前bundle仓库大约1.4G左右,所以同步的时候可能会出现卡住或失败的问题,可以从下方百度云链接下载并解压到SDK根目录,解压指令如下:
7z x rk3399-industry-nougat-bundle.7z -r -o. && mv rk3399-industry-nougat-bundle/ .bundle/
4. 更新SDK,并且后续更新不需要再次拉取远程仓库,直接执行以下命令即可
.bundle/update
5. 按照提示已经更新内容到 FETCH_HEAD,同步FETCH_HEAD到firefly分支
git rebase FETCH_HEAD
整体编译:
./FFTools/make.sh -j8 -d rk3399-firefly -l rk3399_firefly-userdebug
打包固件:
./FFTools/mkupdate/mkupdate.sh -l rk3399_firefly-userdebug
打包完成会在 rockdev/Image-rk3399_firefly/ 生成打包好的固件
解决完问题后编译还是比较快的:
烧写之前已经总结过,还不太清楚的可以看这里:https://blog.csdn.net/weixin_39510813/article/details/117261824?spm=1001.2014.3001.5501
Jack server failed to (re)start, try ‘jack-diagnose’ or see Jack server log
No Jack server running. Try ‘jack-admin start-server’
No Jack server running. Try ‘jack-admin start-server’
根据这里添加环境变量即可:
https://stackoverflow.com/questions/43996563/jack-admin-command-not-found
jack 服务器可以在 Android 源代码中的prebuilts/sdk/tools位置找到,并且可以从那里运行。
prebuilts/sdk/tools$ ./jack-admin stop-server
prebuilts/sdk/tools$ ./jack-admin start-server
或者,可以通过运行以下命令将此文件夹添加到 PATH:
export PATH=$PATH:~/myandroid/prebuilts/sdk/tools
Communication error with Jack server (35), try ‘jack-diagnose’ or see Jack server log
SSL error when connecting to the Jack server. Try ‘jack-diagnose’
通过这里发现jdk的问题,取消TLSv1, TLSv1.1 禁用:/etc/java-8-openjdk/security/java.security
jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves
vim打开后搜索TLSv1后取消即可。
编辑 h o m e / . j a c k ∗ ∗ , ∗ ∗ home/.jack**,** home/.jack∗∗,∗∗home/.jack-settings 和 $home/.jack-server/config.properties,修改SERVER_PORT_SERVICE和SERVER_PORT_ADMIN的端口号,然后保存。
SERVER_PORT_SERVICE=8078
SERVER_PORT_ADMIN=8079
根据这里:https://blog.csdn.net/babytiger/article/details/111050099
原因是 /home/user/.jack-server应该是owner ,和group 都 应是 root ,root,但不知为啥变成了 user,user
要改回去
chown -R root .jack-server/
chgrp -R root .jack-server/
全路径命令行
chown -R root /home/user/.jack-server
chgrp -R root /home/user/.jack-server
FAILED: /bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Out of memory error (version 1.2-rc4 'Carnac' (298900 f95d7bdecfceb327f9d201a1348397ed8a843843 by [email protected])).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx'.
Warning: This may have produced partial or corrupted output.
[ 4% 730/16889] Building with Jack: out/target/common/obj/APPS/PhotoTable_intermediates/with-local/classes.dex
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
根据这里解决,修改Java虚拟机虚拟内存大大小:https://blog.csdn.net/liangtianmeng/article/details/89522092
修改Jack的配置文件prebuilts/sdk/tools/jack-admin
这是一个管理Jack的shell脚本,找到start-server函数,直接修改其启动参数,由原来的
JACK_SERVER_COMMAND="java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=TMPDIR JACK_SERVER_VM_ARGUMENTS -cp LAUNCHER_JAR LAUNCHER_NAME"
更改为
JACK_SERVER_COMMAND="java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=TMPDIR JACK_SERVER_VM_ARGUMENTS -Xmx4096m -cp LAUNCHER_JAR LAUNCHER_NAME"
此时Jack服务器仍然在后台执行,所以我们需要将其停止,然后重启启动(make会自动启动Jack服务器)才能使得修改后的参数生效。
我们执行下面的命令此时Jack服务器仍然在后台执行,所以我们需要将其停止,然后重启启动(make会自动启动Jack服务器)才能使得修改后的参数生效。
我们执行下面的命令:
先停止服务
./prebuilts/sdk/tools/jack-admin stop-server
重新开始服务
./prebuilts/sdk/tools/jack-admin start-server