简体   繁体   中英

Error When Creating a New Project in Android Studio

Android Studio worked fine everyday. But since yesterday, it started showing an error when I create a new project. When I hit Finish to create a new project, nothing happens except this error shows up:

CalledFromWrongThreadException
            Access is allowed from event dispatch thread only.
            Details: EventQueue.isDispatchThread()=false
            isDispatchThread()=false
            Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@7593de93
            Current thread: Thread[ApplicationImpl pooled thread 13,4,main] 374296670
            SystemEventQueueThread: Thread[AWT-EventQueue-0 1.4#AI-141.2288178, eap:false,6,main] 400805665
            "AWT-EventQueue-0 1.4#AI-141.2288178, eap:false" prio=0 tid=0x0 nid=0x0 runnable
            java.lang.Thread.State: RUNNABLE
            at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.access$100(InjectedLanguageManagerImpl.java:66)
            at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl$3.daemonCancelEventOccurred(InjectedLanguageManagerImpl.java:109)
            at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:497)
            at com.intellij.util.messages.impl.MessageBusConnect... (show balloon)

If I click show balloon, it shows the expanded version. It's too big so I decided to post the brief one. I'm using Android Studio 1.4

Thank you for the help.

I was facing the same problem a few minutes ago and this worked for me. Just go to Tools-> SDK Manager . You can see Android SDK Location there.

Screenshot:

在此处输入图片说明

Check all 3 components and click on Next . Wait until it installs & updates Android SDK Location.

Screenshot:

在此处输入图片说明

Soon build should start and complete successfully. I hope it helps someone who's having the same problem in 2019 onwards :)

This is due to conflict of your installed jdk. Go to Project Structure -> SDK Location,un check 'Use embedded JDK' checkbox and put your jdk path

This is what worked for me. Android Studio v2.2.2.

  1. Click on "Configure" > "SDK Manager".
  2. Confirm that "Android SDK" is selected in the left side.
  3. In the right side, there will be an input field and it might have wrong location of your Android SDK.
  4. Correct that input field and it must point to your Android SDK.
  5. In the end, it must look like

这个图片

Go to File -> Invalidate cache / Restart.

This might clear the cache and create a fresh session for android studio.

在此处输入图片说明

Probably is android Studio problem.

I see similar problems, try this:

1 Save android Studio Projects. 2 Uninstall android Studio 3 Install Android Studio.

Tell us what happend.

Try restarting your computer. It looks like a Thread is running lose somewhere. If that doesn't work, try reinstalling as some file may be corrupt.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM