Android Studio 0.8.2 URI has an authority component - java

I am getting "Gradle project sync failed." when I start up Android Studio. When I try to clean the project, I get "Failed to complete Gradle execution Cause: URI has an authority component"
I've tried several things already and am still stuck. I moved my config files out of my user folders and put them in my root directory where I have Android Studio. (C:/Studio). I've also tried to invalidate caches but that still didn't help. I'm on a networked VDI so I'm not sure if that might have something to do with it. Below is the message I'm getting from Gradle sync. Any ideas what can be going wrong here?
Gradle Sync Message:
Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/1.12/userguide/gradle_daemon.html
Please read below process output to find out more:
java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.(File.java:423)
at org.gradle.api.internal.classpath.EffectiveClassPath.findAvailableClasspathFiles(EffectiveClassPath.java:41)
at org.gradle.api.internal.classpath.EffectiveClassPath.(EffectiveClassPath.java:32)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.(DefaultModuleRegistry.java:61)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.(DefaultModuleRegistry.java:55)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:41)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22)

The only cause I've seen of this is if your home directory is on a network share (it has a Windows path of the form (\\UNC_PATH\... instead of something like C:\ for a local file). Gradle doesn't properly support that right now. There's a bug in Android Studio's bug database to track it:
https://code.google.com/p/android/issues/detail?id=56444
and it references a bug in Gradleware's bug database:
https://issues.gradle.org/browse/GRADLE-2941
The Android Studio bug report lists this as a workaround:
I also faced same issue. Reason I figured out that may be when I
installed Android Studio with option -- Install to current User. This
step installed .gradle folder in the organization Network Path
[\{network}\users{USERID}.gradle]
Resolution step: [On Windows 7 Machine]
Copied .gradle folder from path on network [\{network}\users{USERID}.gradle] to [C:\Users{USERID}.gradle]
In Android Studio v-(Beta) 0.8.6 [File --> Settings] changed Gradle Settings
Global Gradle settings
Service directory path: C:/Users/{USERID}/.gradle
Gradle VM options: -Dhttp.proxyHost={dummyHost} -Dhttp.proxyPort={dummyPort} -Dhttp.proxyUser={dummyUser} -Dhttp.proxyPassword={dummyPassword}
I had also given Gradle VM options because it tried to download
Gradle-0.12+-all.jar before compiling.

if you don't have a strong internet connectivity make sure you select the offline mode from the console. Selecting offline mode could solve the issue.

Related

Android Studio reports "Unable to start the daemon process"

I have searched the internet, trying to fix this and nothing has worked.
I have:
deleted my .gradle folder and let Android Studio generate a new one,
changed JVM options,
changed Java global variables in Windows,
updated sdk, ndk, jre, jdk, Android Studio and Windows
changed file paths of these things so they don't have spaces.
and I can't get rid of this error in Android Studio.
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.6/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
And that's all it says. I have no idea how to solve this.

Could not find builder.jar (com.android.tools.build:builder:3.1.0)

I wanted to Setting up android studio, i have installed the latest version(3.1.0) of it and i downloaded and installed the latest version of gradle(4.6) and created a new object. but gradle project sync failed. and shown up the error :
Could not find builder.jar (com.android.tools.build:builder:3.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.1.0/builder-3.1.0.jar
screenshot
I Couldn't find such problem with the others.
is it related to android sdk or gradle version?
is there any solution to download it manually and place it in the
location??if it's possible , where is the location ,that i can put the
builder-3.1.0.jar file.
Go to File>Setting>Build,Execution,Deployment>Gradle>Android Studio>>
and
Check mark this:: Enable Embedded repository
and Click Ok.
Then,
Rebuild the Project.
or
go to Terminal and type "gradlew cleanBuildCache" to clear the cache. The cache is in USERNAME.ANDROID\BUILD CACHE Directory.
And Rebuild.
Try deleting ~/.gradle folder and building the project again. Gradle will download that.
Accepted answer did not work for me, so I changed the class path line in gradle (project : project name) and issue is gone.
classpath 'com.android.tools.build:gradle:3.1.2'
I have tried all of the suggestions and none of them worked!
if you are facing the same issue i suggest you to do what solved my problem , i have found out the problem may caused because:
most likely at one time this dependency version was available, and so it’s now available on your Mac/PC in the filesystem (cache), and Gradle won’t try to download it (as it’s already downloaded). But then the version was removed / is no longer available, so it will no longer work on any new Mac/PC (as the dependency version can’t be downloaded).
hopefully if you have a backup before this problem happen these steps might help you to fix this issue
1) Backup or push the file you have changed to git (I suggest just your code files not anything related to gradles or android files)
2) delete C:\Users\ (your User)\ .gradle\caches
3) Do a clean git clone of the repository, into a new directory
4) Open new copy of your project with Android Studio and let Android studio sync gradles again
Check the version of Android Studio you are using...i was Android Studio 3.1 when it gave me the problem....i downgraded my Android Studio version to 3.0.1 and the problem solved.
I battled with the same problem for a very long time. But I was able to resolve it. You can try this:
Go FIle > Settings > Build, Execution, Deployment> Build Tools > Gradle then check the option Offline Work . You will notice that it points to a local gradle directory on your computer i.e C:Users/User_name/.gradle. Click Apply then OK. Run your project again, it should work.
Below is a screenshot:Screenshot of the Fix
go to SDK manager and download other SDK platform

Gradle sync failed: Unable to start the daemon process

I am new to Android development and Java but after successfully installing Android Studio and the JDK, managing to create my first app and test it both in the emulator and on a phone now whenever I open Android Studio I get the following Message:
Gradle sync failed: Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/3.3/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Consult IDE log for more details (Help | Show Log)
I have searched this site and extensively on Google and so far all suggested solutions I have found have failed.
I am using Android Studio 2.3.3 and JDK 1.8.0_131.
So far I have tried:-
Uninstalling both Android Studio and the JDK, deleting any folders left behind and then re-installing both.
Deleting the .gradle folder from C:\Users\$username$.
Changing the Build Process Heap Size to 1024.
Invalidating all caches and restarting multiple times.
Double checking and even Triple checking the paths to the JDK and Android SDK.
Ensuring that I have no extra open programs/windows and background apps in case it was a memory shortage issue suggested in some posts.
I am still at a loss as to how to fix this problem and open to any suggestions.
Thank you.
Strangely, restarting the computer worked for every single time in my case.
Sheff Do Following steps:
1.Start Android Studio.
2.Close any open project.Go to File > Close
3.Project.(Welcome window will open)
Go to Configure > Settings.
On Settings dialog,select Compiler (Gradle-based Android Projects)
from left and set VM Options to -Xmx512m(i.e. write -Xmx512m under VM Options:) and press OK.
O®
The Solution Worked for me
1.Open the projects gradle.properties file in android studio
2.Added this line at end of file org.gradle.jvmargs=-Xmx1024m & Save the file
3.Close & reopen the project
Both method is same but you said new to Android studio so I give both suggestions..if any doubt text me
If this affects a single project, it can be due to a missing gradle.properties or gradle-wrapper.properties file.
Try these defaults in the project directory
gradle.properties
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=false
android.nonTransitiveRClass=true
android.enableR8.fullMode=true
android.buildTypes.release.ndk.debugSymbolLevel = SYMBOL_TABLE
and
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

Android Studio 2.3 error: "Gradle sync failed: Cause: services.gradle.org"

After I open a new project in Android Studio 2.3, I receive an error such as:
Gradle sync failed: Cause: services.gradle.org
Googling just gave me a log file on an issue tracker page. I have tried uninstalling/reinstalling. I am not behind a proxy and I've already set:
Use default gradle wrapper
Restarting Gradle sync stops at
Refreshing Gradle project
I can't find anything to fix this problem.
I am running Android Studio on Windows 8.1 with JRE 1.8.0
I Guess This Can Help You.....
https://gradle.org/install
// for manual installation
to get the gradle distribution visit
https;//gradle.org/release
STEPS
1 Dowmload the gradle
2 unzip the pack.
3 create a new folder in your C drive and name it gradle
4 place the unzipped pack into the folder you created
5 Now set the path for your gradle in Android Studio to the just created folder
6 Add the path of your gradle to the System Varaibles.
7 Computer, right click >Properties>Advance System Settings>Enviroment
Varaibles>System Varaibles.Path>Edit.
Hope its Helpful
I also faced the same problem. You have two ways to solve this.
First one is to connect to the Internet and download a new version of Android Studio and the required packages.
Note: You should have "proxies" and "offline work" options enabled.
The second way is to go to file > settings > build > gradle and do the following:
Uncheck the "offline work" option.
Use local gradle distribution and then set the path.
Note: When you have "no proxy" option checked with "offline work" then you have to provide path for every new project.
I had the same problem. so i followed this https://docs.gradle.org/current/userguide/userguide_single.html#installation
finally i got it !!
Android Stidio v 3.0.1
I have this issue and have tried reinstalling to no avail.
What I found was useful is to look in my home directory (on Ubuntu) and open the .gradle folder and open the matching sub folder and delete the lck file and then manually download the desired gradle version (url distributionUrl value) and place the downloaded file in the folder that had the lck file.
Have attributed this problem to using usb tethering for internet..

assembleDebug error in Android Studio

I have updated to the latest Android SDK and set JAVA_HOME in .bash_profile using
export JAVA_HOME=$(/usr/libexec/java_home), and I'm getting the following error:
Error Gradle:
FAILURE: Could not determine which tasks to execute.
* What went wrong:
Task 'assembleDebug' not found in project ':CrystalBall'.
* Try:
Run gradle tasks to get a list of available tasks.
Error: Could not execute build using Gradle distribution
http://services.gradle.org/distributions/gradle-1.6-bin.zip
I've attached a screenshot:
What should I do?
The second error in your screenshot seems more important to me. You have to make sure, that the Android Studio is able to download and execute the gradle binary. If you are using a proxy you have to configure it in the Android Studio.
To check the gradle tasks, go to your project folder on the command line and type "gradlew tasks"
You can also configure a proxy for gradle. Just create a gradle.properties file in (your project folder) with these properties:
systemProp.http.proxyHost=www.example.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxy.com|localhost
I don't believe this is the issue the poster had, but for the benefit of others I'll add what I found as I was helping someone on Windows XP who was getting the same error.
It appears the issue in his case was that the path to the Android Studio project had spaces in it (since Windows XP uses the Documents and Settings directory). I had him generate a new project into a directory without spaces in it and it built and ran without problems. Might have actually been something else, but as usual it is best to avoid spaces in paths.

Categories

Resources