ftctechnh / ftc_app

FTC Android Studio project to create FTC Robot Controller app.
761 stars 3.17k forks source link

Android Studio reads this as bad code. #30

Closed ghost closed 9 years ago

ghost commented 9 years ago

capture2 I have tried many code cleanup websites, but the issue the Studio is telling me is that I cannot resolve the symbol of OpModeRegister and I cannot resolve the method of .register. What is wrong and what must I do?

WardBenjamin commented 9 years ago

I have seen this error before. You most likely haven't installed the correct Android SDK versions. Post a picture of your SDK Manager? You need to install Build Tools v21 and a few tools.

KevinEmery commented 9 years ago

@WardBenjamin @Based-Brian10 You need to have the following SDK items installed according to the project configuration.

API 19 (SDK and Google APIs for ARM) Build Tools v 21.1.2

This is contrary to the manual which instructs you to install API 21, but if you do this you will then need to install API 19 in order to run the project as it exists currently

jaxnb commented 9 years ago

Brian, you may have not run a gradle build yet. Dependencies such as the ftc sdk won't work until you build your project.

Thank you,

On Sep 29, 2015, at 7:21 PM, Kevin Emery notifications@github.com wrote:

@WardBenjamin @Based-Brian10 You need to have the following SDK items installed according to the project configuration.

API 19 (SDK and Google APIs for ARM) Build Tools v 21.1.2

This is contrary to the manual which instructs you to install API 21, but if you do this you will then need to install API 19 in order to run the project as it exists currently

— Reply to this email directly or view it on GitHub.

erinzm commented 9 years ago

Sync with Gradle (running a build will do this).

cthulhusec commented 9 years ago

@Based-Brian10 If you are still having this issue; It appears that you have an error in your build.gradle, take a look at that and if you can not figure it out please post a screencap here so that we may help you out. I wish you luck!

calebsander commented 9 years ago

To second what others have been saying, we have seen this occur frequently before doing a Gradle Sync/Build. If you click "Build" (in the topmost menu) and then "Make Project", it should fix itself after a few seconds (wait until "Gradle Build Running" disappears from the bottom bar).

drey7925 commented 9 years ago

I've experienced the case where a misconfigured firewall/content filter combined with JVM certificate validation with HTTPS caused this issue as Gradle tried to fetch artifacts from JCenter. Could you post the Gradle log, as seen by "Show logs in explorer", as a gist, and providing a link to that gist here?

ghost commented 9 years ago

robotic capture @buddytex @calebsander @MeRPG

ghost commented 9 years ago

sdk managers tools @WardBenjamin @KevinEmery

ghost commented 9 years ago

@hexafraction I can't understand your question.

calebsander commented 9 years ago

You are putting Java code in your gradle script, so it obviously is going to fail. Reset FtcRobotController/build.gradle to how it was and then put your MecanumDefaultCode in its own .java file.

ghost commented 9 years ago

@calebsander how can I reset the code?

calebsander commented 9 years ago

Download the file from this repository and replace your current version with it.

ghost commented 9 years ago

@calebsander How do I put my Mecanum code in its own file?

jaxnb commented 9 years ago

@Based-Brian10 @calebsander Or you could use the 'git reset' command in git bash. https://git-scm.com/docs/git-reset

@Based-Brian10 Here is how you should go about creating a new op mode:

Creating a Class Creating a Class Basic OPMode code

Also be careful. The code visible in one of the screenshots you sent is NOT java. It actually looks like a wierd mixture between Java and WPILib from FRC last season.

More information on how to set Android Studio/IntelliJ IDEA up for FTC can be found here: https://raw.githubusercontent.com/ftctechnh/ftc_app/master/doc/tutorial/FTCTraining_Manual.pdf Especially from pages 87-108.

Hope I could help.

ftctechnh commented 9 years ago

Thanks to everyone who has assisted in this thread. I am going to close this item out. We would like to use this database to track verified issues/bugs with the systems. Requests for assistance should be directed to the FTC Technology forum, or in this case to the Android Studio subforum:

http://ftcforum.usfirst.org/forumdisplay.php?159-Android-Studio

TheOutlaws commented 9 years ago

And I am having troubles my team wants me to program the robot to go straight then turn and thiks is my first year doing android could I get a push in the right direction for this program

drey7925 commented 9 years ago

@TheOutlaws This is not the correct venue for support. Please use the FTC official subforums for: New FTC Technology and New FTC Technology > Android Studio.