Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio v1.2.0 start up error : java.lang.NullPointerException

Tags:

After updating Android Studio to v1.2.0. At start up I get below log and unable to open Android Studio. I am using Windows 7-64bit and look like same error getting in Ubuntu also

This issue also reported in Android Issues, but still not solution

java.lang.RuntimeException: java.lang.NullPointerException     at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:178)     at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:52)     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:738)     at java.awt.EventQueue.access$300(EventQueue.java:103)     at java.awt.EventQueue$3.run(EventQueue.java:699)     at java.awt.EventQueue$3.run(EventQueue.java:697)     at java.security.AccessController.doPrivileged(Native Method)     at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)     at java.awt.EventQueue.dispatchEvent(EventQueue.java:708)     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362)     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)     at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) Caused by: java.lang.NullPointerException     at com.android.tools.idea.welcome.AndroidVirtualDevice.<init>(AndroidVirtualDevice.java:81)     at com.android.tools.idea.welcome.InstallComponentsPath.createComponentTree(InstallComponentsPath.java:89)     at com.android.tools.idea.welcome.InstallComponentsPath.init(InstallComponentsPath.java:215)     at com.android.tools.idea.wizard.DynamicWizardPath.attachToWizard(DynamicWizardPath.java:97)     at com.android.tools.idea.wizard.DynamicWizard.addPath(DynamicWizard.java:233)     at com.android.tools.idea.welcome.FirstRunWizard.init(FirstRunWizard.java:75)     at com.android.tools.idea.welcome.FirstRunWizardHost.setupWizard(FirstRunWizardHost.java:100)     at com.android.tools.idea.welcome.FirstRunWizardHost.getWelcomePanel(FirstRunWizardHost.java:92)     at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeFrame.<init>(WelcomeFrame.java:68)     at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeFrame.showNow(WelcomeFrame.java:173)     at com.intellij.idea.IdeaApplication$IdeStarter.main(IdeaApplication.java:302)     at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:172)     ... 16 more 

Any help will be appreciated.

like image 484
Bharatesh Avatar asked May 05 '15 05:05

Bharatesh


People also ask

How do I fix Java Lang NullPointerException in Java?

In Java, the java. lang. NullPointerException is thrown when a reference variable is accessed (or de-referenced) and is not pointing to any object. This error can be resolved by using a try-catch block or an if-else condition to check if a reference variable is null before dereferencing it.

How do I fix null pointer exception in Android?

How to fix the NullPointerException? To avoid NullPointerException we have to initialize the Textview component with the help of findviewbyid( ) method as shown below. The findViewbyId( ) takes the “id” value of the component as the parameter. This method helps locate the component present in the app.

What is NullPointerException in Android Studio?

java.lang.NullPointerException. Thrown when an application attempts to use null in a case where an object is required. These include: Calling the instance method of a null object. Accessing or modifying the field of a null object.

What does error Java Lang NullPointerException mean?

The java. lang. NullPointerException is a runtime exception in Java that occurs when a variable is accessed which is not pointing to any object and refers to nothing or null. Since the NullPointerException is a runtime exception, it doesn't need to be caught and handled explicitly in application code.


1 Answers

Issue #170849 gives the reasons for the above crash.

  1. This happens (at least) when no sdk is installed and no remote repos that contain platforms are available.
  2. Actually it happens whenever remote sites aren't available and the first run wizard is run.

Found a temporary solution from Issue #170850:

Add the following code to C:\Program Files\Android\Android Studio\bin\idea.properties

disable.android.first.run=true 

Updated

The issue has been fixed under Issue #170849.

like image 184
Bharatesh Avatar answered Oct 09 '22 04:10

Bharatesh