I have two app's projects in two different Eclipse's workspaces. When I run one of the apps, the other is removed from my phone and I can't figure out why. I have already tried cleaning up each project (Eclipse->Project->Clean...) because I suspected that it was some kind of Eclipse's mess, but it didn't work.
Any suggestions?
Have you named them differently in your manifest? If they share the same properties, then the installer could mistake one for the other, and remove the "old" one when installing the new one.
Related
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?
I’m having trouble using Eclipse ADT projects as libraries. I have three projects in eclipse: ToolProject, AppProject, DevProject.
The ToolProject contains classes I use in several apps (I actually have AppProject_2, as well, something completely different). In Properties, Android -> IsLibrary is ticked.
The AppProject contains the top-level app code, Activity, manifest, etc. It works – I can run it on my phone (IsLibrary ticked or unticked – both fine). Properties -> Android Library references ToolProject. The BuildPath does not reference ToolProject, in any tab.
The DevProject is so I can download and run the lastest draft on my phone, without clobbering the existing AppProject that’s running there. I have created a new project, different launcher icon, different package. The Activity just subclasses AppProject’s Activity.
I can’t get DevProject to run on my phone. The console shows the normal messages. Logcat shows nothing for the launch. On the phone, I quickly get the “Sorry! The application DevProject (…) has stopped unexpectedly. Please try again.” Nothing – no screen – from the app appears.
AppProject is marked as a library. I’ve tried DevProject with Library-reference to both AppProject and DevProject, and to just AppProject. Neither are in DevProject’s BuildPath tabs.
Can someone tell me where to go and what to do there? I’m sorry for such a vague question, but I don’t know what to tweak. Pointers to the relevant documentation or previous questions would be great.
Disclaimer: I have searched for discussions. I have read Android’s Manifest documentation. But I remain unenlightened.
The app startup, in onCreate, used files from the assets/ folder. I had forgotten to copy these from AppProject to DevProject.
Problem solved.
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
I have an Android project, and I wanted to replace two of the images I use in it with updated ones. So, with Eclipse closed, I replaced the two images with two of the same dimensions. When I re-opened eclipse, it updated one of the images, but the other one is an old version of the image. I can't figure out for the life of me how to get it to see the new one. I have run Project->Clean , and refreshed the project, but it still references that old image for one of them. The old image is definitely nowhere to be found in the project directory.
What am I missing here? Keep in mind I'm not a very experienced Android dev at all.
If you haven't found the solution yet go to menu project->clean... That should be enough.
Cheers!
I am trying to restructure an existing app so that, except for a few override-able methods in a derived activity, all code will reside in a library. This still doesn't work for some reason, but in the process of attempting to troubleshoot this, I discovered much to my dismay that there are two .apk files installed, not one (when I run a debug session from eclipse):
The first (and larger file) is
having the original library name.
The second (only 20KB in size) is
having the derived application name.
Why is that and where can I learn more about this?
Could that explain the ClassNotFoundException problem I am having?
I found the answer myself. It turns out that I had 2 critical settings in the Properties of both projects not set correctly:
In the library project, "Is Library"
was not checked for some reason. I
could swear that I checked it, but
knowing how whimsical the Android
development environment under
Eclipse can be, I suspect that it
was unchecked by Eclipse (or the ADT
plugin) as a result of some glitch.
In the application project, I
neglected to add my library project
as a reference via the Add...
button. (how dumb could I be?)
Hoping this can be useful for other newbies to come.