最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Gradle Build Fails in Expo React Native: "Unexpected lock protocol found in lock file. Expected 3, found 50" -

programmeradmin0浏览0评论

I'm trying to run my React Native project using Expo (npx expo run:android), but I'm encountering a Gradle error:

FAILURE: Build failed with an exception.

* What went wrong:
Unexpected lock protocol found in lock file. Expected 3, found 50.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at .

What I Tried:

  1. Updated Gradle to 8.10.2 manually by downloading it from the official site and extracting it to:

    C:\Users\LENOVO\gradle-8.10.2
    
  2. Modified gradle-wrapper.properties (inside android/gradle/wrapper/) to point to the local Gradle distribution:

    distributionUrl=file\:///C:/Users/LENOVO/gradle-8.10.2-all.zip
    
  3. Cleared Gradle Cache:

    cd android
    gradlew clean
    
  4. Deleted Lock Files:

    • android/.gradle
    • android/gradle/wrapper
    • android/.gradle/gradle.lock
  5. Tried Running Again:

    npx expo run:android
    

System Info:

  • OS: Windows 10
  • Expo CLI Version: 6.3.10
  • React Native Version: 0.76.6
  • Gradle Version: 8.10.2

Despite these steps, I'm still getting the "Unexpected lock protocol found in lock file. Expected 3, found 50" error. How can I resolve this issue?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论