estherjk / AndroidWearMotionSensors

Using the accelerometer and gyroscope on an Android Wear device
MIT License
107 stars 49 forks source link

Project doesn't compile in Android Studio 2.0 #1

Closed kubark42 closed 8 years ago

kubark42 commented 8 years ago

Great example! It does seem to break with Google's latest IDE, though. This is with Android Studio 2.0 with a fresh install.

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

Possibly related: Android Studio also complains about the project gradle not being up-to-date.

Thoughts?

estherjk commented 8 years ago

Thanks for bringing this issue up! Unfortunately, I don't have an Android Wear device to test with anymore, although I can try in the emulator. Hopefully, I can at least try that in the near future.

In the meantime, can you take a look at this thread on Stack Overflow and see if it may help?

kubark42 commented 8 years ago

I've been bashing my head against this for a while. This is what finally worked:

http://stackoverflow.com/a/34352023

I don't really know what this is doing, but in class SO fashion copy-paste saved the day!

P.S. It crashes in the emulator, but I believe that's because it's looking for sensors and hasn't found them. I haven't played around with Java or Android Studio enough yet to confirm my theory.

estherjk commented 8 years ago

Glad you figured this out!

And, thanks for the note on it crashing in the emulator... you're probably right since the emulator won't have access to the sensors.

kubark42 commented 8 years ago

Sure, no prob!

Also, would you like a PR to fix this issue? I don't know enough about Android to be sure if the fix that works for me is the correct one for everyone, but if you feel it will then I'm happy to contribute.

estherjk commented 8 years ago

Please feel free to create a pull request! It certainly would be great to replicate the fix on another setup though, if possible! I certainly wish I had an Android Wear device to test on....