美文网首页
AndroidFramework-入门 Aosp环境搭建遇到的问

AndroidFramework-入门 Aosp环境搭建遇到的问

作者: CQ_TYL | 来源:发表于2023-01-15 15:28 被阅读0次

    问题一:(原因是新版本jdk)

    Ensure Jack server is installed and started
    FAILED: /bin/bash -c "(prebuilts/sdk/tools/jack-admin install-server prebuilts/sdk/tools/jack-launcher.jar prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 2>&1 || (exit 0) ) && (JACK_SERVER_VM_ARGUMENTS=\"-Dfile.encoding=UTF-8 -XX:+TieredCompilation\" prebuilts/sdk/tools/jack-admin start-server 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update server prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 4.8.ALPHA 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-2.28.RELEASE.jar 2.28.RELEASE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-3.36.CANDIDATE.jar 3.36.CANDIDATE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-4.7.BETA.jar 4.7.BETA || exit 47 )"
    Jack server already installed 
    Jack server failed to (re)start, try 'jack-diagnose' or see Jack server log
    SSL error when connecting to the Jack server. Try 'jack-diagnose'
    SSL error when connecting to the Jack server. Try 'jack-diagnose'
    

    解决办法:
    1.root权限打开java.security文件;

    sudo gedit /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
    

    2.ctrl+f搜索jdk.tls.disabledAlgorithms找到并删除下图中的TLSv1,TLSv1.1;


    image.png

    3..bashch文件内添加环境变量

    // 到根目录下执行  
    cd ~
    sudo gedit .bashrc
    export LC_ALL=C
    source .bashrc//立即生效
    

    保存并重启下系统;
    (如果修改后不再报jack错了,但是又报其他的模块错误,make clean一下,在进行make)

    问题二:


    385b20ac77cf6ffa6e4e3deb3076128.png
    //解决方案:(依次在Terminal中执行下面3个命令)
    export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"
    ./prebuilts/sdk/tools/jack-admin kill-server
    ./prebuilts/sdk/tools/jack-admin start-server
    

    问题三:

    Jack server already installed in "/home/qiuwenxiong/.jack-server"
    Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /home/qiuwenxiong/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
    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'
    [ 95% 35694/37499] host C++: libaapt2_32 <= frameworks/base/tools/aapt2/SdkConstants.cpp
    ninja: build stopped: subcommand failed.
    build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
    make: *** [ninja_wrapper] Error 1
    #### make failed to build some targets (09:05 (mm:ss)) ####
    

    解决方案:

    1.修改jack-settings
    sudo gedit ~/.jack-settings
    //修改下面SERVER_PORT_SERVICE,SERVER_PORT_ADMIN端口号改成没人用的端口
    # Server settings
    SERVER_HOST=127.0.0.1
    SERVER_PORT_SERVICE=9088
    SERVER_PORT_ADMIN=9089
    # Internal, do not touch
    SETTING_VERSION=4
    2.修改jack-server/config.properties
    sudo gedit ~/.jack-server/config.properties
    //①:将jack.server.service.port 的端口修改成和 SERVER_PORT_SERVICE 一致
    //②:将jack.server.admin.port 的端口修改成和 SERVER_PORT_ADMIN 一致
    #Wed Apr 15 08:55:26 CST 2020
    jack.server.max-jars-size=104857600
    jack.server.max-service=4
    jack.server.service.port=9088
    jack.server.max-service.by-mem=1\=2147483648\:2\=3221225472\:3\=4294967296
    jack.server.admin.port=9089
    jack.server.config.version=2
    jack.server.time-out=7200
    3.修改.jack
    sudo gedit ~/.jack
    //复制进去
    SERVER_PORT_SERVICE=9088
    SERVER_PORT_ADMIN=9089
    //查看端口是否一致:
    cat ~/.jack-server/config.properties|grep -i port && cat ~/.jack|grep -i port|grep -v LOG &&cat ~/.jack-settings|grep -i port
    //显示下图,需要三个端口一致
    
    1674269507687.jpg

    问题四:


    image.png

    解决方案:

    1.进入/ack-admin,cd到源码目录下执行
    sudo gedit ~/prebuilts/sdk/tools/jack-admin
    2.修改文件
    将 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"
    3.停止jack服务
    out/host/linux-x86/bin/jack-admin kill-server
    4.开启jack服务
    out/host/linux-x86/bin/jack-admin start-server
    

    问题五:

    emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
    CPU acceleration status: KVM requires a CPU that supports vmx or svm
    

    解决方案:(虚拟机设置)


    image.png

    问题六:

    Your emulator is out of date, please update by launching Android Studio:
    //解决方案:启动androidStudio根据提示按下列步骤操作
     - Start Android Studio
     - Select menu "Tools > Android > SDK Manager"
     - Click "SDK Tools" tab
     - Check "Android Emulator" checkbox
     - Click "OK"
    

    问题七:

    Could not automatically detect an ADB binary. Some emulator functionality winot work until a custom path to ADB is added in the extended settings page.
    

    解决方案:

    1.点击模拟器右侧功能栏的最下边三个点
    2.左边菜单栏点击settings
    3.将Use detected 开关关掉
    

    问题八:
    模拟器一直卡在android动画,进不去桌面,可能因为缓存问题,清空缓存重新加载模拟器

    首次启动遇到模拟器一直在启动动画处,进不去桌面,可能因为之前的环境缓存问题执行下面的代码重新加载模拟器
    

    emulator -wipe-data

    相关文章

      网友评论

          本文标题:AndroidFramework-入门 Aosp环境搭建遇到的问

          本文链接:https://www.haomeiwen.com/subject/qctwcdtx.html