AOSP and IntelliJ IDEA

后端 未结 4 1862
旧时难觅i
旧时难觅i 2020-12-28 09:09

Has anyone tried to work with AOSP using IntelliJ IDEA? I see in Android sources a specific folder (development/ide/intellij) but I cannot find any information how to use it

4条回答
  •  青春惊慌失措
    2020-12-28 09:29

    Official instructions can be found by going to development/tools/idegen path and checking the README file. It's a good idea to read it yourself. This is the content for IntelliJ:

    If you're using IntelliJ...

    If this is your first time using IDEGen...

      IDEA needs a lot of memory. Add "-Xms748m -Xmx748m" to your VM options
      in "IDEA_HOME/bin/idea.vmoptions" on Linux or
      "IntelliJ IDEA.app/Contents/Info.plist" on OS X.
    
      Create a JDK configuration named "1.6 (No Libraries)" by adding a new
      JDK like you normally would and then removing all of the jar entries
      under the "Classpath" tab. This will ensure that you only get access to
      Android's core libraries and not those from your desktop VM.
    

    From the project's root directory...

       Repeat these steps after each sync...
    
      1) make (to produce generated .java source)
      2) development/tools/idegen/idegen.sh
      3) Open android.ipr in IntelliJ. If you already have the project open,
         hit the sync button in IntelliJ, and it will automatically detect the
         updated configuration.
    
      If you get unexpected compilation errors from IntelliJ, try running
      "Build -> Rebuild Project". Sometimes IntelliJ gets confused after the
      project changes significantly.
    

    The following error message might pop up when following the instructions.

    Couldn't find idegen.jar. Please run make first.

    You can fix the error message by reading here: https://www.protechtraining.com/blog/post/860?ncr=1

提交回复
热议问题