java 找不到 builder.jar (com.android.tools.build:builder:3.1.0)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/49793081/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Could not find builder.jar (com.android.tools.build:builder:3.1.0)
提问by Salim13i
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 :
我想设置android studio,我已经安装了它的最新版本(3.1.0),我下载并安装了最新版本的gradle(4.6)并创建了一个新对象。但 gradle 项目同步失败。并显示错误:
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
找不到 builder.jar (com.android.tools.build:builder:3.1.0)。在以下位置搜索:https: //dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.1.0/builder-3.1.0.jar
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.
- 它与android sdk或gradle版本有关吗?
- 有没有办法手动下载它并将其放置在位置?如果可能,位置在哪里,我可以放置builder-3.1.0.jar文件。
回答by Hamed Ahmadi
Go to File>Setting>Build,Execution,Deployment>Gradle>Android Studio>> and Check mark this:: Enable Embedded repository and Click Ok. Then, Rebuild the Project.
转到 File>Setting>Build,Execution,Deployment>Gradle>Android Studio>> 并选中此项:启用嵌入式存储库并单击 Ok。然后,重建项目。
or
或者
go to Terminal and type "gradlew cleanBuildCache" to clear the cache. The cache is in USERNAME.ANDROID\BUILD CACHE Directory.
转到终端并输入“gradlew cleanBuildCache”以清除缓存。缓存位于 USERNAME.ANDROID\BUILD CACHE 目录中。
And Rebuild.
和重建。
回答by Ramkesh Yadav
Accepted answer did not work for me, so I changed the class path line in gradle (project : project name
) and issue is gone.
接受的答案对我不起作用,所以我更改了 gradle ( project : project name
) 中的类路径行,问题消失了。
classpath 'com.android.tools.build:gradle:3.1.2'
回答by Bit
Try deleting ~/.gradlefolder and buildingthe project again. Gradle will download that.
尝试删除 ~/.gradle文件夹并重新构建项目。Gradle 会下载那个。
回答by edauda
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 > Gradlethen 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 Applythen OK. Run your project again, it should work. Below is a screenshot:Screenshot of the Fix
我与同样的问题斗争了很长时间。但我能够解决它。你可以试试这个:转到文件 > 设置 > 构建、执行、部署 > 构建工具 > Gradle然后检查选项Offline Work。您会注意到它指向您计算机上的本地 gradle 目录,即 C:Users/User_name/.gradle。单击“应用”,然后单击“确定”。再次运行您的项目,它应该可以工作。以下是屏幕截图:修复的屏幕截图
回答by Shayan Moghadam
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).
这个依赖版本很可能在某个时候可用,所以它现在可以在你的 Mac/PC 上的文件系统(缓存)中使用,并且 Gradle 不会尝试下载它(因为它已经下载了)。但后来该版本被删除/不再可用,因此它将不再适用于任何新的 Mac/PC(因为无法下载依赖版本)。
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)
1)备份或推送您更改的文件到git(我建议您的代码文件与gradle或android文件无关)
2) delete C:\Users\ (your User)\ .gradle\caches
2) 删除 C:\Users\ (你的用户)\ .gradle\caches
3) Do a clean git clone of the repository, into a new directory
3)对存储库进行干净的git克隆,进入一个新目录
4) Open new copy of your project with Android Studio and let Android studio sync gradles again
4) 使用 Android Studio 打开项目的新副本,并让 Android Studio 再次同步 gradle
回答by Rajas47Ashtikar
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.
检查您使用的 Android Studio 版本...当它给我带来问题时我是 Android Studio 3.1....我将我的 Android Studio 版本降级到 3.0.1 并且问题解决了。