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)

  • 相关阅读:
    VS插件哪家强?CodeRush v20.2帮你忙
    WinForms界面开发工具DevExpress WinForms v20.2亮点——全新Sankey Diagram控件震撼发布
    java中将信息写入excel
    java中使用IO流将以文件中的内容去取到指定的文件中
    java中使用IO流复制文件
    采购订单写入sap失败后,抛出自定义异常,回滚数据库
    java中将文件夹里面的文件复制到指定的文件夹(java IO)
    JAVA中IO流详解
    获取员工合同信息列表 定时任务
    Java连接MySQL数据库——含步骤和代码
  • 原文地址:https://www.cnblogs.com/beansoft/p/15391216.html
Copyright © 2011-2022 走看看