I am using Android Studio 3.2.1 Build #AI-181.5540.7.32.5056338 (linux version). Although this problem might also appear in Intellij Idea which I have not tested. The problem is whenever I name my instance variables by certain names (like place,time,date) they are instantly marked as used right when I declare them! Below is a screenshot of the problem:
Here I just opened the default Hello World project and typed some declarations. I have not touched anything in the project other than this. Imagine how much of a nightmare would be this kind of misinformation for big projects! Can anyone here solve this or suggest any workaround (other than changing names of those variables)? (And also if you feel to downvote then atleast comment first)
Related
Basic background data: Windows 7, Netbeans 8.0.2, LWJGL 2.9.3, Slick Util.
The rest of the code is my own.
So, periodically, I was having what I thought was a bug, that caused my program to run within the IDE, but would fail when I used "Clean and Build" on the project.
Today, when it happened again, I decided to get to the bottom of it. So, taking a copy of the whole project folder, that was working and otherwise identical, and replacing 1 file at a time, and testing it, I was able to narrow it down to the /nbproject/project.properties file.
Every other file could be replaced and the problem persisted. Replace ONLY this file, and the problem went away. So then I loaded up both files and compared them side by side (using the Netbeans "Diff to..." feature) and narrowed it down to the following lines:
javac.classpath=\
${libs.LWJGL-2.9.3.classpath}:\
${libs.0-Slick_Util.classpath}:\
${libs.0-Loaders_v03.classpath}:\
${libs.0-Text2D_v03.classpath}:\
${libs.0-Foundation_v04.classpath}:\
${libs.0-Abstracts_v04.classpath}
Now this code, looks like it is telling the compiler the ORDER in which the libraries should be loaded (I may be wrong).
With that in mind, I decided to test it. I copied this block from the working file, to the non-working file, and it worked just fine. The working code btw is this:
javac.classpath=\
${libs.LWJGL-2.9.3.classpath}:\
${libs.0-Slick_Util.classpath}:\
${libs.0-Foundation_v04.classpath}:\
${libs.0-Abstracts_v04.classpath}:\
${libs.0-Loaders_v03.classpath}:\
${libs.0-Text2D_v03.classpath}
The only differences, you may notice, is the ORDER. Continuing my test, I went into the non-working project's Library properties page, and simply re-ordered the libraries to match the working list. PROBLEM WENT AWAY! If I simply moved the Foundation and Abstracts libraries down in the list, the PROBLEM CAME BACK!
I must have tried a dozen different order combinations, and got about 2/3 that failed, and 1/3 that worked. The ones that worked all involved Foundation and/or Abstracts to be near the top.
Why is this happening? How can I know what order my libraries need to be loaded to avoid the error?
The error btw is this:
F:\Dropbox\2-Documents\4-Java Programming\Library\0-LoadingScreen_v04-Copy\src\A_Library\Test_LoadingScreen.java:94: error: cannot find symbol
Lib_Foundation .setConfigLocation(configLocation);
symbol: method setConfigLocation(String)
location: class Lib_Foundation
Any information that can help me avoid this problem in the future will be appreciated.
It would appear that either “Loaders_v03” or “Text2D_v03” contains its own version of Foundation, including an incompatible Lib_Foundation class. A classpath is searched in order, so your current solution—reordering javac.classpath—will always work, assuming NetBeans doesn’t mess with it the next time you make any change to your project.
Whether that will break Loaders and Text2D depends upon how well Foundation adheres to object-oriented design: public classes and their public members are never supposed to be changed or removed in successive versions. (That is why 20-year-old code written for Java 1.1 will still compile in Java 8.)
I am new to Android Development/Java Programming/Eclipse so please bear with me. I've been going through the Android Developer Training (developer.android.com/training) and the Hello Android book by Ed Burnette and keep running into a problem that is making it difficult to move forward. I'll do my best to describe it and am hoping that the community can help me resolve it.
I began seeing this issue with the Android Developer Training (around Adding the Action Bar -> Adding Action Buttons) and it became impossible to circumvent at Hello Android's 3.3 Creating Opening Screen when I tried adding the Sudoku buttons. The only change I made when going through Hello Android was adding the Android Development Toolkit (ADT) for Eclipse. I don't recall this being a required download going through the Android Developer Training page so I am wondering if its addition could have contributed to the problem.
The issue that I keep running into is that when I go to build the project, Eclipse keeps telling me:
action_settings cannot be resolved or is not a field
activity_sudoku cannot be resolved or is not a field
container cannot be resolved or is not a field
fragment_sudoku cannot be resolved or is not a field
sudoku cannot be resolved or is not a field
I've tried several fixes that I saw on in the forum including deleting the import.android.R from the sudoku.java file in my src folder but that brings up a bunch of errors that say R cannot be resolved into a variable. I've tried cleaning and rebuilding and restarting Eclipse, methods that occasionally worked before Hello Android and the plugin, but keep getting the same errors. I've also tried setting to Android 3.0 and higher thinking that might be an issue but there was no change. Occasionally I get another error regarding not being able to find the path for a container but I've been playing around with the IDE for 15 minutes and can't seem to get it to pop up again.
I could really use some help on this.
Hope to hear from you,
Yusif Nurizade
This solution may, first and foremost, demonastrate how green I am with Android programming but I believe I found the solution.
Initially following the Android Developer Tutorial, I downloaded the latest versions - 18, 19, 20, etc. When I was creating the project, however, I was specifying much early versions for compatibility; all the way down to 7 or 8. I looked into this because I remembered seeing a message from the IDE regarding the Action Bar and how some commands weren't supported on Version X.
I went back and downloaded all the versions down to 7 or 8 and set the compatibility accordingly. The example now works with minimal other changes. I realize that I may be overlooking something but this is the only major change I made and it seems to have done the trick.
Hopefully this will help other newbies!
Yusif Nurizade
I recently came across a bug with an unresolved issue in SDK 2.2 and, as its fixed in 2.5, decided to explore a switch.
Now I am new to GWT and I have no idea of the effects of doing such a switch, but figured it couldn't hurt to mess around locally. I went ahead and successfully updated to 2.5 locally to test and can run with no errors. However many of the text boxes have changed appearance and my navigation bar disappeared, etc...
Is this type of behavior normal after an update? If so I cant imagine why anyone would be in a hurry to do so, as spending enormous amounts of time to modify all pages is pretty unrealistic. Is there maybe some type of quick fix or an error i may have made to cause this?
If you want to put a lot of resources into a GWT project it is always a good idea to check regularly how the project is going on. On the release-note page you can check what's new and what has been deprecated. This way you can make an informed and rational decision whenever you want to update. This is very important since going from an old version (say 1.0) to a new one (i.e 2.5.1) might give some headaches to the programmers. Spendind half-an-hour checking what's going on every month will make your life easier.
GWT has an issue tracker where you can see the open issues and what has been resolved. Many issues have never been fixed, but I read the GWT team intend to solve the 100 most important issues for the next release. GWT is now open-source and you can contribute to its development whenever you know of to fix one of those issues.
Last but not least: many people say a lot of things, which are not always correct (including on Stack Overflow). Always dubble check before making important decisions.
Giving this advice is all I can do for you so far...
Yet, if you give me some info about that bug you expected to be fixed and the exact name of that "navigation bar" widget you might find out information on the sites above to check their status. But I can't search that for you if I don't know what the bug was and the name of the widget that is broken. Also, when you say "many of the textboxes" I understand it's not every textbox that's broken but some variant your are using in some particular places. More information would also be needed...
I have the android 4.1 and 4.0 SDK installed on my laptop. I've done plenty of projects just using a blank activity, but when I decided to try a "master detail flow" example from within Eclipse (create new Android project, select MasterDetailFlow) the other day it wouldn't even let me build. I have errors right off the bat. Surely this can't be right? Here are the errors:
(1)The method onItemSelected(String) of type ItemListActivity must override a superclass method ItemListActivity.java /Master Detail/src/com/example/master/detail line 39 Java Problem
(2)The method onItemSelected(String) of type new ItemListFragment.Callbacks(){} must override a superclass method ItemListFragment.java /Master Detail/src/com/example/master/detail line 27 Java Problem
I'd like to try and use the master detail forms so I can understand more advanced android layouts. Could anyone point me into a better direction with that as well? Thanks!
Ugh, that's a pain, but it's a pretty simple solution. The rules for when you should/shouldn't use #Override switched from Java 5 to Java 6, so depending on Eclipse's default JDK it'll sometimes yell at you when #Override isn't there but should be, or vice versa.
Set the compiler level in Eclipse to at least JDK 6 and the errors will magically disappear :)
I'm looking at learning JavaFX.
I've tried setting Eclipse to develop a small app and I've downloaded the Eclipse plugin.
Eclipse JavaFX plugin
BUT... it just seems, well, flakey.
So I have 3 questions...
1: Is there a better plugin?
2: Or is there some great set of tutorials out there that I'm missing?
3: finally, is it meant to be easy to call Java code from FX? I'm stuggling, it there a good example somewhere?
On questions 1 & 2, Eclipse underlines code in red that just shouln't be. For example..
see this image... alt text http://www.qenet.co.uk/fx.jpg
Why does it underline bit of imports in red?
I know this is little of an open ended question. So I guess my main question is this...
Is my experiance of JavaFX and Eclipse the best I can hope for? Or am I missing something ?
(and I'm not looking for a Yes/No response) :-)
Just looking for a discussion on how best to learn/develop JavaFx.
This kind of thing is not unusual. A lot of Eclipse plugin editors have problems dealing with error tags and the like. For example,
I find that the XML and HTML file editors often fail to clear error and warning markers, and the only way to get rid of the markers it is close and reopen the file.
Even the Java viewer gets it wrong in some circumstances, though the problem goes away when the relevant files are saved.
When you update a spelling dictionary, the spelling checker is not rerun and the spelling error markers are not updated. In fact, you have to restart Eclipse for this to happen.
I suggest that you try saving files, and closing/reopening editors to see if that makes the bogus error markers go away. Then decide whether Eclipse is the right IDE for this task.
I've never used NetBeans (at all), but you would expect that it would do a better job supporting JavaFX. After all NetBeans and JavaFX are both high profile Sun products at the moment.
Netbeans is really the only way to go at the moment for JavaFX development. They are both Sun products and Sun has made sure the two work very well together. Before long Eclipse and others will catch up but for the moment that's how it is.
There is another JavaFX plug-in for Eclipse from Exadel. You can download it here: http://exadel.org/javafxplugin. Give it a try.
I have similar problems but funnily only under Linux, not Windows. Hope they change that soon.
To me this has happened when I wronlgy installed javafx sdk 1.2.3....This plugin works only with 1.2.1... :/