Greetings!
Let’s first make sure we’re talking about the same thing. From your statement, it appears that you’re trying to deploy your Android Studio code directly to your Driver Hub - as in, you’ve got a USB connected to the Driver Hub, and are actively attempting to deploy to it. Is this the case?
Remember, THIS is a Driver Hub:
Your Driver Hub is just a “wireless dummy head” for your robot - the Driver Hub does not contain anything but the FTC Driver Station App. The Driver Hub connects wirelessly to the Control Hub, reads the software on the Control Hub, and presents a set of options based on what it sees on the Control Hub. When you make a selection and then initialize the program, all of the work is actually being done on the Control Hub and NOT the Driver Hub. Put another way, you can replace the Driver Hub with another Driver Hub or one of the specific Android Smartphones without any changes to your robot code. That’s because all of your Team Code lives on the Control Hub.
Remember, THIS is a Control Hub:
Now that you know this, know that you should be connecting your Control Hub (via USB or wirelessly) to your programming computer. Android Studio should be deploying your software to the Control Hub. In your Android Studio toolbar, your device selection should look like this:
Anything else, and it’s not going to work properly. BUT, you might have meant Control Hub, rookies often get the nomenclature wrong - it happens when everything is called a “Hub.” Haha.
Okay, now understand that it’s absolutely possible (but not useful) to deploy code to your Driver Hub (not that it will get you anywhere, since it will never be executed), and that’s not necessarily going to throw the error you’re seeing. And since you’re a new user, you don’t have the ability to attach images to this post to help you debug.
If all of this looks correct, and you’re still in this situation, it looks like something within Android Studio is confused terribly. In order to “fix” this problem, let’s follow some common “repair” steps:
-
Clean your Build - Under the “Build” menu Item, towards the bottom of the menu, you’ll find the “Clean Project” command. Do this, and it will clean up your build (it’s possible something got built wrong and it’s gumming up the works. Starting clean and fresh may help). It may take a couple minutes to clean the build.
-
Clear your Cache - Under the “File” menu Item, 3/4 the way down, you’ll find “Invalidate Caches…” option. Check both boxes, and click the “Invalidate and Restart” button. This will restart your Android Studio once the cache has been invalidated. If something updates at the wrong time you can end up with a confused system, and so this just resets the cache and forces Android Studio to “start with a clean slate” when it comes to compiling your project.
-
Try again - Once you’ve cleaned your build, and cleared the cache and restarted, and reopened the project fresh, and you’ve got the correct project selected, and you’ve got the REV Robotics Control Hub connected, press the green arrow (or press SHIFT-F10) to build and deploy to your Control Hub.
If this doesn’t help, please contact me at:
ftctech@firstinspires.org
And I can try to help you directly. I need you to give me the steps that you took to get where you are.
(0) What version of Android Studio are you using? (Use “Help → About” to tell you)
(1) How did you download/sync the project to your computer?
(2) When you opened the project in Android Studio, did you upgrade any plugins like it asks you to (you should not do this).
(3) What is the path to the project you loaded?
(4) Are you trying to load any additional custom libraries?
(5) Take a full screenshot of your Android Studio screen with the error shown.
(6) Provide me with a full copy of the OpMode you’re trying to compile.
-Danny