Technology Forum Has Moved!

The FIRST Tech Challenge Technology forum has moved to a new location! Please take a look at our forum blog for links and instructions on how to access the new forum.

The official blog of the FIRST Tech Challenge - a STEM robotics programs for students grades 7-12.

Note that volunteers (except for FTA/WTA/CSA will still access their role specific forum through this site. The blog also outlines how to access the volunteer forums.
See more
See less

Robot Randomly Running Old Code

  • Filter
  • Time
  • Show
Clear All
new posts

  • Robot Randomly Running Old Code

    While making programming changes we will make a change in the code and then test out that code a few times on the robot. Sometimes out of random the robot will run a previous program we had already overwritten. For example if we had code that drove the robot straight for 5 seconds and stopped and then later made changes to that code to add in a turn in the beginning, we would be testing that new code and then all of a sudden it would just go back to the previous version and run the straight for 5 seconds and stop.

    Is there a "history" that is stored in the phone that it might grab an old revision of a program we wrote and if so how do we clear that out?


  • #2
    Uninstalling the app prior to installing the new app will force a clean install. However, it will take much longer than usual.

    The easiest way to avoid this is to watch the Android Studio build process. If it doesn't successfully download the APK, it didn't update.


    • #3
      We suspect that a recent addition to Android Studio may be causing the problem.

      It typically occurs when you load a new program version, when the old one is still running and connected.

      One way to minimize the problem is to turn OFF instant run...

      Once your project is open in Android Studios... use the main menu to select:
      file/settings/Build-Execution-Deployment/Instant Run Un-select "Enable"

      If this doesn't help, then (as previously mentioned) the sure fire way to force a re-load of the code is to uninstall the old version manually...
      Just use settings/apps select the FTC Robot Controller app and click uninstall.
      If you have to do this, the next time you run, you'll have to select the active robot configuration, and you'll probably get a slew of those Device Association popups.


      • #4
        Thanks for the response! We will try this out as we would hate for it to run old code at a competition.