UFO ET IT

오류 : 잠금 파일에 예기치 않은 잠금 프로토콜이 있습니다.

ufoet 2021. 1. 10. 17:49
반응형

오류 : 잠금 파일에 예기치 않은 잠금 프로토콜이 있습니다. 3 개 필요, 0 개 발견


Android Studio를 1.3으로 업그레이드 한 후 더 이상 프로젝트를 컴파일 할 수 없습니다. 나는 얻고있다 Unexpected lock protocol found in lock file. Expected 3, found 0.. .gradle폴더 삭제를 시도했지만 문제가 해결되지 않습니다. 내가 할 수있는 다른 일이 있습니까?


폴더를 삭제하여 해결했습니다.

c : \ users \ [myusername] \ .gradle \ caches \ 2.14.1

Android 스튜디오를 다시 열면 괜찮 았습니다.


여기에 단계가있는 매우 가벼운 솔루션이 있습니다.

  • Ctrl + Alt + Shift + S 또는 파일-> 프로젝트 구조

  • 왼쪽 패널에서 프로젝트 선택

  • 이제 오른쪽 패널에서 Gradle 버전확인하십시오.

  • 제 경우에는 Gradle 버전3.3입니다.

  • 이동 C : \ 사용자 \ 인 Ashish \ .gradle \ 캐시 및 삭제 Gradle을 버전 - 3.3 라는 이름의 폴더에 있습니다.

  • 이제 작업 공간에서 프로젝트를 다시 시작 하거나 엽니 다 .

인사말 ... 문제가 해결되었습니다.


당신은 삭제합니다 /.gradle , 사용자 디렉토리에서 폴더를 프로젝트에서하지 당신이 + /home/user/.gradle하고 "ALT"에 리눅스 기반의 시스템을 사용하는 경우, it`sa 숨겨진 디렉토리 "를." 숨겨진 폴더를 표시하려면


로컬 파일 프로젝트로 이동하여 ".gradle"폴더를 검색하십시오.

지우고 IDE를 다시 시작하십시오.


안드로이드 스튜디오에서 "캐시 무효화 / 다시 시작 .."을 클릭하고 확인합니다.


캐시 폴더 삭제는 3GB 이상의 파일이 200,000 개 이상이므로 시간이 오래 걸립니다. Ashish가 언급했듯이 빠른보기가 있습니다.

나는 또한 하나의 앱에서만이 오류에 직면했습니다.

단계를 진행하십시오.

  1. 프로젝트에서 gradle-wrapper.properties파일을 엽니 다 . Android 구조의 Gradle Script에 있습니다. 아래 이미지와 같이.

    여기에 이미지 설명 입력

  2. 그 파일에서 distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip. 여기서 gradle 버전은 4.6입니다.

여기에 이미지 설명 입력

3. 따라서 해당 프로젝트의 모든 캐시는 C:\Users\Your PC Name or User Name\.gradle\caches\4.6. 아래 이미지와 같이.

여기에 이미지 설명 입력

  1. Android 스튜디오를 닫고 4.6 폴더를 삭제하십시오. 삭제 후 android studio를 엽니 다.

그게 다야. 캐시 폴더를 찾아 삭제하는 데 6 시간이 걸렸습니다. 그래서이 답변을 게시하기로 결정했습니다. 그래서 사람들은 같은 시간을 낭비하지 않을 것입니다.


나는 같은 문제가 있었다. 프로젝트의 .gradle 폴더를 삭제해도 문제가 해결되지 않았습니다.

C:\Users\<username>\.gradle폴더 를 삭제하여 문제를 해결하고 스튜디오에서 전체 gradle 빌드를 새로 고치도록했습니다. 업그레이드 경로에서 4 개의 다른 버전의 gradle이 설치되어 있음을 발견했습니다.


이 모든 솔루션이 Android Studio 2.1에서 작동하지 않았습니다. 작업 한 것은 프로젝트 폴더에서 gradle-wrapper.properties를 열고 아래 줄에서 내 gradle 참조를 변경하는 것입니다.

distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

이것은 다음과 같이 변경되었습니다.

distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip

그 후 gradle이 업그레이드되고 앱이 작동하기 시작했습니다!


파일 메뉴에서 캐시 무효화 / 다시 시작을 클릭합니다. 그런 다음 무효화 및 다시 시작을 클릭하십시오. 문제가 해결됩니다.

캐시 무효화


Delete C:\Users\user\.gradle\caches folder and restart the project.

이 오류의 경우 위의 해결 방법 중 어느 것도 작동하지 않았습니다. 방금 프로젝트를 시작했기 때문에 손실에 대해 걱정하지 않았습니다. 다음을 완료했습니다.

  1. "File \ Close Project"를 선택하면 프로젝트가 닫힙니다.
  2. The opening screen to create a new project came up.
  3. I deleted the project from the list just to have it not show in the list.
  4. Created a new project with a slightly different name.
  5. Ran the new project and it worked fine.

  1. Get into the .gradle folder in the root of the project.

  2. There, you might see a couple of versions. Pick the gradle version that you're using in the porject.

  3. cd into taskArtifacts folder.

  4. clear the cache.properties.lock file.

Finally, build the project. Hope that helps.


None of the above worked for me ....

You just need to go to File -> Project Structure or jus press Ctrl+Alt+Shift+S

and then on the top left click Project Make sure that your Android Plugin Version is the same as you Android Studio Version .. This should fix it

additionally

You can also create a new Project and check under Project view initially you'll be in Android .. change the view to ... Project - > gradle (Note .. not .gradle only gradle ) ->wrapper ->gradle-wrapper properties.. open this file and you can see the last line ie ..

distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

make sure you have the same gradle version in your old files as well

Check out this Youtube Video i made regarding this issue

https://youtu.be/-Ngn4YvbKtw


It doesn't work none of above all.

  1. Close the project.
  2. Remove from project list
  3. Re-import the project again. (If you have a whole source file of a project, you should clean previous project and extract the project again)
  4. Open intellij and click open the project.
  5. Select the extracted folder/ project folder.

It is done.


- Go into your local file project and search for the ".gradle" folder,(folder from user directory, not from project, it`s a hidden directory, if you used linux-based system it is in /home/user/.gradle and press "alt"+"." to show hidden folders,)

  • Erase it and restart your IDE

if this doesnt work then, All of these solutions did not work for me on Android Studio 2.1. What worked was me opening gradle-wrapper.properties in project folder and changing my gradle reference on the line below:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

This was changed to:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip

After which gradle upgraded and the app started working!


Open your previous project and open file>ProjectStructure>project check this gradle version,android plugin version of previous project and set it to your current project .and click invalidate/restart


For the persons who have this problem on <Android Studio 3.1.2>. After I got this problem, I done all solutions in this topic. But each of the solutions alone did not solve my problem. So I've combined some strategies.


  1. First I removed application from Android Studio Launcher List.
  2. Second I deleted all the content from .gradle (FOLDER FROM USER DIRECTORY).
  3. Third I import the project again (after sync i got the error again).
  4. Fourth while project is open I used <Invalidate Cache / Restart> option from FILE menu.

I hope this solution work for you too.


We successfully resolved this error.. Go to your project location in my case it was F:=> PROJECT NAME=> .gradle.. and we deleted the the .gradle file.. then restarted android studio and loaded the project again.. and this time the the gradle build successfully.


Removing the .gradle directory from the user directory is not enough. Make sure to delete the .gradle directory from the project directory as well. In fact I would start with the project and only if that isn't enough should you delete at the user level.


제 경우에는 기계 변경으로 인해 GRADLE_USER_HOME이 설정되지 않았습니다. 이 환경 변수를 재설정하면 모든 것이 다시 정상적으로 작동합니다.


모든 gradle 파일을 삭제할 필요가 없습니다. 삭제 만하면 C:\Users\(your user name)\.gradle\daemon\(gradle version)\registry.bin.lock완료됩니다!


파일 메뉴에서 캐시 무효화 / 다시 시작을 클릭 합니다 . 그런 다음 무효화 및 다시 시작 을 클릭 하십시오 . 그것은 당신의 문제를 해결할 것입니다 :)

참조 URL : https://stackoverflow.com/questions/31743942/errorunexpected-lock-protocol-found-in-lock-file-expected-3-found-0

반응형