I have recently started learning android development, and I just built an app that changes color and text based on pushing buttons and gestures. It ran fine on my phone (Yay!), but then on my second run, an error occurred. When hitting the "run" button, an edit configurations window opened up:
I also noticed, that on the side where my project tree should be is this instead:
I don't think there is an issue in the code because it was running fine before, but I would be happy to post the code if needed.
Also
I dont know if this was the reason, but i'll include this anyway, I tried changing the name of my project, but it wouldn't work, but I changed it back. I included this in my question because that's literally the only thing I did before this error occured.
Thank you so much for helping out a fellow programmer, I really appreciate it. I have been looking at many other forums (for some hours) about this topic, but still couldn't trouble shoot this problem. It seems kind of odd that it was working first, and then it just randomly stopped working. I cant wait for your response!
Here is the dropdown for Module:
As you can see, that is the only option.
Are you sure you are opening the project as android gradle project ?
Try to import the program not open it
Related
I've got problem with my NetBeans app, once I click on the run button, it runs the previous program
I coded. Like in the image, I ran the program (Which is PasswordGUI) and it indescribably ran the previous code (Which was Ourproject)
.. So, I'm stuck in here and need help
best wishes
I tried to search if my project in the app have kind of untidy which may this problem the untidiness
of my projects..
Dears, can you help me with my problem as it's my first time using this software, and I wanted to download my application on my phone, but it kept showing some errors. I have read some of the familiar cases but couldn't figure it out. so can you help me, please !
My code, and I've highlighted the error that keeps showing up
This is what appears on my phone when i run the program
This looks OK, debugging always slows down the app, and you will have to wait for a bit. You can go faster using some of the available emulator to test it on your computer. Try genymotion, also you can even try bluestacks.
So I've been following an oracle tutorial on JavaFX and I copied the code EXACTLY. I even went as far as to copy paste it from the text version into my IDE. I'm 100% sure that the code is correct.
The first one I followed was this video series.
The second tutorial I used to ensure that there were no errors in the code and the text version I copied.
In my frustration I decided to go from my desktop to my laptop to work, so I uploaded the faulty code to my online repository and lo and behold! It suddenly worked! Which indicates that I am right about there being no errors in the code. But as soon as I make any changes, it stops working again.
The error messages I receive indicates that it happens inside of the Application I'm extending in my Start.class where I have the main().
I'm using NetBeans as my IDE, and my project is a Maven project.
The answer seems to be that you need to clean the project when you perform changes to the FX parts. Clean before you run it and it will work fine, provided there actually isn't anything wrong with your code.
Somehow, whatever code I add to my program it does not run on my android device. It just runs my old code.
I am constantly deleting my app from my phone in the App Manager.
If I add new or change functionality the old code still runs.
I even delete complete blocks of code that should obliterate functionality. But somehow all the old functionality remains in the app after reinstall.
Simple example: On a TextButton click i shift some UI element by 200. This works great. When i delete the complete button listener it still works great but i guess completely by itself since the code should be gone.
I tried restarting Eclipse without luck.
This thing is driving me crazy. I was stuck for hours on some simple code and baffled why it did not run. Then I discovered my logs where not showing in logcat. Somehow, sometimes it does update the new code into the device since now i have a log on device resume but i deleted that at least 30 minutes ago and now it is still showing in my logcat.
Desktop app works as it should. I somehow have the feeling this happened before and over time this got worse, up to this point where i cannot test anything anymore.
So to be clear:
I add code to my app.
Run it from eclipse as Android application
No changes show up
Delete app from phone using the phones Application Manager
Delete a complete code block like the show() method that holds my complete stage
Run it from eclipse as Android application
App still runs as it was with the complete stage in tact.
-- edit --
Now I did not do anything to my code for a while and ran it. Now it probably took the code with the version with the empty show() method. However this already has been undone in the present. Could eclipse be stacking runs?
Check
"Project -> Build Automatically"
is checked. (Most likely your problem).
Also doing a
"Project -> Clean..."
tells the IDE to delete any previously compiled binaries and rebuilds them. (The APK file).
This could happen if there is an error in your code and you have selected run without warning when error in program exists. In such a case the last successfully built code would get pushed! As Lestat mentioned try doing a clean, if the project now shows up errors you have your culprit, else make sure your XML files are all proper.
Another check could be to see the timestamp of the last generated apk file in your workspace.
PS: There is a bug in eclipse where it doesnt save a file at time, a simple workspace restart fixes this.
Had the same issue - updated my code and yet the phone was running the old.
Tried Build --> Clean Project
Tried File --> Invalidate Caches/Restart
Now it works and recognizes the new code!
That said curious what #1 and #2 did behind the scenes??
For all of you android devs out there that have the Android simulator running on your comp, you know that there are a few built in apps that are already installed on your 'phone'. I had an idea for an app that would utilize a function that is already being done in the spare parts app that comes already installed.
I went on to the android developer site, dug through the source code files, and found the spare parts app, and am now trying to set it up so that running it from eclipse on my machine actually runs the app in the simulator. In other words, I want to be able to make changes to and adjust some of the things in that app for my own needs. But it won't compile, because of a number of different errors.
How do I get that source code running on my local machine? Is there some special trick that I just dont know about? I thought that if I could get the source code than the rest would be easy, but it isn't being too easy.
Not knowing what the error is, it is hard to say. But there are some tricks. First, you want the entire spare parts app in Eclipse, not just the code you are interested in running. Second, right click on your project, and go down to the "Android Tools" menu. Then click on "Fix Project Properties". Do a clean on your project and hopefully that will help.