MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
02/07/13 12:31 PM (12 years ago)

Rename Package in Order to Update from 1.4 to 2.0

So I was able to do this a couple of weeks ago, and for the life of me I can't seem to get it to work again. I renamed the package, then got a bunch of errors (which is what i figured). But then when i did a find and replace with the old package name in the .java files, it's still not fixing the errors I'm getting. I'm not sure exactly what BT did in an update since adding Google Cloud, but for the life of me I can't seem to figure out why I keep getting errors. Thanks in advance!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/07/13 01:47 PM (12 years ago)
Typically the errors I've seen are related to using the wrong API (Android 2.2 rather than the required Google v2.2 (api 8). What do these 'bunch of errors' say? When I 'rename' my android projects, I select the project with my mouse, right click, and choose 'refactor > rename' and let it do it's thing. Is this your method? Cheers! -- Smug
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
02/07/13 02:07 PM (12 years ago)
@ MySkylla directed me to this thread. It seemed to work. http://www.buzztouch.com/forum/thread.php?fid=2AF96D6F9346BAFAEB6AF8F&tid=2AF96D6F9346BAFAEB6AF8F -Shane
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 02:59 PM (12 years ago)
@smug. That's exactly it. Then i have to go into each .java page and replace the remaining old package strings. I did this for a couple of apps and it worked. Now I'm still getting errors...
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 03:01 PM (12 years ago)
@outbreak I can try that, but the last time i was able to do it without doing that...
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 03:18 PM (12 years ago)
Hey all seemed to figure it out. For those in the future who don't know here's how I did it. First press cntl+h Go to File Search Tab Paste the 2.0 package name there. Hit replace. (this gave me an error, i just ignored it). It will then ask you to input what to replace it with, put your 1.4 package name there. Next go to your scr/package, right click and select refractor/rename. Rename the package here (make sure you have everyone of the boxes checked off). Then hit ok. Once you go through these steps everything should be fine with no errors. I also recommend you clean your package when your done! Hope this helps. And thanks for everyone who responded.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/07/13 03:59 PM (12 years ago)
Very odd indeed. Darn glad you got it straightened out. And thanks for the method! I guess it's a 1.4 thing. Having only dealt with BT v2.x I haven't experienced that behavior. Cheers! -- Smug
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 04:16 PM (12 years ago)
@smug, well not everything is well and good...now my app is crashing everytime i try and launch it...I had the same problem the last time, damned if I can't remember how to fix it...
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
02/07/13 04:38 PM (12 years ago)
I had issues with the renaming of folders at first. Like "com" etc. Make sure you follow those instructions word for word. I kind of breezed through it my first time and it didn't work. Also start with a clean source.
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 04:45 PM (12 years ago)
@outbreak Well I was able to finally get everything fixed, no more errors. But now the app is crashing on startup. It won't even open, just crashes... I had this problem the last time, I just can't remember what I did to fix it and it's driving me up the wall (almost as much as xcode and mac do!)
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
02/07/13 04:48 PM (12 years ago)
Copy your config file in eclipse and run it though http://jsonlint.com. See if that helps.
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 04:56 PM (12 years ago)
says it's valid...
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
02/07/13 04:57 PM (12 years ago)
Are you launching it on VD or live device?
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 05:00 PM (12 years ago)
Both, get the same results...
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
02/07/13 05:00 PM (12 years ago)
what does it say in LogCat when it crashes?
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 05:09 PM (12 years ago)
Here it is: 02-07 16:06:07.385: D/dalvikvm(616): Not late-enabling CheckJNI (already on) 02-07 16:06:07.485: I/dalvikvm(616): Turning on JNI app bug workarounds for target SDK version 8... 02-07 16:06:07.835: W/ActivityThread(616): Application com.v1_4.c3800mt.com is waiting for the debugger on port 8100... 02-07 16:06:07.905: I/System.out(616): Sending WAIT chunk 02-07 16:06:08.246: I/dalvikvm(616): threadid=3: reacting to signal 3 02-07 16:06:08.265: I/dalvikvm(616): Wrote stack traces to '/data/anr/traces.txt' 02-07 16:06:08.305: I/dalvikvm(616): Debugger is active 02-07 16:06:08.505: I/System.out(616): Debugger has connected 02-07 16:06:08.505: I/System.out(616): waiting for debugger to settle... 02-07 16:06:08.706: I/System.out(616): waiting for debugger to settle... 02-07 16:06:08.865: I/dalvikvm(616): threadid=3: reacting to signal 3 02-07 16:06:08.875: I/dalvikvm(616): Wrote stack traces to '/data/anr/traces.txt' 02-07 16:06:08.927: I/System.out(616): waiting for debugger to settle... 02-07 16:06:09.125: I/System.out(616): waiting for debugger to settle... 02-07 16:06:09.296: I/dalvikvm(616): threadid=3: reacting to signal 3 02-07 16:06:09.305: I/dalvikvm(616): Wrote stack traces to '/data/anr/traces.txt' 02-07 16:06:09.325: I/System.out(616): waiting for debugger to settle... 02-07 16:06:09.525: I/System.out(616): waiting for debugger to settle... 02-07 16:06:09.779: I/System.out(616): waiting for debugger to settle... 02-07 16:06:09.845: I/dalvikvm(616): threadid=3: reacting to signal 3 02-07 16:06:09.868: I/dalvikvm(616): Wrote stack traces to '/data/anr/traces.txt' 02-07 16:06:09.975: I/System.out(616): waiting for debugger to settle... 02-07 16:06:10.210: I/System.out(616): waiting for debugger to settle... 02-07 16:06:10.355: I/dalvikvm(616): threadid=3: reacting to signal 3 02-07 16:06:10.365: I/dalvikvm(616): Wrote stack traces to '/data/anr/traces.txt' 02-07 16:06:10.415: I/System.out(616): debugger has settled (1427) 02-07 16:06:10.895: I/dalvikvm(616): threadid=3: reacting to signal 3 02-07 16:06:10.975: I/dalvikvm(616): Wrote stack traces to '/data/anr/traces.txt' 02-07 16:06:11.195: W/ZZ(616): BT_activity_root:onCreate 02-07 16:06:11.226: W/ZZ(616): BT_fileManager:getDrawableFromResourcesByName An exception occurred trying to get the drawable named: bt_bg_progress.png 02-07 16:06:11.315: W/ZZ(616): BT_activity_root:loadAppData 02-07 16:06:11.385: I/dalvikvm(616): threadid=3: reacting to signal 3 02-07 16:06:11.485: D/dalvikvm(616): threadid=12: still suspended after undo (sc=1 dc=1) 02-07 16:06:11.496: I/dalvikvm(616): Wrote stack traces to '/data/anr/traces.txt' 02-07 16:06:11.765: D/gralloc_goldfish(616): Emulator without GPU emulation detected. 02-07 16:06:11.905: I/dalvikvm(616): threadid=3: reacting to signal 3 02-07 16:06:11.915: D/dalvikvm(616): threadid=12: still suspended after undo (sc=1 dc=1) 02-07 16:06:11.915: I/dalvikvm(616): Wrote stack traces to '/data/anr/traces.txt'
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 05:13 PM (12 years ago)
This is the errors it looks like...I think...: 02-07 16:08:18.835: E/WindowManager(616): Activity com.v1_4.c3800mt.com.BT_activity_root has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@412b3f60 that was originally added here 02-07 16:08:18.835: E/WindowManager(616): android.view.WindowLeaked: Activity com.v1_4.c3800mt.com.BT_activity_root has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@412b3f60 that was originally added here 02-07 16:08:18.835: E/WindowManager(616): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:344) 02-07 16:08:18.835: E/WindowManager(616): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:267) 02-07 16:08:18.835: E/WindowManager(616): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:215) 02-07 16:08:18.835: E/WindowManager(616): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:140) 02-07 16:08:18.835: E/WindowManager(616): at android.view.Window$LocalWindowManager.addView(Window.java:537) 02-07 16:08:18.835: E/WindowManager(616): at android.app.Dialog.show(Dialog.java:278) 02-07 16:08:18.835: E/WindowManager(616): at com.v1_4.c3800mt.com.BT_progressSpinner.show(BT_progressSpinner.java:71) 02-07 16:08:18.835: E/WindowManager(616): at com.v1_4.c3800mt.com.BT_progressSpinner.show(BT_progressSpinner.java:52) 02-07 16:08:18.835: E/WindowManager(616): at com.v1_4.c3800mt.com.BT_activity_root.showProgress(BT_activity_root.java:160) 02-07 16:08:18.835: E/WindowManager(616): at com.v1_4.c3800mt.com.BT_activity_root.onCreate(BT_activity_root.java:79) 02-07 16:08:18.835: E/WindowManager(616): at android.app.Activity.performCreate(Activity.java:4465) 02-07 16:08:18.835: E/WindowManager(616): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 02-07 16:08:18.835: E/WindowManager(616): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 02-07 16:08:18.835: E/WindowManager(616): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 02-07 16:08:18.835: E/WindowManager(616): at android.app.ActivityThread.access$600(ActivityThread.java:123) 02-07 16:08:18.835: E/WindowManager(616): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 02-07 16:08:18.835: E/WindowManager(616): at android.os.Handler.dispatchMessage(Handler.java:99) 02-07 16:08:18.835: E/WindowManager(616): at android.os.Looper.loop(Looper.java:137) 02-07 16:08:18.835: E/WindowManager(616): at android.app.ActivityThread.main(ActivityThread.java:4424) 02-07 16:08:18.835: E/WindowManager(616): at java.lang.reflect.Method.invokeNative(Native Method) 02-07 16:08:18.835: E/WindowManager(616): at java.lang.reflect.Method.invoke(Method.java:511) 02-07 16:08:18.835: E/WindowManager(616): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 02-07 16:08:18.835: E/WindowManager(616): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 02-07 16:08:18.835: E/WindowManager(616): at dalvik.system.NativeStart.main(Native Method)
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
02/07/13 05:20 PM (12 years ago)
May be simple, but did you clean it?
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 05:27 PM (12 years ago)
yup...
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
02/07/13 05:44 PM (12 years ago)
I have a feeling that your folder names are messed up. Hopefully someone that is a little better at looking at LogCat will take a view.
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 05:50 PM (12 years ago)
What do you mean by messed up folder names? How would this have happened?
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
02/07/13 05:52 PM (12 years ago)
These steps are what screwed me up first time I did it. 5) Once it's finished, you need to remove your app from Eclipse. Once removed, open up the folder your source code is in, and navigate to the src folder. You'll need to create and rename a couple folders so your path looks like below: Original path: src/com/newapp/ New path: src/com/v1_4/oldapp/com/ When done, all the files that were in the original path need to be in the new path. 6) Open up the new path you created src/com/v1_4/oldapp/com/ and rename oldapp_appDelegate.java to com_appDelegate.java
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
02/07/13 06:02 PM (12 years ago)
It seems like that's already been done for me automatically...
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
02/07/13 06:11 PM (12 years ago)
It didn't for me. I had to add com and I think v1_4
 

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.