winsontan520 / Android-WScratchView

[Deprecated] Provide a view which can be scratched
83 stars 35 forks source link

Error with R.styleable #26

Closed ghost closed 8 years ago

ghost commented 8 years ago

er

ghost commented 8 years ago

I found a solution to this issue, it is: Converting switch to if-else: yes

Source:http://stackoverflow.com/questions/9092712/switch-case-statement-error-case-expressions-must-be-constant-expression

joashLlaneza7 commented 8 years ago

were you able to use this library in android studio?

ghost commented 8 years ago

@joashLlaneza7: Yes I have been able to use it.

ghost commented 8 years ago

@joashLlaneza7 : If you want to import this library using android studio you can download this aar file: https://github.com/Malivuk/aar-library , which created by: @Malivuk and follow these instructions: http://stackoverflow.com/questions/16682847/how-to-manually-include-external-aar-package-using-new-gradle-android-build-syst#answer-34919810.

joashLlaneza7 commented 8 years ago

Thank you!!!

ghost commented 8 years ago

@joashLlaneza7 You are welcome.

joashLlaneza7 commented 8 years ago

Hello Yassine! i managed to import the library to android studio but can i ask another question cause im pretty new to android and Im trying to learn with this project. so i tried to test it out with the sample xml code in the read me file but i think i had the same errors as you did but not just in the switch statement but all the R.styleable even the ones outside of the switch. and i also think i have a build error. have you encountered any issues like this? thank you again! screen shot 2016-08-10 at 11 14 22 pm

ghost commented 8 years ago

Hi @joashLlaneza7! , Please try to download the library (not aar file), then import it to android studio by selecting "Import project (Eclipse ADT,Gradle, etc,)", after that fix the error in switch statement, and it will work!

joashLlaneza7 commented 8 years ago

Hi @yassine-lafryhi sorry i couldn't reply because of the heavy rains it kinda disabled out internet. Ive tried importing the test project as eclipse adt but it says "gradle sync failed: Cause: failed to find target with hash string 'Google Inc. :Google APIs:19'" i tried changing the compileSdkVersion to 24 and it still doesn't work it still says the same error. Thank you for all the help tho i really appreciated it

ghost commented 8 years ago

Hi @joashLlaneza7 there is no problem. Just open the SDK manager and install the following and re-import the project and it will work: 19

joashLlaneza7 commented 8 years ago

Hi @yassine-lafryhi!!! i imported it successfully finally! and no more errors on the code i changed the switch statement to if statement. its working perfectly!!! THANK YOU!

ghost commented 8 years ago

No problem @joashLlaneza7 we are here to help each other.