Discussion Forums  >  Uncategorized

Replies: 13    Views: 1205

trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
03/30/11 11:20 PM (14 years ago)

Rename Package?

Well, I haven't missed making one mistake. I accidentally uploaded my paid app for free to android market ( for about 30 seconds until I noticed.) Now I need to rename the package in Eclipse and re-upload it. Of course when I did that the app doesn't work in the emulator or on my phone anymore. Because I'm using Buzztouch is there anything special I need to know when renaming the package? There's an error in the FbDialog.java file where the old package name sticks (which means I can't run the emulator because I have to fix this problem) and when I change it to the new name the app doesn't work on the emulator. Thanks, Bruce
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/30/11 11:53 PM (14 years ago)
Super-truper is back, glad to see ya. Renaming files and Projects in Eclipse is super bogus but doable. Should take you about :10 minutes and you'll be amazed at how silly they make it. Eclipse calls this 'Refactoring' instead of renaming. The idea is that all the source files (the .java files only) belong to a package and each file has the package name at the top of the file. Basically, there are 4 steps and the little 'red arrows' in Eclipse help you figure out where things aren't quite right yet. 1) Choose a new package name and type it in a text editor so you don't lose it during this process. The package name by default is an ugly unique id for the app from your control panel. 2) Right-click, command-click (mac) the package name in Eclipse. This is the strange looking com.packagename.com name in the /src folder. It's the 'parent package' for all the code. When the context menu opens, choose Refactor > Rename. Rename it. It will try to update all the package names in your project. It will get most of them but almost always misses a few. 3) Look at each .java file in your project and find the ones with the red arrows. These are the ones Eclipse did not rename. It may be all of them! Open each file and overwrite the package name at the top of the file. Cut-n-paste is fine. 4) Open AndroidManifest.xml and change the package name there too. That should do it.
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
03/31/11 12:53 PM (14 years ago)
Great idea but it didn't work. I have no red arrows (I have when I tried this 2 other times with basically the same steps you gave me). I checked everything just to be sure. I do know what the color red looks like. These are the kind of doubts I have because I question my sanity from time to time. What I do notice is that in the emulator I get the error message The application Sedona Vortex (process com.v1_4.B5F64A6950B99593.com. has stopped unexpectedly. Please try again. Force Close. Any idea why it doesn't have the new name I created? Which is com.v1_4.B5F64A6950B99593.com2 Every time something goes wrong I get into some kind of screw up that I can't seem to find answers for. There's a dark cloud over this project (at least on the android side). Also, just so you know I'm thorough, I ran the app perfectly before I changed the package name. Thanks, Bruce
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
03/31/11 12:56 PM (14 years ago)
Also, in the Manifest, at the top of the page it says package=com.v1_4.B5F64A6950B99593.com Which is the old name. Is that ok?
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
03/31/11 01:02 PM (14 years ago)
As soon as I change the manifest file that's when I get all the red x's and red underlined stuff. Usually in the import line where com.v1_4.B5F64A6950B99593.com resides.
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
03/31/11 01:11 PM (14 years ago)
Fixed all the red stuff by renaming. I still get the same error message with the old name: process com.v1_4.B5F64A6950B99593.com. has stopped unexpectedly. Please try again. Force Close. ???
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/31/11 01:23 PM (14 years ago)
You could try deleting the app from the simulator all together. You probably already did this. Or, you could try on the actual device? So... no more red arrows...compiles fine... but crashes on launch... hmm. THe only places the package name is used (that I know of ) is.. a) At the top of each .java file b) In the Android Manifest c) in the /src/com.YOURID.com package d) in the /gen/com.YOURID.com package Dunno where else. Becuase you changed all the packages names in all the files. I wonder if you can create a new Android Project 'from existing source' - the source you changes all the package names in?
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
03/31/11 01:50 PM (14 years ago)
Creating a new Android Project did the trick!!! Thank you once again. I owe you a case of beer! Or something like that. Bruce
 
Annonymous
Profile
03/31/11 04:56 PM (14 years ago)
Now I'm back from my appointment and the maps don't work. Getting the Maps Not Configured, Maps not configured properley. See: showLocationMap() method in src/Act_ActivityBase.java I've done this 20 times now, I've watched the videos, reloaded and changed everything from scratch (strings.xml, manifest, Act_ActivityBase.java) no red warnings. This is a simple thing to do but I'm getting the error. wtf! I know what it's like to be in your shoes David but I can honestly say I've followed every direction to the T. I'm considering giving up, this is just ridiculous.
 
Annonymous
Profile
03/31/11 04:57 PM (14 years ago)
Creating a new Android Project did the trick!!! Thank you once again. I owe you a case of beer! Or something like that. Bruce
 
Annonymous
Profile
03/31/11 04:57 PM (14 years ago)
Fixed all the red stuff by renaming. I still get the same error message with the old name: process com.v1_4.B5F64A6950B99593.com. has stopped unexpectedly. Please try again. Force Close. ???
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
03/31/11 05:00 PM (14 years ago)
I got back from my appointment and now I'm getting Maps Not Configured, Maps not configured properley. See: showLocationMap() method in src/Act_ActivityBase.java I give up. I'm done with android. This is absolutely ridiculous. I've followed every direction to the T. I've done this at least 20 times from scratch. I'll send screen shots to prove it.
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
03/31/11 05:29 PM (14 years ago)
Figured it out. In the READ ME file there is no //showAlert. You showed it in the video but not in the READ ME file. I watched the video one more time tried putting the forward slashes before showAlert and it worked. No error message. thanks again, Bruce
 
tiger
Aspiring developer
Profile
Posts: 121
Reg: Dec 26, 2010
USA
1,210
like
08/09/11 11:14 AM (14 years ago)
Thanks for the great notes. I had to rename my file today because I did not save my original files. One comment. If you still have problems close Eclipse and re-open after a few seconds. That's what I had to do to get my renamed app to work.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.