• Building Android Studio


    Building Android Studio
    Set up IntelliJ for developing Android Studio
    • Download the latest IJ community edition.
    • Add a JDK to it: Project Structure | SDK's | Add new JDK with the exact name "IDEA jdk". (Note that this SDK should be a standard JDK, NOT an "IntelliJ Platform Plugin SDK")
      • Please use JDK 1.6, since we are still supporting the IDE running on Java 6. You can use later versions of the JDK, but you may accidentally access APIs that are not available in 1.6, so if you plan to contribute changes back, make sure you are using JDK 1.6 as your IDEA jdk.
    • If you are not on Mac OSX, also add tools.jar from your JDK to the IDEA jdk's classpath. (located in <JDK Path>/lib/tools.jar).
    • (Note: You must have the Groovy and UI Designer plugins enabled. They should be, by default, but if you run into compilation errors in .groovy files that might be the issue.)
    The Studio Source Code

    After following the download instructions (here), you will have the Android plugin source code under tools/adt/idea, the IntelliJ IDE base in tools/idea/, and a lot of shared libraries in tools/base/.

    Working and building from within IDEA

    In IntelliJ, open the Android Studio project by choosing Open Project and selecting the folder tools/idea/. You can now compile and run and debug the project.

    Building from the command line

    $ cd tools/idea
    $ ./build_studio.sh

    (If you're on Windows and can't run the .sh script, just run "ant" instead; the script just sets up some environment variables first.)

    Look for the artifacts in out/artifacts.

    Running Unit Tests

    You can run individual tests (or the AllTests suite) from within the IDE. To run the tests on the command line, invoke

    $ cd tools/idea

    $ ant test

    We're also working on GUI tests. These require a display (and take over your mouse and keyboard). To invoke these, run

    $ cd tools/idea

    $ ant guiTests

    If you're attempting to run unit tests in the IDE and you get a "File access outside allowed roots" exception failure, you'll need to set the following property in your unit test run configuration (it's easiest to set this in the default unit test configuration) :

    NO_FS_ROOTS_ACCESS_CHECK=true

    Typical issues
    • "When building the firs time I get an error: java: package com.sun.source.tree does not exist " ==> Make sure to add tools.jar to the "IDEA jdk" configuration, as explained above. This is easy to miss. To fix it: File > Project Structure > SDKs > "IDEA jdk" > classpath > + > select C:Program FilesJava(jdk_version)lib ools.jar.
    • If you are trying to load and run the IDE project on Windows with Cygwin, you may get a "java.lang.UnsatisfiedLinkError: C:cygwin64home... oolsideainwinjumplistbridge64.dll: Access is deined" exception. To fix this, you need to open the various .exe and .dll files in the tools/bin/win folder and give the execute permissions. Open the folder in Windows Explorer and select one of the executable files and right click on it to open the Properties dialog. Click on the Security tab, click on the Edit... button and grant execute permission. Hit OK. Repeat for all the necessary .dll files.
    • You can also open a command prompt as Administrator and use the following command:

    icacls C:cygwin64homeAndroidaosp oolsideainwin* /grant Everyone:(RX)

  • 相关阅读:
    Redis是可以安装成windows服务-开机自启 win7 64位
    lnmp 一键安装包 nginx配置tp5 phpinfo模式 隐藏index.php
    Redis PHP通用类
    Swoole2.0协程客户端连接池的实现
    Tomcat 部署项目无法加载静态资源
    IntelliJ IDEA 的下载和安装
    Redis 配置内容总结
    Eclipse 中 Spring 项目的 XML 配置文件报错 Referenced file contains errors
    Eclipse 中 Maven 项目 pom.xml 提示错误 org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter)
    文本编辑器 EditPlus 的激活与设置
  • 原文地址:https://www.cnblogs.com/beansoft/p/15391216.html
Copyright © 2020-2023  润新知