Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

"Shaking Things Up" is not meshing well with previous code

So, having resolved some tech hurles recently, I'm back on track following along the first project videos, when we get to setting up the shake-to-activate section.

I downloaded the ShakeDetector.java element and set it beside my other source files. I even went on through another video (or two?), adding sensor hooks and deleting old button code, before I realized there's a problem.

It's a red "x" on the ShakeDetector.java icon in eclipse.

As I drill down, I realize it seems to be many items. The first was, it didn't like com.example.whatever in the code's declaration. OK, I admit I renamed mine, so I made the same change in that file.

Beyond that, there were multiple places where the fixit thingy is telling me to "Remove the @Override" from the code. But we just went through the significance of this, and certainly this code has been vetted and used many times already.

Then there's one that tells me that my android-17 doesn't have source with it or some such, and prompts me to point to the file; I can't find that one just now. (Oh yeah, my intellisense isn't working fully either).

Looking at the screen, my CrystalBall.java and MainActivity.java are still squeaky clean, so I'm really hoping this weird collection of errors really have some core configuration error in common that is triggering them.

Where should I start looking? (I can do screenshots if you need 'em!)

Thanks,

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Hi @Mark,

This problem has popped up a few times, though I don't know why exactly it is happening. The first problem was having a different package name, which you already solved. The other has to do with project-specific compiler settings. Check out this other post for help on how to fix it:

https://teamtreehouse.com/forum/adding-a-shake-detector