Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
07/27/12 01:57 PM (13 years ago)

java.lang.NullPointerException

Hi, Yesterday my project was working great and now I get this error. An internal error occurred during: "Launching com.tcds.BT_activity_root". java.lang.NullPointerException. I get it when I try to run it as an app. I checked the color codes and they were corrected. I've deleted from eclipse and re-imported the file and cannot find what is wrong. The only change I did was change the AVD which was wrong. When I had the wrong one it actually worked. I hope someone can help me.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
07/27/12 02:05 PM (13 years ago)
Impossible to know without any reports. Do you have a logcat report?
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 02:07 PM (13 years ago)
Nothing got generated. There is nothing in the logcat report.
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 02:09 PM (13 years ago)
Nothing got generated. There is nothing in the logcat report.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
07/27/12 02:10 PM (13 years ago)
hmmmm. Any 3rd party plugins installed? (If you're on self-hosted).
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 02:19 PM (13 years ago)
Oh I did download the Java JDK.
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 02:20 PM (13 years ago)
Not sure if that affected anything.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
07/27/12 02:25 PM (13 years ago)
No, that's ok. I meant 3rd party app plugins. Do you have any red crosses next to any of the files in the project? If not, try a bit of project cleaning. Right click project name in the lefthand pane, go to Android > Fix project properties. Next, in the tabs along the top select Project > Clean, then right click in the lefthand pane and hit refresh. If you do have any red crosses, open the file with the cross, find the line with the error, hover your mouse over the red line and it'll give you some more information. It might be an easy fix, or post it here.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/27/12 02:25 PM (13 years ago)
Hi, If you're building your app in Eclipse and then running it in the Emulator, there absolutely should be something in LogCat. It records everything that happens as the app is running, and the NullPointerException that it logs is key to understanding what's going on with your app. Did you make any changes to your app in the control panel at all? Mark
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 02:30 PM (13 years ago)
(Raveyd) No I do not have any red x on my files. I did all that previously and re did it again but it's still not working and getting the same error. (GoNorthWest) I build my app in Buzztouch. I imported it and tried to ran the emmulator. That's when I get this error and nothing shows up on the logcat. As soon as I press Runs As Application I get that error. I'm really puzzled.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/27/12 02:32 PM (13 years ago)
Interesting. So, the Java JDK you downloaded...that was an update to the previous version you had when things were working? Or is that new? Mark
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
07/27/12 02:33 PM (13 years ago)
Think the 'problems' pane would help Mark? Almost sounds like something wrong with the avd or eclipse..
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/27/12 02:36 PM (13 years ago)
Yep. I'd love to see what's in the Problems pane!
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
07/27/12 02:44 PM (13 years ago)
I would check spaces at the beginning of your screen nicknames. http://stackoverflow.com/questions/10743972/android-java-lang-nullpointerexception Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/27/12 02:47 PM (13 years ago)
I've seen so many different NullPointerExceptions - missing pages, background colors, incorrectly named files, special characters - that it's literally impossible to debug this without the debug info. There are thousands of reasons Java could be crashing, and Android is particularly problematic! Mark
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 02:48 PM (13 years ago)
(Mark) I did not have Java JDK installed. I installed it last night and this morning when I went to open my file I got this problem. Here's the link to the Problems Pane: http://tcds.site-ym.com/resource/resmgr/Docs/Problems_Screen.pdf
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
07/27/12 02:50 PM (13 years ago)
Is the JAVA 32 or 64 bit? Is the Eclipse install the same bit version? Fred
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 02:56 PM (13 years ago)
It was Java-7u5-windows-i586. I went to about eclipse to find out the bit version but not sure where to look. This is what it says: Eclipse IDE for Java EE Developers 1.5.0.20120614-1633 epp.package.jee null
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/27/12 02:59 PM (13 years ago)
Those don't look like issues that would cause it to crash. They're just warnings about which java files aren't actually being used. You could have the ability to bring up an Errors pane. Is there anything there? In general, warnings are OK, and they won't prevent the app from compiling. But it's odd that it's crashing before it even gets installed to the emulator. Something somewhere (perhaps in the Console pane) should get logged. If you want, you can send me your zipped source package and I can try to replicate the problem. MrkFleming at gmail dot com Mark
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 03:01 PM (13 years ago)
No there is nothing on errors. Thank you Mark. I will go ahead and send it to you.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/27/12 03:16 PM (13 years ago)
Very nice app! I love the button menu! The only error I got was this: [2012-07-27 15:07:51 - buzzTouch] Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties. I did the Fix Project Properties, and everything worked as expected. So, if you did recently just download the Java JDK, I'd follow @Fred's suggestion and make sure that you have both 32-bit Java and Eclipse or both 64-bit Java and Eclipse, and that they aren't mixed. Personally, I'd stick with the 32-bit version. If that all checks out, then it must be something else. But one step at a time. Mark
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 03:21 PM (13 years ago)
Thank you Mark. I apologize for my unfamiliarity with this but, how can I verify what versions I have? Like I said before I downloaded Java-7u5-windows-i586. I went to "about eclipse" to find out the bit version but not sure where to look. This is what it says: Eclipse IDE for Java EE Developers 1.5.0.20120614-1633 epp.package.jee null.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/27/12 03:31 PM (13 years ago)
I looked around my Eclipse install, and I'm not quite sure! I do see that you're using Eclipse for Java EE Developers. Pretty much all of us here use the Eclipse Classic. I don't know how much it all plays into it, but I might suggest installing that instead of the one you have. I think it's a much simpler version. It appears the Java you are using is 32-bit, so grab the 32-bit Eclipse. Mark
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 03:31 PM (13 years ago)
ok so I figured out the both the Java and Eclipse version I have are 32 bit. So they do match.
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 03:32 PM (13 years ago)
Should I re-install Eclipse? It sounds that it's eclipse that is crashing, right?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/27/12 03:35 PM (13 years ago)
Very possibly. I know it's a pain, but we all have more experience with the Classic version. I'd uninstall yours, install the one found here (http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.2-201206081400/eclipse-SDK-4.2-win32.zip) and see what happens. You can use this to guide you through it all: http://www.buzztouch.com/files/howtos/buzztouch_For_Android-A_Users_Guide.pdf Mark
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/27/12 03:36 PM (13 years ago)
I will do that. Thank you.
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/30/12 11:16 AM (13 years ago)
Well, I uninstalled and re-installed everything. I imported my project and clicke to run it and I keep getting the same error message. But this time it gave me this information. Does anyone know what it means and how I can fix it? null Error Mon Jul 30 11:14:32 PDT 2012 An internal error occurred during: "Launching com.tcds.BT_activity_root". java.lang.NullPointerException at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(AndroidLaunchController.java:372) at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.doLaunch(LaunchConfigDelegate.java:322) at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:238) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704) at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047) at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/30/12 11:29 AM (13 years ago)
Are you doing a "Run As...Android Application" or "Debug As...Android Application." You'll want to do the Run As. Mark
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/30/12 11:30 AM (13 years ago)
I did Run As....Android Application.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/30/12 11:34 AM (13 years ago)
Hmmm...It also looks to me like you are doing an Import...Existing Android Code Into Workspace. I always do an Import...Existing Projects Into Workspace, which gives me a buzzTouch package name in Package Explorer instead of the com.tcds.BT_activity_root that I think you are seeing. Try deleting your project from Eclipse, then doing the Import...Existing Projects Into Workspace and see if that helps. Mark
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/30/12 11:40 AM (13 years ago)
I did what you said and got the same thing plus more. null Error Mon Jul 30 11:39:54 PDT 2012 An internal error occurred during: "Launching com.tcds.BT_activity_root". java.lang.NullPointerException at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(AndroidLaunchController.java:372) at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.doLaunch(LaunchConfigDelegate.java:322) at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:238) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704) at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047) at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) null Error Mon Jul 30 11:37:43 PDT 2012 Exception occurred while saving project preferences: /com.tcds.BT_activity_root/.settings/org.eclipse.jdt.core.prefs. org.eclipse.core.internal.resources.ResourceException: A resource already exists on disk 'C:\Documents and Settings\Monica.DOMAIN\workspace\com.tcds.BT_activity_root\.settings'. at org.eclipse.core.internal.resources.Folder.assertCreateRequirements(Folder.java:47) at org.eclipse.core.internal.resources.Folder.create(Folder.java:95) at org.eclipse.core.internal.resources.ProjectPreferences$1.run(ProjectPreferences.java:566) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.core.internal.resources.ProjectPreferences.save(ProjectPreferences.java:590) at org.eclipse.core.internal.preferences.EclipsePreferences.internalFlush(EclipsePreferences.java:465) at org.eclipse.core.internal.resources.ProjectPreferences.flush(ProjectPreferences.java:350) at org.eclipse.jdt.internal.core.JavaProject.setOption(JavaProject.java:2953) at com.android.ide.eclipse.adt.internal.project.ProjectHelper.checkAndFixCompilerCompliance(ProjectHelper.java:434) at com.android.ide.eclipse.adt.internal.project.ProjectHelper.fixProjectClasspathEntries(ProjectHelper.java:343) at com.android.ide.eclipse.adt.internal.project.ProjectHelper.fixProject(ProjectHelper.java:261) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createEclipseProject(NewProjectCreator.java:775) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createProjectAsync(NewProjectCreator.java:620) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.access$0(NewProjectCreator.java:553) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator$2.execute(NewProjectCreator.java:365) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) null Error Mon Jul 30 11:37:43 PDT 2012 Exception occurred while saving project preferences: /com.tcds.BT_activity_root/.settings/org.eclipse.jdt.core.prefs. org.eclipse.core.internal.resources.ResourceException: A resource already exists on disk 'C:\Documents and Settings\Monica.DOMAIN\workspace\com.tcds.BT_activity_root\.settings'. at org.eclipse.core.internal.resources.Folder.assertCreateRequirements(Folder.java:47) at org.eclipse.core.internal.resources.Folder.create(Folder.java:95) at org.eclipse.core.internal.resources.ProjectPreferences$1.run(ProjectPreferences.java:566) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.core.internal.resources.ProjectPreferences.save(ProjectPreferences.java:590) at org.eclipse.core.internal.preferences.EclipsePreferences.internalFlush(EclipsePreferences.java:465) at org.eclipse.core.internal.resources.ProjectPreferences.flush(ProjectPreferences.java:350) at org.eclipse.jdt.internal.core.JavaProject.setOption(JavaProject.java:2953) at com.android.ide.eclipse.adt.internal.project.ProjectHelper.checkAndFixCompilerCompliance(ProjectHelper.java:436) at com.android.ide.eclipse.adt.internal.project.ProjectHelper.fixProjectClasspathEntries(ProjectHelper.java:343) at com.android.ide.eclipse.adt.internal.project.ProjectHelper.fixProject(ProjectHelper.java:261) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createEclipseProject(NewProjectCreator.java:775) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createProjectAsync(NewProjectCreator.java:620) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.access$0(NewProjectCreator.java:553) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator$2.execute(NewProjectCreator.java:365) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) null Error Mon Jul 30 11:37:43 PDT 2012 Exception occurred while saving project preferences: /com.tcds.BT_activity_root/.settings/org.eclipse.jdt.core.prefs. org.eclipse.core.internal.resources.ResourceException: A resource already exists on disk 'C:\Documents and Settings\Monica.DOMAIN\workspace\com.tcds.BT_activity_root\.settings'. at org.eclipse.core.internal.resources.Folder.assertCreateRequirements(Folder.java:47) at org.eclipse.core.internal.resources.Folder.create(Folder.java:95) at org.eclipse.core.internal.resources.ProjectPreferences$1.run(ProjectPreferences.java:566) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.core.internal.resources.ProjectPreferences.save(ProjectPreferences.java:590) at org.eclipse.core.internal.preferences.EclipsePreferences.internalFlush(EclipsePreferences.java:465) at org.eclipse.core.internal.resources.ProjectPreferences.flush(ProjectPreferences.java:350) at org.eclipse.jdt.internal.core.JavaProject.setOption(JavaProject.java:2953) at com.android.ide.eclipse.adt.internal.project.ProjectHelper.checkAndFixCompilerCompliance(ProjectHelper.java:438) at com.android.ide.eclipse.adt.internal.project.ProjectHelper.fixProjectClasspathEntries(ProjectHelper.java:343) at com.android.ide.eclipse.adt.internal.project.ProjectHelper.fixProject(ProjectHelper.java:261) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createEclipseProject(NewProjectCreator.java:775) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createProjectAsync(NewProjectCreator.java:620) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.access$0(NewProjectCreator.java:553) at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator$2.execute(NewProjectCreator.java:365) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/30/12 11:46 AM (13 years ago)
Ah, more errors...awesome! Did a couple seconds of research...do you have all the latest updates for Eclipse and the Eclipse ADT Plugin? To check, you can do a Help...Check for Updates or Window...Check for Updates...can't recall exactly which. We need to make sure everything is running at the latest levels before moving forward. Mark
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/30/12 11:47 AM (13 years ago)
I checked for updates and there weren't any.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/30/12 11:49 AM (13 years ago)
Dang! OK...let me try and do a bit more research. Might take a while as I'm at work. If you want to send me your zipped code package, I can try and load it in my Eclipse just to make sure it's not an issue with the source. MrkFleming at gmail dot com Mark
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/30/12 11:51 AM (13 years ago)
Ok no problem. I already emailed you Friday my zip file.
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/30/12 11:51 AM (13 years ago)
Thank you for helping me Mark.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/30/12 11:54 AM (13 years ago)
Ah, yes! I recall now. Everything worked fine on my end. Are you up for doing a TeamViewer session sometime today so I can check out your Eclipse installation? I'll be available in about an hour or so.
 
Newbie100
I hate code!
Profile
Posts: 34
Reg: Jul 13, 2012
Riverside
1,240
like
07/30/12 12:03 PM (13 years ago)
Yes, that will be fine. Thanks.
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
01/29/13 02:26 PM (13 years ago)
Did you ever get this problem resolved? I'm running into a very similar problem with a BT 2.0 Android app that was compiling fine and it seems that out of nowhere I started getting this same error. An internal error occurred during: "Launching com.APPNAME.BT_activity_root". java.lang.NullPointerException.
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
01/29/13 02:37 PM (13 years ago)
I figured it out about five minutes after posting. Here is how I fixed it. I deleted the project from Eclipse and added it back as an existing project. Changed the API to Google 2.2 as usual and after that it compiled fine.
 

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.