MyEclipse: Changing Android codes takes no effect - android

I know this is a rare question. Even if there are people using MyEclipse for Android development is doubted :(
The annoying thing is that after I modified my Android project (like an Activity class of a xml file), the project remained the same as it was when I imported it.
I thought there is an important feature that demonstrates this error: When I run my Android project and the console reported that "Activity not started, its current task has been brought to the front". This line occurs because the project didnt changed while as a matter of fact I did change the project and saved it.
Is there anyone has the same problem like me?
-------------add in Oct. 28-------------------
This was what I did: first, I modified one of my activities by commenting out the Toast functions; and then, I ran it however the Toast line still showed on my Genymotion emulator

Related

Build failed with an exception - I have tons of questions

After being kicked off of reddit and told to come here, I have some massive questions.
I just started to code, I am trying to release my first app. However, right as I went to submit it, I messed up and everything is crazy now! So I will start at the beginning:
I am making an app that lets you shuffle between ideas on what to build in minecraft. Each tap brings up a new random idea - that is all. It is super simple, I am keeping it that way since it is my first ever app. Now, I had it working, I have every drawing I need for the app. But as I went to submit the app to actually publish it, my .apk file was invalid. I was using the test version, which wasn't allowed to be used in the submission.
I then followed a guide that instructed me to delete my Gradle and .Gradle folders, and apparently android studio was supposed to regenerate them and fix it. Well, that did not happen. What happened was that my 'Android' folder in Android Studio became empty - there is now an app folder with nothing in it, and a Gradle Scripts section with various files that I had not seen before. The majority of my file names are red or orange.
Now, most of if not all of my code is still here. However, it says that the Gradle project sync failed, and I don't know what that means. I can no longer find out the source of these files, as in, there is no manifests or java folder located within my 'Android' heading. I don't know what to do to get it back. I had almost everything taken care of, and I am certain there is a simple way to get it all back. I did not make a VCS at the time, since nobody ever told me I should. Like I said, I am new at making apps. I still have the folder with what appears to be every single bit of code I have made so far.
If you can help me I will be extremely grateful. I have spent almost three weeks working on this, and it would be horrible to see it all go down the drain over one simple mistake.
What about creating a new project and adding your source files, dependencies and resources to it?

Cleaning my project in Eclipse caused errors

So I've been working on projects for my class and I had a small error in an extra instance I was calling. I hit clean to see if it would clear it out and instead it created errors on all of my buttons and all of my toasts. It now says they all cannot be resolved or are not fields. They were all working fine until I had hit clean as I had tested everything right before doing so. Has anyone else had this occur?
I know it sounds weird, but this occurs when there is an error in one of the .XML layouts, no matter Eclipse is not detecting it. Please check any recent changes in XMLs and clean again.

Android device monitor crashing -- possibly due to Eclipse

Here's an odd issue I can't seem to find any information on.
I'm working on an Android app with a friend who uses Eclipse -- I use Ant and the Android command-line tools. Sometimes when I checkout code that was written by him and the project.properties file gets pulled into my local workspace, I'll have to change the path to the libraries back to where they're at on my machine, as it gets automatically set for him via Eclipse. This may be of use to know in light of what just started happening when I try to launch 'monitor' as I've always done; I get this error dialog box that pops up and says: An error has occurred, please see the logfile: /home/user/.android/monitor-workspace/.metadata/.log
So I did. It was, after I'd tried to launch monitor several times to no avail, a really long logcat-like file of Java traces. I cleared them out, thinking that perhaps it had run over its own max size for internal monitor data, but that didn't stop it crashing. A new set of errors just gets appended.
This is the first time this has ever happened, and unlike essentially every other Android problem I've had, I can't seem to find any existing information on it. The device monitor now seems to want to be integrated into Eclipse. I don't use Eclipse so I'm not sure how the monitor runs within it, or whether I'm correct in assuming that some configuration file somewhere needs to have a line changed (or whatever).
Here's the content of the logfile:
http://pastebin.com/JitCWrGg
Could anyone lend a word of advice?
Many thanks!

Android ActionBarCompat Not working from the start

OK, I have been wanting to try the new ActionBarCompat, however, I am not able to run my programs in the emulator.
I have been trying to implement the following: http://antonioleiva.com/actionbarcompat-how-to-use.
and have been stuck on basically the first part. However, working with the author of that content, I was able to get further as I was not adding the project under sdk\extras\android\support\v7\appcompat folder like stated. However, I still think that might be the reason I cannot do this...
More detail can be found here: http://antonioleiva.com/actionbarcompat-how-to-use/#comment-43
Basically, on my first attempt, I just created an Android project, and changed the source code as indicated. Code would not run on the emulator. So I went back to the original code, and that ran on the emulator.
Checked online, found out I might need to add the \extras\android\support\v7\appcompat folder as a library to the project I am building. So I added that and a new android project was created. There were build errors from the start, but I failed at trying to add it as a library to my project, and deleted it....thinking this was way overboard.
After back and forth chats with author of linked website, I found out I had to do that overboard thing.
So I tried the following link to the T: (I cannot post more than 2 links due to low repuation...I will add this link as a comment below)
However, Eclipse would not allow me to add the appcompat Existing Android Project...but it did allow me to add the appcompat Existing (General) Project. I think this may be some of the problems??
Right now, I cannot run the project at all. Eclipse is showing a red exclamation mark on the project folder, but all the code seems to be fine. So I don't know what to do now...I recreated this project several times over, and this one was the one where I knew what to do...and I am still getting problems
So...
I decided to move to Android Studio...updated the IDE, updated the SDK manager to include the new support library, and other things. Created a new project, added to the build.gradle file as shown in the link provided below in the comment. I ran the ant build, and then built the project...tried to import the right things to allow ActionBarActivity, but I could not get that far.
I can import
"android.support.v7.*"
"android.support.vy.R" // and all folders within
but nothing allows me to add ActionBarActivity, and I don't know why.
FYI, I guess I would prefer a solution to Ecplise, as it seems like I actually got somewhere with it.
The best example to use is from here, and I would follow it closely. I had similiar issues when I first came across this. Problem was I misunderstood what I needed to do
http://developer.android.com/tools/support-library/setup.html#libs-with-res

Android Emulator Debugging, Code will not Update

I'm having a troubling problem testing some code for and Android app. My app has two parts, and activity where the user changes some settings, and a broadcast receiver that responds to SMS messages, both in the same package.
Here's the problem, I first implemented some simple code to test out the broadcast receiver and the activity, and both worked fine. But then as I tried to refine the code, I noticed the emulator wasn't picking up any of my changes. Event went so far as to uninstall the app from the emulator and try again, no luck. Then I added some extra Toast popups to my receiver, nothing, still running the old code. I know its running the old code because its sending out an SMS using a string constant that is no longer in the current code, so it should be impossible that it respond with that value.
Here's the kicker that has me confused. For fun I made a change to my activity. Ran the project from Eclipse and that change showed up! Tried to test the receiver code again, runs the old code that doesn't even exist anymore!!
How in the world can half the package update, and the other half not?
Can anyone help me out 'cause I'm about ready to lose my mind.
I had a similar problem. Changes made to classes imported from another project didn't get picked up by eclipse, but those made to classes in the current android project were.
Making a change to the current android project (inserting a blank line and deleting it) seemed to make eclipse pick up all the changes made and upload the app to the emulator.
I had this problem too, Now I found a working solution. Just follow these steps:
Run your project normally.
When emulator started, run your project again (DO NOT close the first emulator)
Then the updated application will be uploaded into emulator
I can't really be sure what happened but creating an new emulator image appeared to solve the issue.
I don't know why it happens but it's a problem I have all the time.
What I typically do is
Close the emulator
Close Eclipse
Reopen Eclipse
Clean the projects (in Eclipse, select Project -> Clean... -> Clean all projects)
Rerun the emulator
Annoying as hell but seems to work for me.
I'm having this problem too. It mostly happens when errors are entered into the code. The strange thing is if I go back to the original code, Eclipse doesn't revert to the original code. One thing that seems to help is to temporary delete the contents of a file, save, and rebuild, and then enter the contents back into the file, save, and rebuild.
How is one supposed to debug in such an environment?

Categories

Resources