Announcement

Collapse
No announcement yet.

More specific installation "instructions"

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • More specific installation "instructions"

    Here is a thread that seems to have the most specific "instructions" for installing Android Studio: http://ftcforum.usfirst.org/showthre...elease-request. I followed the modified instructions [below], except (as an ME spectator) I couldn't understand nor see a conclusion of the side argument for API 19 vs. API 21, so I installed 2 of everything. [If someone officially resolves this issue, that clarification might be appreciated by the community.]

    Android Studio: This is a much more complex program than App Inventor and takes a bunch of time (hours) to install. Without some easy and fool-proof installation instructions, see the appended "short" instructions, or the detailed instructions in https://github.com/ftctechnh/ftc_app...r/doc/tutorial, Chapter 7.

    Android Studio "short" installation instructions:
    1. Download the appropriate "Java SE Development Kit 7u79" for your computer from http://www.oracle.com/technetwork/ja...s-1880260.html
    2. Install the Java 7 SDK (just click Next -> Next -> Next, but if you're short on disk space, you can de-select the "Source Code" and "Public JRE" icons during the installation)
    3. Download the FTC SDK zip from https://github.com/ftctechnh/ftc_app/archive/master.zip
    4. Unzip the FTC SDK's master.zip file to a convenient directory.
    5. Download Android Studio from https://developer.android.com/sdk/index.html
    6. Install Android Studio (just click Next -> Next -> Next, but if you're short on disk space, you can uncheck the "Android Virtual Device" option on the "Choose Components" page). [I personally didn't do this because it sounded like it might be useful, despite the issues we were having with the App Inventor emulator.]
    7. Run Android Studio (the last panel of the installation may have started Android Studio for you). The first time you run Android Studio, it will prompt for some configuration options, but the default settings do not need to be changed. If you get the message, "Unable to access Android SDK add-on list", see Note 1 below.
    8. At the "Welcome to Android Studio" screen, choose Configure -> SDK Manager.
    9. Click "Deselect All", then click the checkboxes to add these items (if you're short on disk space, you can omit the items with an asterisk):
    • Android SDK Build-tools, revision 21.1.2
    • SDK Platform Android 5.0.1 API 21, revision 2
    • Samples for SDK API 21, revision 4 *
    • Google APIs, Android API 21, revision 1
    • Google APIs (ARM System Image) {for API 19} and/or Google APIs ARM EABI v7a System Image {for API 21} [don't know if it's right installing both, but ...]
    • Sources for Android SDK, API 21, revision 1 *
    • Google USB Driver, revision 11 (not needed or selectable on Mac OS)
    NOTE: Except for the first and last items in the list above, these items are under the "Android 5.0.1 (API 21)" node.
    IMPORTANT: make sure you put a checkmark in the boxes for "API 21", not a higher or lower version. Android Studio may install other versions by default (which won't cause any problems), but it will NOT install the API 21 versions unless you put a checkmark in these boxes.
    10. Accept the license for the packages, then click Install.
    11. Exit Android Studio, run it again and choose "Import project (Eclipse ADT, Gradle, etc)".
    12. Find the "ftc_app-master" directory where you unzipped the FTC SDK, then select the "build.gradle" file and click OK.
    13. Android Studio will compile. This will take a while, and it will require network access to get some additional files which aren't included in the SDK. When it's done, click the "Gradle Console" button on the bottom right and you should see a line at the end which says, "BUILD SUCCESSFUL".
    14. You may need to wait a few minutes before the next two steps will become available; Android Studio indexes the FTC SDK and may not allow you to do any more builds until the indexing is completed. Once the indexing has completed, select the Gradle Scripts node and choose Build -> Make Project.
    15. Expand the FTCRobotController node, then click Run -> Run 'FtcRobotController'.
    16. This will prompt you to run the FtcRobotController app, which you can run on your ZTE Speed or on the emulator.

    ** Note 1: Some networks (typically those in a school or corporate environment) require a proxy server in order to connect to the Internet. Browsers can usually determine how to connect to a proxy server, but Java applications such as the Android Studio usually need to be configured separately. Ask the organization's network administrator for how to connect to the proxy server. At a minimum, you will need to know the host name and port number of the proxy server; some proxy servers will require a username and password, too. Once you have this information, you can go through the rest of the instructions, but you will need to do some steps differently:
    *** In step 7, when prompted to set up a proxy server, click Cancel (don't set up the proxy server yet!) and go through the rest of the set up steps. You will receive a message, "Android SDK is up to date." Continue with the next step.
    *** At the end of step 8 (after launching the SDK Manager), select Tools -> Options and fill in the information for the proxy server. Close the SDK Manager. In the "Welcome to Android Studio" screen, choose Configure -> Settings. Under "Appearance & Behavior" -> "System Settings" -> "HTTP Proxy", enter the proxy information and close the dialog. Close the Settings dialog and Android Studio. Re-open Android Studio and re-launch the SDK Manager, then continue with the next step.
    *** At the end of step 10, double-check that all the installations worked OK. Repeat them again for any items which failed. Continue with the next step.

    ** Note 2: If the Android Studio won't start, the configuration may have become corrupted. Remove these two directories, then start the instructions from step 7:
    C:\Users\YOUR-NAME-HERE\.AndroidStudio1.2
    C:\Users\YOUR-NAME-HERE\.android

  • #2
    I couldn't understand nor see a conclusion of the side argument for API 19 vs. API 21,
    The pre-8/3 version of the SDK used API 21; the 8/3 version used API 19. There is no harm (except for extra disk space usage) to having both 19 and 21 installed.

    ###################
    The instructions below are a shortened and slightly modified version of the Android Studio setup instructions which start at page 55 of the PushBot Build Guide at http://www3.usfirst.org/uploadedFile...uild-Guide.pdf .

    1. Download "Java SE Development Kit 7u79" for your computer from http://www.oracle.com/technetwork/ja...s-1880260.html
    2. Install the Java 7 SDK (just click Next -> Next -> Next, but if you're short on disk space, you can de-select the "Source Code" and "Public JRE" icons during the installation)
    3. Download the FTC SDK zip from https://github.com/ftctechnh/ftc_app/archive/master.zip . If you have downloaded the SDK before August 3, 2015, download it again and use the new version.
    4. Unzip the FTC SDK's master.zip file to a convenient directory.
    5. Download Android Studio from https://developer.android.com/sdk/index.html
    6. Install Android Studio (just click Next -> Next -> Next, but if you're short on disk space, you can uncheck the "Android Virtual Device" option on the "Choose Components" page).
    7. Run Android Studio (the last panel of the installation may have started Android Studio for you). The first time you run Android Studio, it will prompt for some configuration options, but the default settings do not need to be changed. If you get the message, "Unable to access Android SDK add-on list", see Note 1 below.
    8. At the "Welcome to Android Studio" screen, choose Configure -> SDK Manager.
    9. Click "Deselect All", then click the checkboxes to add these items:
    * Tools -> Android SDK Build-tools, revision 21.1.2
    * Android 4.4.2 (API 19) -> SDK Platform 19, revision 4
    * Android 4.4.2 (API 19) -> Google APIs (ARM system image) 19, revision 15
    * Extras -> Google USB Driver, revision 11 (not needed or selectable on Mac OS)
    NOTE: If you don't see the items, exit and re-launch the SDK Manager.
    IMPORTANT: make sure you put a checkmark in the boxes for "API 19", not a higher or lower version. Android Studio may install other versions by default (which won't cause any problems), but it will NOT install the API 19 versions unless you put a checkmark in these boxes.
    10. Click the "Install 4 packages" button, click the "Accept License" button, then click Install.
    11. After the installation has finished, exit Android Studio.
    12. Run Android Studio again and choose "Import project (Eclipse ADT, Gradle, etc)".
    13. Find the "ftc_app-master" directory where you unzipped the FTC SDK, then select the "build.gradle" file and click OK. If nothing seems to happen, see Note 2 below.
    14. Android Studio will compile. This will take a while, and it will require network access to get some additional files which aren't included in the SDK. When it's done, click the "Gradle Console" button on the bottom right and you should see a line at the end which says, "BUILD SUCCESSFUL".
    15. You may need to wait a few minutes before the next two steps will become available; Android Studio indexes the FTC SDK and may not allow you to do any more builds until the indexing is completed. Once the indexing has completed (the status bar line that says "Indexing" will disappear), select the Gradle Scripts node and choose Build -> Make Project.
    16. Expand the FtcRobotController node, then browse to the java - com.qualcomm.ftcrobotcontroller - opmodes folder. This has the sample opmodes you can try out if you've built the K9bot. It also has the FtcOpModeRegister class, which you will need to modify to create your own op modes.
    17. (Optional) To customize an opmode, right click one and choose Copy, then choose Paste. Give it a new name and press OK. Open the FtcOpModeRegister file, find a line that starts with "manager.register", and copy and paste it, then change the values to the new name you just entered.
    18. Plug in your ZTE Speed to your computer's USB port. In Android Studio's Run menu, select Run 'FtcRobotController'.
    19. This will prompt you to run the FtcRobotController app on a device; select your ZTE Speed and run your new app!


    ** Note 1: Some networks (typically those in schools or large organizations) require a proxy server in order to connect to the Internet. Browsers can usually determine how to connect to a proxy server, but Java applications such as the Android Studio usually need to be configured separately. Ask the organization's network administrator for how to connect to the proxy server. At a minimum, you will need to know the host name and port number of the proxy server; some proxy servers will require a username and password, too. Once you have this information, you can go through the rest of the instructions, but you will need to do some steps differently:
    *** In step 7, when prompted to set up a proxy server, click Cancel (don't set up the proxy server yet!) and go through the rest of the set up steps. You will receive a message, "Android SDK is up to date." Continue with the next step.
    *** At the end of step 8 (after launching the SDK Manager), select Tools -> Options and fill in the information for the proxy server. Close the SDK Manager. In the "Welcome to Android Studio" screen, choose Configure -> Settings. Under "Appearance & Behavior" -> "System Settings" -> "HTTP Proxy", enter the proxy information and close the dialog. Close the Settings dialog and Android Studio. Re-open Android Studio and re-launch the SDK Manager, then continue with the next step.
    *** At the end of step 10, double-check that all the installations worked OK. Repeat them again for any items which failed. Continue with the next step.
    *** During step 13, Android Studio will prompt you, "Would you like to have the IDE's proxy configuration be set in the project's gradle.properties file?", choose Yes.


    ** Note 2: If the Android Studio won't start or does nothing after importing the project in step 13, the configuration may have become corrupted. Remove these directories, then start the instructions from step 7:
    C:\Users\YOUR-NAME-HERE\.AndroidStudio1.2
    C:\Users\YOUR-NAME-HERE\.AndroidStudio1.3
    C:\Users\YOUR-NAME-HERE\.android


    ** Note 3. On some machines, the Google APIs may not be found. This problem has been noticed on machines which have upgraded from an earlier version of the Android Studio and SDK. If it occurs, use Start -> Run and enter:

    notepad %LOCALAPPDATA%\Android\sdk\add-ons\addon-google_apis-google-19\source.properties

    Change the third line in this file to:

    Addon.NameDisplay=Google APIs

    Save the file and restart Android Studio, then re-do the compilation.

    ###################
    John McDonnell
    Co-Mentor, Team 5873
    https://www.facebook.com/Team5873

    Comment


    • #3
      Thank you for clearing that up, John!
      If I remember right, we had lunch together a couple of years ago at the CT FIRST University - not sure if I'll be attending this year. Have a great season!

      Comment


      • #4
        Errors with AS and Samsung Note7

        Has anyone tried this on the Samsung Note7?
        I did not get a Run FtcRobotController, until I made it a module, I now get Run 'all in FtcRobotController'. When I try to run it, I get java errors:

        Code:
        "C:\Program Files\Java\jdk1.8.0_102\bin\java" -ea -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files\Android\Android Studio\bin" -Didea.junit.sm_runner -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Android\Android Studio\lib\idea_rt.jar;C:\Program Files\Android\Android Studio\plugins\junit\lib\junit-rt.jar;C:\Users\cdels\AppData\Local\Android\sdk\platforms\android-23\data\res;C:\tools\ftc_app-master\FtcRobotController\build\intermediates\classes\debug;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\RobotCore-release\jars\classes.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\RobotCore-release\res;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\RobotCore-release\jars\libs\Vuforia.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\RobotCore-release\jars\libs\support-annotations-23.4.0.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\RobotCore-release\jars\libs\gson-2.7.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\RobotCore-release\jars\libs\d2xx.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\ModernRobotics-release\jars\classes.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\ModernRobotics-release\res;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\WirelessP2p-release\jars\classes.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\WirelessP2p-release\res;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\Analytics-release\jars\classes.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\Analytics-release\res;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\Inspection-release\res;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\Inspection-release\jars\classes.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\Blocks-release\res;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\Blocks-release\jars\classes.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\Hardware-release\jars\classes.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\Hardware-release\res;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\FtcCommon-release\jars\classes.jar;C:\tools\ftc_app-master\TeamCode\build\intermediates\exploded-aar\FtcCommon-release\res;C:\tools\ftc_app-master\FtcRobotController\build\intermediates\sourceFolderJavaResources\test\debug;C:\tools\ftc_app-master\FtcRobotController\build\intermediates\sourceFolderJavaResources\debug;C:\tools\ftc_app-master\build\generated\mockable-android-23.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 @w@C:\Users\cdels\AppData\Local\Temp\idea_working_dirs_junit2.tmp @C:\Users\cdels\AppData\Local\Temp\idea_junit2.tmp -socket54504
        Exception in thread "main" java.lang.NoClassDefFoundError: junit/textui/ResultPrinter
        	at java.lang.Class.forName0(Native Method)
        	at java.lang.Class.forName(Class.java:264)
        	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
        Caused by: java.lang.ClassNotFoundException: junit.textui.ResultPrinter
        	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        	... 3 more
        
        Process finished with exit code 1
        When I try to run the TeamCode module, it lets me select my device in the ADB, but then I get the following:
        Code:
        Launching TeamCode
        The currently selected variant 'debug' uses split APK's, but none of the 1 split apks are compatible with the current device with density "-1" and ABIs "".
        Error while Installing APK
        Any thoughts?
        I am also using Windows 10, Android Studio 2.1.3.
        I am new to using Android Studio and to FTC. I do use Eclipse for Java web development though.
        I am trying to figure out how to get this to work so I can help mentor our team of new 8th graders.
        Perhaps I am missing some steps? I do have my device set for USB Debugging.
        ANy help would be greatly appreciated.
        Thanks in advance,
        -Chad

        Comment


        • #5
          The instructions I posted on 8/21/2015 are obsolete. The instructions below should be used to setup the 2016-17 Java-based development environment.

          1. Download "Java SE Development Kit 8u102" for your computer from http://www.oracle.com/technetwork/ja...s-2133151.html .
          2. Install the Java 8 SDK (just click Next -> Next, but if you're short on disk space, you can de-select the "Source Code" and "Public JRE" icons during the installation)
          3. Download the FTC SDK, release version, from https://github.com/ftctechnh/ftc_app . Click “Clone or download”, then ”Download Zip”. This will create a file named ftc_app-master.zip. If you downloaded the SDK before September 9, 2016, download it again and use the new version.
          4. Unzip the FTC SDK's ftc_app-master.zip file to a convenient directory.
          5. Download Android Studio 2.1 from https://developer.android.com/studio/index.html
          6. Install Android Studio. You can follow the directions at https://developer.android.com/studio/install.html or just click Next -> Next -> I Agree -> Next -> Install. If you're short on disk space, you can uncheck the "Android Virtual Device" option on the "Choose Components" page.
          7. Run Android Studio (the last panel of the installation may have started Android Studio for you). The first time you run Android Studio, it will prompt for some configuration options, but the default settings do not need to be changed. If you get the message, "Unable to access Android SDK add-on list", see Note 1 below.
          8. At the "Welcome to Android Studio" screen, choose Configure -> SDK Manager. In the dialog which appears, click “Launch Standalone SDK Manager”.
          9. Click "Deselect All", then click the checkboxes to add these items:
          * Tools -> Android SDK Build-tools, Rev 23.0.3
          * Android 6.0 (API 23) -> SDK Platform. API 23, Rev 3
          * Android 6.0 (API 23) -> Google APIs. API 23, Rev 1
          * Extras -> Google USB Driver. Rev. 11 (not needed or selectable on Mac OS)
          10. Click “Install 4 packages”, then click the "Accept License" button, then click Install.
          11. After the installation has finished, exit Android Studio.
          12. Run Android Studio again and choose "Import project (Eclipse ADT, Gradle, etc)".
          13. Find the "ftc_app-master" directory where you unzipped the FTC SDK, then select the "build.gradle" file and click OK.
          14. Android Studio will compile. This will take a while, and it will require network access to get some additional files which aren't included in the SDK. When it's done, click the "Gradle Console" button on the bottom right and you should see a line at the end which says, "BUILD SUCCESSFUL".
          15. You may need to wait a few minutes before the next two steps will become available; Android Studio indexes the FTC SDK and may not allow you to do any more builds until the indexing is completed. Once the indexing has completed (the status bar line that says "Indexing" will disappear), select the Build -> Make Project menu item and make sure the Gradle Console also says BUILD SUCCESSFUL.
          16. If the “1: Project” panel isn’t open, open it using the button on the left side of the screen. Expand the FtcRobotController node, then browse to the src -- java – org.firstinspires.ftc.robotcontroller – external.samples folder. This has the sample opmodes which you can customize to your needs. Select an op mode (e.g., “SensorMRColor”), right-click and choose Copy.
          17. Expand the TeamCode node, then browse to and select the src – main – java – org.firstinspires.ftc.teamcode node. Right click and choose Paste. In the CopyClass dialog, enter a new name (e.g., Team1234SensorTest) and press OK.
          18. In the Team1234SensorTest.java file, find the three lines which look like:
          @TeleOp(name = "Sensor: MR Color", group = "Sensor")
          @Disabled
          public class Team1234SensorTest extends LinearOpMode {

          19. Remove the middle line (“@Disabled”). You can also change the "Sensor: MR Color" to a better name such as “Sensor Test”.
          20. Plug in your ZTE Speed to your computer's USB port. In Android Studio's Run menu, select Run 'TeamCode'.
          21. This will prompt you to run the FtcRobotController app on a device; select your ZTE Speed and run your new app!

          ** Note 1: Some networks (typically those in schools or large organizations) require a proxy server in order to connect to the Internet. Browsers can usually determine how to connect to a proxy server, but Java applications such as the Android Studio usually need to be configured separately. Ask the organization's network administrator for how to connect to the proxy server. At a minimum, you will need to know the host name and port number of the proxy server; some proxy servers will require a username and password, too. Once you have this information, you can go through the rest of the instructions, but you will need to do some steps differently:
          *** In step 7, when prompted to set up a proxy server, click Cancel (don't set up the proxy server yet!) and go through the rest of the set up steps. You will receive a message, "Android SDK is up to date." Continue with the next step.
          *** At the end of step 8 (after launching the SDK Manager), select Tools -> Options and fill in the information for the proxy server. Close the SDK Manager. In the "Welcome to Android Studio" screen, choose Configure -> Settings. Under "Appearance & Behavior" -> "System Settings" -> "HTTP Proxy", enter the proxy information and close the dialog. Close the Settings dialog and Android Studio. Re-open Android Studio and re-launch the SDK Manager, then continue with the next step.
          *** At the end of step 10, double-check that all the installations worked OK. Repeat them again for any items which failed. Continue with the next step.
          *** During step 13, Android Studio will prompt you, "Would you like to have the IDE's proxy configuration be set in the project's gradle.properties file?", choose Yes.
          John McDonnell
          Co-Mentor, Team 5873
          https://www.facebook.com/Team5873

          Comment


          • #6
            Originally posted by cdelstad View Post
            Has anyone tried this on the Samsung Note7?
            I did not get a Run FtcRobotController, until I made it a module, I now get Run 'all in FtcRobotController'. ...
            -Chad
            Chad, you're probably better off starting a new thread - this thread is old and specific to installation. You seem to have gotten through the installation OK (which is pretty impressive, given the out-of-date instructions from 8/21/2015).

            That said, what version of Android are you running on your Note 7 - Nougat? The FTC SDK only supports up to Marshmallow. I don't recognize that error message. You might be better off trying on a supported phone.
            John McDonnell
            Co-Mentor, Team 5873
            https://www.facebook.com/Team5873

            Comment


            • #7
              Thank you. My Note7 is running Marshmallow (6.0.1).
              I think we will get the 'official' device at our first meeting tonight. I was just trying to get a jump on things because there is so much to learn and I am new to this as well. I need to be able to understand it to be able to teach it.
              I'll run through these instructions tonight and see how I do.
              Thank you again. I really appreciate the help.

              Originally posted by JohnMcDonnell View Post
              Chad, you're probably better off starting a new thread - this thread is old and specific to installation. You seem to have gotten through the installation OK (which is pretty impressive, given the out-of-date instructions from 8/21/2015).

              That said, what version of Android are you running on your Note 7 - Nougat? The FTC SDK only supports up to Marshmallow. I don't recognize that error message. You might be better off trying on a supported phone.

              Comment


              • #8
                It looks like I have gotten it working now - for the most part. The app runs on my Note7, but I do not see where I can select my opt mode 'Sensor Test' in the app. It does look like it wants me to configure a robot first though. Which I do not have any of the FTC hardware yet. So this is probably beyond the install issue(s).
                One thing I noted is that I did not deselect all so Nougat was still installed so the Android Studio build may have used the latest version. Another interesting bit is that though I had installed the Google USB extras, after I had uninstalled all the Nougat software I went through the list and noticed the Google USB was not installed any longer. So I re-installed it. I am not positive whether it just didn't stick the first install.
                So these instructions seem to cover things very well. Kudos to you for the help! Thank you, sir.
                Hope this helps,
                -Chad

                Comment

                Working...
                X