obytes / react-native-template-obytes

📱 A template for your next React Native project: Expo, PNPM, TypeScript, TailwindCSS, Husky, EAS, GitHub Actions, Env Vars, expo-router, react-query, react-hook-form.
https://starter.obytes.com
MIT License
2.19k stars 321 forks source link

pnpm android gives an error: A problem occurred configuring project ':expo-modules-core' -> ../25.1.8937393 did not have a source.properties file #318

Closed BishalN closed 4 months ago

BishalN commented 4 months ago

Summary:

I did the getting started: when i ran the pnpm android throws error

Steps to reproduce:

nothing fancy just create the app and run pnpm ios; I am on mac m1

Expected behavior:

Throws above error

Additional notes:

Here's the log i got cross-env EXPO_DEBUG=true EXPO_NO_DOTENV=1 expo run:android expo:env Skipping .env files because EXPO_NO_DOTENV is defined +0ms Resolved port: 8081, start dev server: true expo:start:platforms:android:adbServer /Users/bishalneupane/Library/Android/sdk/platform-tools/adb devices -l +0ms expo:start:platforms:android:adbServer /Users/bishalneupane/Library/Android/sdk/platform-tools/adb -s emulator-5554 emu avd name +19ms expo:start:platforms:android:adbServer /Users/bishalneupane/Library/Android/sdk/platform-tools/adb devices -l +46ms expo:start:platforms:android:adbServer /Users/bishalneupane/Library/Android/sdk/platform-tools/adb -s emulator-5554 emu avd name +18ms expo:android:resolveDevice Resolved default device (name: Pixel_XL_API_32_2, pid: emulator-5554) +0ms expo:run:android Package name: com.obledgerhub.development +0ms › Building app... expo:start:platforms:android:gradle /Users/bishalneupane/Desktop/myprojects/rn-dev/obledgerhub/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 +0ms Configuration on demand is an incubating feature.

Configure project :app ℹ️ Applying gradle plugin 'expo-dev-launcher-gradle-plugin' (expo-dev-launcher@3.6.9)

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 9s 10 actionable tasks: 10 up-to-date

hamzamekk commented 4 months ago

Hello @BishalN thank you for sharing with us your issue, based on what i am seeing It looks like the build process failed due to an issue with the Android NDK. Specifically, the error message indicates that the NDK directory is missing the source.properties file. Here's how you can resolve this issue

  1. Verify NDK Installation:

    • Open Android Studio.
    • Navigate to Preferences (or File -> Settings on Windows) -> Appearance & Behavior -> System Settings -> Android SDK.
    • Click on the SDK Tools tab.
    • Ensure that the NDK is installed. If it is not, install it and ensure the version includes the source.properties file.
  2. Reinstall or Update NDK:

    • If the installation might be corrupted, try reinstalling the NDK.
    • Delete the 25.1.8937393 folder located in /Users/bishalneupane/Library/Android/sdk/ndk/.
    • Reinstall the NDK through Android Studio.
  3. Ensure Correct NDK Path:

    • Open your project's local.properties file.
    • Ensure it includes a line like: ndk.dir=/Users/(your name)/Library/Android/sdk/ndk/25.1.8937393
    • Verify that you're using a valid and complete version of the NDK.
  4. Check for Updates:

    • Ensure your Android build tools, SDK, and NDK are up to date, as updates can resolve compatibility issues and missing files.
  5. Clean and Rebuild the Project:

    • try to rebuild the project by add --clean to delete native folder pnpm prebuild --clean

if this error still occurs please let us know

BishalN commented 4 months ago

thanks @hamzamekk. Turns out I didn't have the ndk.