Android Studio - Gradle Sync Issue, Cannot find a solution! - Android Studio

Hi Guys,
Would anyone be able to guide me in the right direction as to why I'm seeing this issue in Android Studio?
Notes: This is a first time install Error: Gradle sync failed: Unable to find method 'com.google.common.io.Resources.asCharSource(Ljava/net/URL;Ljava/nio/charset/CharsetLcom/google/common/io/CharSource;'. Consult IDE log for more details (Help | Show Log)
I can send anyone a screenshot of the error in more detail if needed.
Kind Regards,
The log is here:
"2016-12-20 23:03:43,146 [ 12922] WARN - nal.AbstractExternalSystemTask - Unable to find method 'com.google.common.io.Resources.asCharSource(Ljava/net/URL;Ljava/nio/charset/CharsetLcom/google/common/io/CharSource;'.
com.intellij.openapi.externalSystem.model.ExternalSystemException: Unable to find method 'com.google.common.io.Resources.asCharSource(Ljava/net/URL;Ljava/nio/charset/CharsetLcom/google/common/io/CharSource;'.
at com.android.tools.idea.gradle.project.ProjectImportErrorHandler.createUserFriendlyError(ProjectImportErrorHandler.java:288)
at com.android.tools.idea.gradle.project.ProjectImportErrorHandler.getUserFriendlyError(ProjectImportErrorHandler.java:196)
at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:401)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:772)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:752)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:238)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:112)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:73)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(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:49)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:138)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:124)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:419)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:500)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369)
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)
2016-12-20 23:03:43,172 [ 12948] WARN - radle.project.ProjectSetUpTask -
2016-12-20 23:03:43,172 [ 12948] INFO - radle.project.ProjectSetUpTask - Unable to find method 'com.google.common.io.Resources.asCharSource(Ljava/net/URL;Ljava/nio/charset/CharsetLcom/google/common/io/CharSource;'."

Upgrade or reinstall
Did you try to reinstall android studio ? I think it has something to do with jar version mismatch

Related

[Q] Setting up a test environment

Can anyone advise this rookie user how to set up a test environment to use with an Android Studio project?
I recently installed Android Studio on my Windows 7 laptop and put together my first simple app. When I tried to debug it, I was offered two pre-configured test environments. The first was "Nexus 5 API 21x86" but when I tried to use that one it told me I needed HAXM. After much research I worked out what I needed to do to install HAXM but the installation file gave me the following error message:
VT_Not_Support = This computer does not support Intel Virtualization Technology (VT-x). HAXM cannot be installed."
I therefore turned my attention to the second option "TestDevice". When I tried to run that, Android Studio reported:
emulator: ERROR: This AVD's configuration is missing a kernel file!!
emulator: ERROR: ANDROID_SDK_ROOT is undefined
I Googled the error and found the advice that I needed to install "ARM EABI v7a System Image" but when I ran the SDK manager it told me that this component was already installed.
Can anyone please tell me either how to overcome the ANDROID_SDK_ROOT undefined problem or advise how otherwise to set up an emulated test environment that works on my computer.
I am an experienced programmer but a complete novice when it comes to Android Studio, all the associated applications and Android devices in general.
Many thanks in advance for your patience.
Keith
writerman said:
... following error message:
VT_Not_Support = This computer does not support Intel Virtualization Technology (VT-x). HAXM cannot be installed."
Click to expand...
Click to collapse
Keith, have you tried enabling VT-x in your BIOS settings?
Thanks for the suggestion. I wasn't aware of this BIOS setting. I will give it a try but may not have a chance to try it out until the weekend
This should do the trick if you have compatible CPU.

Problem with Android Studio 1.4 when creating a new Java Class "

The error that shows Android Studio is the following:
Unable to parse template "Class"
Error message: Cannot modify a read-only directory 'D:\Users\david.t_92\AppData\Local\Android\sdk\platforms\android-23\android.jar!\android\app'.
I try to make almost everything and nothing Works
Please help
david.t_922 said:
The error that shows Android Studio is the following:
Unable to parse template "Class"
Error message: Cannot modify a read-only directory 'D:\Users\david.t_92\AppData\Local\Android\sdk\platforms\android-23\android.jar!\android\app'.
I try to make almost everything and nothing Works
Please help
Click to expand...
Click to collapse
Did you got the solution, I too facing this issue

Gradle Sync Error

Hello, I am trying to get android studio working on my debian computer but when I installed it every time I either try to open an existing project or start a new one I get the error "gradle sync failed: process 'command '/usr/android-studio/jro/bin/java' ' finished with non-zero exit value 2. I tried downloading the latest gradle and re-downloading android studio and neither have worked.
Hi Zachdog,
Have you found a solution yet?
I have the exact same problem, been working on it for days now.
I tried:
* for more then a few hours to find a solution online (mainly stackoverflow)
* change a AS compiler setting (heap size) as follows: Configure > Settings > Build, Execution, Deployment > Compiler> Change Build process heap size (Mbytes) to 1024 and Additional build process to VM Options to -Xmx512m
* deleted the MyFirstApp project and started over again
* read the AS idea.log
* searched more on the internet
* 'run' the app, which resulted in: "Error running build: Module 'MyFirstApp' is not backed by gradle"
* restart AS and PC
* in Project Setting > Gradle i have "use defeault Gradle wrapper (recommended)"
* in Project Structure > JDK Location i have "Use embedded JDK (recommended)"
* Re-installed android studio.
Version info:
Ubuntu 16.04.1 LTS
Android Studio 2.2.1
Android plugin version: 2.2.1.
Gradle version 2.14.1
Java Version 8 Update 101
Now i am out of options. Please help me solve these grradle errors.

Android Studio 3.1.3: Error message 'Cannot find symbol: View'

I'm new to Android development and I just started playing with Android Studio 3.1.3. I'm following a tutorial from android.developer.com and I'm on the part: Start Another Activity - Respond to the Send button. Thing is, when I add the sendMessage() method stub, I get an error message saying the symbol View cannot be found. I tried the following steps to resolve the issue but I'm not successful:
- Place the cursor on View then click ALT-ENTER but the menu Import class doesn't appear.
- I clicked File - Invalidate Caches/Restart
Any useful assistance is welcome.
Christopher

Android Studio ERROR: Unsupported method:

So Im creating my first ever app and I cant code so I used buildbox. Im trying to make my game into an apk but when i put it into Android Studio it says:
ERROR: Unsupported method: AndroidProject.getVariantNames().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
Any help would be greatly appreciated!
Dopeyplayz said:
So Im creating my first ever app and I cant code so I used buildbox. Im trying to make my game into an apk but when i put it into Android Studio it says:
ERROR: Unsupported method: AndroidProject.getVariantNames().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
Any help would be greatly appreciated!
Click to expand...
Click to collapse
go to build.gradle and copy paste here all the code
StonebridgeGr said:
go to build.gradle and copy paste here all the code
Click to expand...
Click to collapse
what code do I paste in there?

Categories

Resources