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)

  • 相关阅读:
    SQL中的cast和convert用法示例
    SpendidCRM:在adminlayout中修改了视图上的字段后,用MyGeneration生成修改脚本
    [转]ASP.NET数据绑定方法
    商城 5051课 纪要
    .net判断用户是否已登录
    Jquery 监视按键,按下回车键触发某方法
    Sharepoint中三个强力的工具(WPManager, OSSEventManager, FriendlyQuery),另增清除已删除用户
    错误处理:此网页不允许使用基本类型"System.Web.UI.MasterPage”该类型未注册为安全类型
    MOSS页面显示“根级别上的数据无效”
    读取/设置超链接或图片类型栏的值
  • 原文地址:https://www.cnblogs.com/beansoft/p/15391216.html
Copyright © 2011-2022 走看看