admin管理员组

文章数量:1307415

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?

本文标签: