RogueWave
Aspiring developer
Profile
Posts: 337
Reg: Jan 23, 2013
Park City
5,120
04/04/14 01:20 PM (10 years ago)

Case Expression

After trying to resolve a build path issue in my project Android Dependencies, Java Build Path, I discovered the google-play-services_lib needed to be updated in the SDK Manager. I also checked for ADT updates and reopened my project after installing ADT software updates and updating Google Play SDK. I cleaned and ran the project, my build path errors went bye-bye(For now) but I got 7 Case Expression errors all associated with ClickView of certain BT_plugins. See attached imaged for details of one plugin. The other 6 Case Expression errors are exactly the same with regard to line: case R. id .btnStart http://imgur.com/VZofVuH
 
RogueWave
Aspiring developer
Profile
Posts: 337
Reg: Jan 23, 2013
Park City
5,120
like
04/04/14 01:45 PM (10 years ago)
I followed this "Quickfix" to no avail: http://tools.android.com/tips/non-constant-fields
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
04/04/14 09:36 PM (10 years ago)
Let us know when you fix it. I vaguely remember another person also reporting this issue in the past 14-days. Go back through the forum posts to find it -- shan't take too long.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/04/14 11:18 PM (10 years ago)
I've had a couple of issues with Android recently… some rather odd errors that really didn't seem like they should have been errors. And it turned out to be that there was not a 'google-play-services-remove.jar' file with my download. As soon as I 'linked' the Google Play Services, everything straightened out. If you don't want or need Google Play services, if you don't have a g-p-s-r.jar file, I have one here: https://dl.dropboxusercontent.com/u/115208762/google-play-services-remove.jar drop it into your project 'libs' folder. Make sure the project 'registers' it. Otherwise, Android is notoriously temperamental. Or maybe it's Eclipse. Nad seems to like IntelliJ, I haven't made the switch. Some of the things I do to 'shake' the quirkiness out of my project is to change APIs up and down to force the system into rethinking it's goals in life, and other little things. Sometimes I delete the project, and re-add it. There is no hard and fast rule that I've been able to discern just yet, but if I do, I'll share. Cheers! -- Smug Oh, another thing. If you install Google Play Services in an app, and then later you update Google Play Services, you need to 're-link' it in your app, otherwise weird things can happen.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
04/05/14 01:24 AM (10 years ago)
> I followed this "Quickfix" to no avail: I've noticed this error as well. Turns out that you should not use the switch statement at all, just replace it with a classical if. For instance, this is from BT_plugin_success.java: public void onClick(View view) { BT_debugger.showIt(fragmentName + ":onClick"); //id of tapped item... int itemId = view.getId(); //figure out what method... switch (itemId){ case R.id.successImage: this.wobbleImage(); return; } } I replaced the switch statement like this: //onClickView.. public void onClick(View view) { BT_debugger.showIt(fragmentName + ":onClick"); //id of tapped item... int itemId = view.getId(); if (itemId == R.id.successImage) { this.wobbleImage(); return; } } You can discover pieces of advice like this if you use Ctrl-1 as your guide when the cursor is on the switch word. Hopefuly, David will notice this and use the if instead of switch in the first place.
 
RogueWave
Aspiring developer
Profile
Posts: 337
Reg: Jan 23, 2013
Park City
5,120
like
04/05/14 10:05 AM (10 years ago)
Hello Niraj, Smug and Dusko. Thank you all for your input. Where it stands now is I'm certain that the g_p_s_.jar was certainly part of the build path from the get-go. The Android Dependencies were not updated with the latest version of google play services so, I initiated updates in both the SDK manager and ADT software update. Re-launched my project, cleaned and built, this is when I got the 7 Case Expression errors associated with certain plug ins. Immediately , I thought it was an issue with google play services so I checked project properties and verified he "green check" in libraries. Well, I decided to get brave and go to the heart of the code issues within each plug in and utilize the "Quick Fix" and initiate "switch". Now, I'm concerned that I really jacked up the code. Still have the same errors and now there are problems in my code that is over my head at the moment.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
04/05/14 10:38 AM (10 years ago)
Take a snapshot of the screen and give us the last part of the logcat report and we'll be able to help you better.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
04/05/14 11:01 AM (10 years ago)
I tried to report it in Buzz-Tools.com but the bug reporter has a PHP error. :-(
 
RogueWave
Aspiring developer
Profile
Posts: 337
Reg: Jan 23, 2013
Park City
5,120
like
04/08/14 09:50 AM (10 years ago)
The error went away after I restarted Eclipse.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
04/08/14 11:22 AM (10 years ago)
Great!
 
RogueWave
Aspiring developer
Profile
Posts: 337
Reg: Jan 23, 2013
Park City
5,120
like
04/08/14 11:27 AM (10 years ago)
Now I have another small error in the same project, that I just know, one symbol is missing and i can't figure it out. have read stack overflow, they have the exact same issues but totally different code than mine. I'm a "pattern" coder, not a "principle" coder, at this point. lol So, stack tends to explain things in theory rather than just simply saying, "Dude, put a "}" at the end of blah, blah, blah!"...anyway it's: Syntax error, "enum identifier to complete enumHeader". I posted the issue on the forum 45 minutes ago under Eclipse errors.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.