Error: command failed: ./gradlew app:installdebug -preactnativedevserverport=8081

To fix the error “command failed: ./gradlew app:installdebug -preactnativedevserverport=8081 ,” you need to perform the following steps:

  1. Check the gradle wrapper file:
  2. Make sure you have the gradle wrapper file (gradlew) in the root directory of your project. If it’s missing, you can generate it by running the following command:

    gradle wrapper
  3. Grant execution permissions:
  4. Ensure that the gradlew file has execution permissions. You can grant the necessary permissions by running:

    chmod +x gradlew
  5. Clean the project:
  6. Next, clean your project by running the following command:

    ./gradlew clean
  7. Rebuild the project:
  8. Now, try rebuilding the project by running:

    ./gradlew assembleDebug
  9. Install the debug version:
  10. Finally, install the debug version of your app on the connected device or emulator using:

    ./gradlew app:installDebug

Make sure to replace 8081 with the actual port number you want to use for your preact-native development server.

Here is an example:

./gradlew app:installdebug -preactnativedevserverport=8081

Similar post

Leave a comment