Application updates in emulator from Eclipse - android

In Eclipse, when I modify my Android application and I launch it in the emulator, Eclipse first asks me if I want to save the modified files and I answer "yes". So far, everything seems normal.
The problem is that, in the console window, Eclipse says : "Application already deployed. No need to reinstall.". And the application is not updated in the emulator.
Any idea of a reason which could explain this behaviour?
I can add that the "Build automatically" option is set.
After some more investigations, despite the "Build automatically" option set, I'm not sure the build is executed. How can I check if a new "apk" file has been created?
The problem seems to be much bigger : when I create with the wizard a brand new Android application, in the error window, Eclipse displays the following error : "failed to load properties files for project". The resource file (R) is not generated and, in the marker window, I have one error for each line of code containing a reference to the resource file.
With a complete re-installation of both Eclipse and the Android SDK manager, the problem seems to be solved.

Try re-installing the app.
Also, always exit the app in the emulator before updating it. It should work by itself, but it can be weird sometimes.

Just uninstall the application in your emulator and red-deploy it.

Related

Android Studio failed to launch

I am new to development am building my first app. As I am getting closer to completion of the project I will need Android Studio... I have installed but it simply fails to launch. I have searched my options on various sources.
Fixes I have already tried:
Added disable.android.first.run=true in the idea file
Did a clean installation
Installed the latest version of Java
Did all of the above again as Admin just in case
Set the JAVA_HOME and JAVA_JRE and cmd %echo% came back with the correct path
There is one thing I noticed. When deleting the Google folder in my Roaming the program runs again but once I pick "Do not import settings" then the program creates this folder but pops the error.
I would post the error message but the error window comes blank.
Thank you in advance for any and all help!

An internal error occurred during: "Launching Project". java.lang.NullPointerException

My android project was compiling well but suddenly it stopped launching. Then I tried to launch other projects from Project Explorer and all project threw same exception:
An internal error occurred during: "Launching Project". java.lang.NullPointerException
But console always shows everything is normal.
Android Launch!
adb is running normally.
Performing com.mmcolrev.LoginActivity activity launch
Here's screenshot of error.
If anyone face this problem, first keep in mind that error is not in your code but due to some internal issue in eclipse ADT. I don't know exact problem but luckily found way to solve it. If you ever encounter this error follow steps below:
Exit Eclipse.
Go to Android workspace.
Locate .metadata folder(make sure you set hidden folder visibility on).
Delete .metedata folder.
Start Eclipse(you will notice project explorer is empty, don't panic) and import all your projects.
Removing Gen/R.java and restarting eclipse, worked for me.
This is a cause of AVD is not picked because you might delete it or it is not picked up correctly ... in other words deployment target is not specified or it has some problem in picking up a device.
To Resolve this:
Right click your project and choose "Properties"
From "Run/Debug" Settings, Highlight over your application name then hit "Edit..."
In "Target" tab, you have to choose a virtual device to be picked automatically under option named "Automatically pick compatible device..."
to avoid such prompt you could choose the first option "Always prompt to pick device" that will ask you everytime to choose or pick a device inside which you want to run your app.
If it still not working restart Eclipse
One cause of this issue for me was that I had been updating my Android Tools with the installer. It was running in the background doing all its updates. I had forgotten about it since I had told it to do the work in the background. Then realized it had finished its work and needed a restart after the installation.
Once the upgrade / installation was done and the IDE was restarted, the Eclipse environment went back to behaving as normal.
I had the same issue.
Non of my project in the workspace would run and I would get the same message "An internal error occurred..." and details would just say something about a Nullpointer. This happend after I did some updates and all projects in the workspace started giving the same issue.
It took me some time to find the problem:
When I go to configuration of the project (Run Configuration...) I could see that "Project" in the configuration settings was empty. So my update removed the projects from the configurations. Once I put back the project in the configuration again problem was gone.
In my case, it was because I was running it with Debug As -> Android Native Application, while the emulator was closed (I debugging on the emulator, not on a real phone).
I needed to first start the emulator using Debug As -> Android Application, after which Debug As -> Android Native Application will work.
Close the emulator and the error re-appears. My conclusion is that Debug As -> Android Native Application won't work unless the emulator is already started.
I had this error with an NDK project (eclipse mars, loaded an ant project) everytime i tried to lauch on the device (google tango yellowstone) using Debug As -> Android Native Application. Note, that i switched the device and changed a dependent library since the last successful build.
When i tried Debug As -> Android Application i got this message:
Re-installation failed due to different application signatures. You must perform a full uninstall of the application. WARNING: This will remove the application data!
Do you want to uninstall?
clicking OK here solved the issue, so Debug As -> Android Native Application also worked again.
I had the same issue all of a sudden. This only happened when I ran in Debug mode, and for me what fixed it was... Run -> Remove All Breakpoints. Then I could add them back, and it ran in debug mode fine.
To resolve this issue, I just remove the old JRE System Library and point to the new JRE System Library.
Got the similar issue after update the project able to procced.
Right click on the project -->Maven --> Update Project
In My case issue was java version in updating it to correct (11->1,8) and doing maven update helped me
ISSUE : Error: Could not find or load main class com.pluralsight.fundamentals.FundamentalsApplication
Caused by: java.lang.ClassNotFoundException: com.pluralsight.fundamentals.FundamentalsApplication
ANSWER:
Open cmd (Command prompt)
Check java version (java -version)
Open POM.xml and check java version there
You are getting this error, that means java version is mismatched.
Change the java version in POM.xml (example: if java 11 , add it as 1.11 in pom.xml file)
Example: <java.version>1.11</java.version>
Update Maven by right click on the on the project in eclipse
Now it will work and the error will be vanished :)

Android Support package not present in SDK Manager

There is no android support package in my SDK manager, as shown:
And whenever I try to create an android application project I am presented with this screen at the end:
If I click install/upgrade this appears:
And it installs and everything, but nothing happens and it stays on the same screen as before. Clicking check again doesn't do anything either.
How can I get this to work?
For some weird reason android-sdk decided to install everything in /extras/compatibility instead of /extras/support which eclipse recognises, so I renamed /extras/compatibility to
/extras/support and now everything works fine.
Find your SDK directory, navigate to /extras/android/, in this folder you will see a folder named "compatibility", rename this folder to "support". Re-open Eclipse, create new Android Application Project, the process will complete without this problem occurring again!

Android: Eclipse doesn't pushed new version of app to emulator

When developing for Android in Eclipse, the emulator relaunches the old version of the app each time I run the project unless I go through the rather arduous procedure of Settings -> Applications -> Manage applications -> [my application] -> Uninstall -> Ok -> Ok in the emulator.
I had this problem on some projects but not on others when following the tutorials on the Android Developers site, and my friend turns out to have the same problem. Although this has been asked before (here and to some extent here) their problem turned out to be "some extra quotes on one of the xml file" and I can see no such thing in my project. Otherwise people seems to be saying that Eclipse should push the new version. Unfortunately, it doesn't.
I would be grateful for any suggestions.
I had this issue as well, and what i figured out was:
If you are using your device for debugging, then you should launch a debug session, not a run one.
On the other hand, if you want to install an application, or you want to launch a run session directly on your device, the version of your application set in the androidManifest.xml must be greater than the one on your phone.
Try Menu-Project-Clean, Select your project to clean, this will delete everything but the source. Eclipse should re-build automagically if not select Menu-Project-Build Automatically.
Right click your project, Android tools, fix project should automatically fix some unknown error maybe
Double check your xml, an error in a layout could cause your situation. A wrong id for example will not show as an error in eclipse.

Android app layout not updated unless I restart eclipse

Im Very new to android development.
Im following this guide: http://www.vogella.de/articles/Android/article.html#overview
for some reason, any change in my application is not reflected unless i restart eclipse.
It doesnt matter if i uninstall the app using ADB, the emulator itselt.
I clicked "refresh" and run numerous times but not avail.
I completely changed the layout everytime but I had to restart eclipse itself (not the adt) in order for it to reflect changes.
Am I missing something here? thanks.
Eclipse 3.6.2 on Windows7 64bit
Right click on the project name in Eclipse, select Run As.., Android Application. Then you should see a pop up window showing the running Emulators. Select one from the list, and click Ok.
Also make sure your app doesn't have any compile errors, as that could definitley screw things up.
After trying to run, check the Eclipse console and it should say "Uploading yourapp.apk to Device..." or something. And it should launch the app on the Emulator. Look for any errors in the Console as well.
I had the same problem and worked around by changing or removing android:id attribute of a root element (typically viewgroup). I have Eclipse SDK 3.7.0 running Win7 64bit
Hope this helps

Categories

Resources