zoukankan      html  css  js  c++  java
  • 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)

  • 相关阅读:
    C#中将全部代码一次性折叠
    C#中图片单击旋转事件
    块参照重命名
    补强圈设计
    c# winform 按名称取得控件
    获得某控件的父控件(容器)中的所有控件
    回车键当Tab键使用
    替换CAD中原有命令为开发人员自己开发的命令的方法
    窗体设置
    判断控件的tag是否为空的方法
  • 原文地址:https://www.cnblogs.com/beansoft/p/15391216.html
Copyright © 2011-2022 走看看