A project syncing and building OK when on Android Studio 3.0 Canary 9. Just started failing the Gradle sync immediately after the upgrade to Android Studio 3.0 Beta 1!
Using the Android Studio bundled Java 8 without hacks on a Debian GNU/Linux 9 (Stretch, stable, up-to-date).
UPDATE: Solved with Beta 2
https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-2.html
Note: additional effort needed on rewriting code to avoid problematic Java libs for Android.
UPDATE: First try from Google
https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-1.html
Several issues arise (e.g., errors about signature-polymorphic method without --min-sdk-version >= 26)
These issues were not present on Canary 9!
Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: org.gradle.tooling.BuildException: com.android.dx.cf.code.SimException: signature-polymorphic method called without --min-sdk-version >= 26
(Google's nonsolution)
Original sync issue
Same issue on a Windows
Gradle error upgrading to Android Studio 3.0 Beta 1
From Studio
Build: 3.0 Beta 1, AI-171.4243858, 201708032321,
AI-171.4243858, JRE 1.8.0_152-release-915-b01x64 JetBrains s.r.o, OS Linux(amd64) v4.9.0-3-amd64 unknown, screens 1920x1080, 1920x1080
Gradle '...' project refresh failed
Cause: java.lang.NullPointerException
at sun.nio.fs.UnixPath.normalizeAndCheck(UnixPath.java:77)
at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
at java.nio.file.Paths.get(Paths.java:84)
at com.android.build.gradle.internal.scope.BuildOutput.getOutputPath(BuildOutput.java:222)
at com.android.build.gradle.internal.scope.BuildOutputs.lambda$load$2(BuildOutputs.java:243)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1376)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at com.android.build.gradle.internal.scope.BuildOutputs.load(BuildOutputs.java:245)
at com.android.build.gradle.internal.scope.BuildOutputs.load(BuildOutputs.java:184)
at com.android.build.gradle.internal.scope.BuildOutputs.load(BuildOutputs.java:140)
at com.android.build.gradle.internal.ide.BuildOutputsSupplier.lambda$get$1(BuildOutputsSupplier.java:55)
at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:397)
at com.android.build.gradle.internal.ide.BuildOutputsSupplier.get(BuildOutputsSupplier.java:50)
at com.android.build.gradle.internal.ide.BuildOutputsSupplier.get(BuildOutputsSupplier.java:35)
at com.android.build.gradle.internal.ide.AndroidArtifactImpl.getOutputs(AndroidArtifactImpl.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$ReflectionMethodInvoker.invoke(ProtocolToModelAdapter.java:592)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$AdaptingMethodInvoker.invoke(ProtocolToModelAdapter.java:397)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$PropertyCachingMethodInvoker.invoke(ProtocolToModelAdapter.java:625)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$SafeMethodInvoker.invoke(ProtocolToModelAdapter.java:647)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$SupportedPropertyInvoker.invoke(ProtocolToModelAdapter.java:670)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$InvocationHandlerImpl.invoke(ProtocolToModelAdapter.java:356)
at com.sun.proxy.$Proxy220.getOutputs(Unknown Source)
at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidArtifactImpl.<init>(IdeAndroidArtifactImpl.java:57)
at com.android.tools.idea.gradle.project.model.ide.android.IdeVariantImpl.lambda$new$0(IdeVariantImpl.java:60)
at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.lambda$computeIfAbsent$0(ModelCache.java:31)
at java.util.HashMap.computeIfAbsent(HashMap.java:1126)
at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.computeIfAbsent(ModelCache.java:31)
at com.android.tools.idea.gradle.project.model.ide.android.IdeVariantImpl.<init>(IdeVariantImpl.java:59)
at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidProjectImpl.lambda$new$4(IdeAndroidProjectImpl.java:88)
at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.lambda$computeIfAbsent$0(ModelCache.java:31)
at java.util.HashMap.computeIfAbsent(HashMap.java:1126)
at com.android.tools.idea.gradle.project.model.ide.android.ModelCache.computeIfAbsent(ModelCache.java:31)
at com.android.tools.idea.gradle.project.model.ide.android.IdeModel.copy(IdeModel.java:74)
at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidProjectImpl.<init>(IdeAndroidProjectImpl.java:87)
at com.android.tools.idea.gradle.project.model.ide.android.IdeAndroidProjectImpl.<init>(IdeAndroidProjectImpl.java:68)
at com.android.tools.idea.gradle.project.model.AndroidModuleModel.<init>(AndroidModuleModel.java:131)
at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.populateModuleContentRoots(AndroidGradleProjectResolver.java:214)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:103)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:366)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$200(GradleProjectResolver.java:79)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:902)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:886)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:218)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:139)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:79)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:45)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:66)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:139)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:125)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:388)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:445)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:726)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:137)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
UPDATE: Android Studio 3.0 Beta 3
With the following list of bug fixes:
Seems like this issue is already gone. After Updating from 3.0 Beta 2 to 3.0 Beta 3, I don't have to manually clean the project.
UPDATE: Android Studio 3.0 Beta 2
From the official Android Studio 3.0 Beta 2 known issues:
If you have an existing Android Studio project that's
using an alpha version of Android plugin 3.0.0 (such as 3.0.0-alpha9),
you may get the following error when you migrate to Android plugin
3.0.0-beta1 (or higher) and sync your project: Gradle project refresh failed.
Resolve this issue by selecting Build > Clean Project from the menu bar.
You can fix this issue by doing this:
Build > Clean Project
Reference: https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-1.html
Read here:
https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-1.html
Open the Terminal window by selecting View > Tool Windows > Terminal from the menu bar.
Delete all intermediate and cached build files with the following command: gradlew clean.
Build your project with the following command: gradlew assemble.
Sync your project files with Gradle by clicking Sync Project from the toolbar.
Or as I did, open the tab "Gradle" and run "clean" and then "assemble"
like this:
Go to your right at Android Studio, open the tab "gradle", then in ":app"/"Tasks"/"build" you will see "clean", "assemble" and other tasks.
Run first clean and then assemble, you may get an error but it still works and finally rebuild your project.
There is a solution offered by Google:
Resolve this issue selecting Build > Clean Project from the menu bar. You need to perform this action only once for each project. You can then sync your project files with Gradle by clicking Sync Project from the toolbar.
Following solutions didn't work for me :
Pressing that try again button again and again
Using offline and online gradle changes
Cleaning, syncing or rebuilding.
Solution:
After all these I just visited ~/.gradle folder, it contains a single folder named wrapper, just rename it to anything else i.e. wrapper123. That's it problem solved !!!! Press build and it will start syncing and building the project
I'm on Android Studio 3.0 Beta 2, and I found that on top of the clean and sync proposed here, for my project which was Java-Kotlin-mixed code base, I had to drop my Kotlin version to 1.1.3-2, which is the IDE bundled version, clean & sync then works, and then I can bring the Kotlin version back to 1.1.4 which is latest at the time of writing.
recquired online for until fix the error (fixing the gradle error.after successfully fixed the errror.you can work in offline.)
1.download latest gradle from ->https://gradle.org/releases
2.after downloading the zip files,it extract all the files into a folder (for good work:-name the folder 'gradle4',place the samelocal disc where your android studio installed eg-you installed android studio in local disc :c if place the 'gradle4' in local disc c)
3.android studio->file menu->settings->build,Excecution,Deployment->Gradle
4.check-use local gradle distribution
5.give gradle folder path into the gradle home optionScreen shot of gradle setting step 5
6.Enable embedded Maven Repository
Screen shot of Enable Maven Repository
click ->apply
Build menu->clean project
-problem solved-
Related
I'm on Windows 10 and I've created a Ionic 5.0.7 app with Capacitor 2.0.0.
I use this command to build app:
ionic build
After, I use this command:
npx cap sync
And, to finish, I use this command to open Android Studio:
npx cap open android
The first problem come during building on Android Studio:
org.gradle.api.reflect.ObjectInstantiationException: Could not create
an instance of type
com.novoda.release.internal.compat.gradle5_3.AndroidSoftwareComponentCompat_Gradle_5_3.
Caused by: org.gradle.api.reflect.ObjectInstantiationException: Could not create
an instance of type
com.novoda.release.internal.compat.gradle5_3.AndroidSoftwareComponentCompat_Gradle_5_3.
And...
java.lang.NoClassDefFoundError:
org/gradle/api/internal/java/usagecontext/LazyConfigurationUsageContext
Caused by: java.lang.NoClassDefFoundError:
org/gradle/api/internal/java/usagecontext/LazyConfigurationUsageContext
I've other random errors... It's weird...
Update
Check #Carl Pool 's answer
They fixed it in the new capacitor Version, no need to downgrade anymore
Old Answer
To fix this downgrade Gradle and Gradle plugin in Android Studio.
File -> Project Structure -> Project
If you keep the plugin to 4.0.0 it will require a minimum Gradle version of 6 so put it back to a lower version like 3.6.3
Version 6 of Gradle does not support LazyConfigurationUsageContext as mentionened by #NishaBhat, so use 5.6.4 instead.
This issue currently has a ticket on Github:
https://github.com/ionic-team/capacitor/issues/3003
This issue has been resolved in Capacitor version 2.1.2.
https://github.com/ionic-team/capacitor/issues/3003
Please update the Capacitor dependencies in package.json to version 2.1.2 and then in Android Studio click the button to sync the project with Gradle.
"#capacitor/android": "^2.1.2",
"#capacitor/core": "2.1.2",
Switch to using gradle version 5.6.4. That did the trick for me. LazyConfigurationUsageContext doesn't have support in gradle versions 6.0+
I was getting an error
Cause: org/gradle/api/internal/java/usagecontext/LazyConfigurationUsageContext
I solved by downgraded distributionUrl(gradle/wrapper/gradle-wrapper.properties) to https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
it will give an error if above 6+
Same problem.. had many issues:
Errors and how I solved:
Error 1. Gradle sync failed: Server returned HTTP response code: 403 for URL: http://services.gradle.org/distributions/gradle-5.6.4-all.zip
Solution - Downloaded the zip file and stored in on my local in the \android\gradle\wrapper folder.
Updated the distribution URL to: distributionUrl=./gradle-5.6.4-all.zip
Error 2. java.lang.NoClassDefFoundError & java.lang.NoClassDefFoundError:
Solution - Downloaded Gradle version 5.6.4 and updated the environment variables.
Error 3. Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
Updated as per the image below
i have not downgraded the gradle version 6.1.1 But what i did is that:
I removed these lines from build.gradle file
apply plugin: 'com.novoda.bintray-release' &
classpath 'com.novoda:bintray-release:0.9.1'
The Issue just gone like Boom !!
I think this Bintray Dependencies just conflicting behind the scene.
I've a weird case where gradle builds OK, but Android Studio's editor cannot resolve dependencies.
External classes references appear in red and I cannot CTRL+click on these classes to see the source.
Any idea how to solve this ?
I'm using Android Studio 3.1 and gradle 4.4
For those interested, I solved the problem as follows:
removed the files in the project 's .idea\libraries
menu File -> Invalidate Caches / Restart...
menu Build -> Rebuild Project
This is the complete error from Android Studio 2.1.1. I know this code compiles because on other PC it does, just not on this one which has Windows 10 x64. All other projects fail with similar result.
Error:Execution failed for task ':app:compileDebugJavaWithJack'.
> java.lang.RuntimeException: java.lang.AssertionError: com.android.jack.library.LibraryIOException: I/O error when accessing file 'I:\Android\KeepVidDownloader\Android\app\build\intermediates\packaged\debug\classes.zip': Failed to delete directory 'C:\Users\BCDIAC~1\AppData\Local\Temp\vfs-1464787788985-0'
For Build -> Clean Project I have used the solution from here https://stackoverflow.com/a/32924320/1958032
I think that there could be a similar solution for running/making the app.
How to solve this?
This issue is a conflict between antivirus and Android Studio.
In my case using Avira, Windows 10 and Android Studio 2.2.
I just disabled Avira for the first build and enabled it again when build was complete.
No need to do this every time- only at the first build.
I had a similar problem and solved it by File->Invalidate Caches and Restart.
I've just updated Android Studio and I can't sync my project anymore.
The event log reports:
Gradle sync failed: /Applications/Android Studio.app/Contents/gradle/gradle-X.X.X/lib/plugins/gradle-diagnostics-X.X.X.jar (No such file or directory)
To solve the Gradle sync error, open gradle-wrapper.properties file and update the Gradle wrapper distribution version from:
distributionUrl=https\://services.gradle.org/distributions/gradle-X.X.X-all.zip
To:
Android Studio 3.4
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
Android Studio 2.3 distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip
Android Studio 2.2 distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
Android Studio 2.1 distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
Android Studio 2.0 distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
Android Studio 1.5 distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
Android Studio 1.3 distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
You can find the latest Gradle wrapper version visiting:
https://services.gradle.org/distributions/
EDIT:
As a side note, as #SeBsZ suggests,
the official repository of the Android Gradle plugin switched from MavenCentral to jCenter (see Bintray blog post).
Make sure your project build.gradle file contains the new repository and the new classpath:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
This is not strictly related to the question problem, but since we are already migrating to the new IDE preview it's better to make sure everything is in place.
If, like me, you are using an older project then you might still be using the maven repository. Make sure you change the repositories in your top-level build.gradle from maven() to jcenter(). Then make sure you are using the correct dependency as well: classpath 'com.android.tools.build:gradle:1.3.0-beta1' for the new 1.3 preview.
For me helped to set chmod on the .gradle directory to 777. After this whole Android studio started working correctly.
I got the same issue after updating android studio to 3.4
I resolve this updatig gradle-wrapper.properties
I had
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
I leave
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
and with this To solve the Gradle sync error.
This is the weirdest thing ever and I never expected it to work but this:
distributionUrl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip
worked and got everything fixed (it was the '\' after https). It does make sense since that is an actual link to a file.
check your .bash_profile file and make sure your GRADLE_HOME points to a valid path, if things were working and you face this issue after android studio update, chances are your gradle got updated too.
Here is the example of my gradle home in .bash_profile:
export GRADLE_HOME=/Applications/Android\ Studio.app/Contents/gradle/gradle-2.14.1/bin
Had the same problem with a newly set up Android Studio 2.2.2, gradle wrapper 2.14.1. I loaded the project before i installed the needed android-23 library and installed java after Android Studio installation.
Error message in Android Studio 2.2.2:
Error:The specified Gradle distribution
'https://services.gradle.org/distributions/gradle-2.14.1-all.zip' does
not appear to contain a Gradle distribution.
Error message in cmd:
projectfolder> gradlew
Exception in thread "main" java.lang.NullPointerException
at org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:34)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:25)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
When i used gradle from cmd however it worked
projectfolder> set PATH=%PATH%;C:\AndroidStudio2.0\gradle\gradle-2.14.1\bin\
projectfolder> set GRADLE_HOME=C:\AndroidStudio2.0\gradle\gradle-2.14.1\bin\
projectfolder> cd C:\projectfolder\
projectfolder> gradle
BUILD SUCCESSFUL
In cmd i see that the gradle versions and android sdk version were correct
C:\>set | find "JAVA_HOME"
JAVA_HOME=C:\Java\jdk1.8.0_111\
However in C:\Users\.AndroidStudio2.2\system\log\idea.log it said something else:
2016-11-29 16:04:10,597 [ 107684] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/AndroidStudio2.0/jre
2016-11-29 16:04:10,597 [ 107684] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/AndroidStudio2.0/jre
After messing up Android Studio config files i ended up reinstalling everything in correct order (Java, Android Studio, Project) and it worked.
I got the same issue after updating my android studio to 1.5
Here is my error stack trace.
Error:A problem occurred configuring root project 'Kargo'.
java.io.FileNotFoundException: /home/adiyatmubarak/Documents/android-studio/gradle/gradle-2.4/lib/plugins/gradle-diagnostics-2.4.jar (No such file or directory)
After I checked to the android studio instalation directory within gradle, my gradle was gradle-2.8 I don't know how to setup my android studio path location, but for temporary fix I just rename it to gradle-2.4 and my problem solved.
I am getting the following exception in Android Studio plugin Android Support.
To get out of this error, I updated the Android Studio to 14.1, but studio just builds the app but not runs it.
null
java.lang.NullPointerException
at java.io.File.<init>(File.java:277)
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1616)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1577)
at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:350)
at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:373)
at org.jetbrains.android.facet.AndroidFacet.getAvdManager(AndroidFacet.java:585)
at org.jetbrains.android.facet.AndroidFacet.getAvdManagerSilently(AndroidFacet.java:571)
at org.jetbrains.android.run.DeviceChooser.<init>(DeviceChooser.java:143)
at org.jetbrains.android.run.ExtendedDeviceChooserDialog.<init>(ExtendedDeviceChooserDialog.java:80)
at org.jetbrains.android.run.AndroidRunningState.execute(AndroidRunningState.java:263)
at com.intellij.execution.runners.DefaultProgramRunner.doExecute(DefaultProgramRunner.java:38)
at org.jetbrains.android.run.AndroidDebugRunner.doExec(AndroidDebugRunner.java:144)
at org.jetbrains.android.run.AndroidDebugRunner.doExecute(AndroidDebugRunner.java:135)
at com.intellij.execution.runners.GenericProgramRunner$1.execute(GenericProgramRunner.java:48)
at com.intellij.execution.impl.ExecutionManagerImpl$2.run(ExecutionManagerImpl.java:208)
at com.intellij.openapi.project.DumbServiceImpl.runWhenSmart(DumbServiceImpl.java:95)
at com.intellij.execution.impl.ExecutionManagerImpl$1$1.run(ExecutionManagerImpl.java:172)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
at java.awt.EventQueue.access$400(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:697)
at java.awt.EventQueue$3.run(EventQueue.java:691)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
I Slove it by this step
you should delete this file that you can do it .
go to the path :"C:\Users\Administrator.android\avd"
and delete all the avd folders files .
try again ,you can get it.
Why this happens
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1616)
The error seems to be in Android SDK library Android Virtual Device Manager. It tries to open a file, and some argument in File constructor is null.
Solution:
I installed the needed plugins again..and it works
What else can be done in similar situations:
Plugin damaged -> reinstall the plugin.
SDK damaged -> reinstall Android SDK.
Wrong version used -> check the used version or update Android SDK.
It seems to be due to virtual devices that are already created are causing problems.
How I solved this issue:
Delete all folders from C:\Users\<userName>\.android\avd
Recreate virtual device from avd manager
It can be solved by editing build.gradle file and synch your project again.
I edited following line
classpath 'com.android.tools.build:gradle:2.3.3' and it worked.
I solved this error by opening the AVD Manager in Android Studio and uninstalling and reinstalling my emulators.