GSTJ / pegava-dating-app

💖 A place to get some love. Pegava is a beautiful dating app made in React Native.
https://github.com/GSTJ/pegava-dating-app
Creative Commons Zero v1.0 Universal
350 stars 115 forks source link

Dependency problem and building apk #10

Closed david-shiko closed 1 year ago

david-shiko commented 1 year ago

Hi! I tried to install dependencies in a 3 ways but failed:

1) npm install 2) npm install --legacy-peer-deps 3) npm install --force Eventually I installed it by npm update

but I can't create apk cuz I don't see an android folder. Command to build apk: react-native run-android

P.S. Sorry for possibly stupid question, I'm not a truly JS developer. I did research and your project is one of the better on github.

GSTJ commented 1 year ago

Thanks for the kind words.

You can try installing packages via yarn, as this is the preferred method for this project.

As for the build steps for android, this is a project done with Expo - it means that the Android folder is abstracted away and handled by Expo itself.

To run the project on Android, you want to run "yarn start android", which should install the app and start the bundler for you. You can check all commands on the package.json file.

The command you ran is indeed right for normal projects, with Expo you need to rely on their build commands for managed projects like this.

david-shiko commented 1 year ago

Thanks for a reply! I still have a problem with it. My goal is to build /create apk rather than just run emulation. Steps to reproduce:

git clone git@github.com:GSTJ/PegavaDatingApp.git
cd cd PegavaDatingApp/
yarn isntall
mv App.json app.json (Required to fix "Error: No config exists")
eas build -p android --local
(Here is warning, choosing no option (removing metro.config.js also helps):
It looks like that you are using a custom metro.config.js that does not extend @expo/metro-config.
This can result in unexpected and hard to debug issues, like missing assets in the production bundle.
We recommend you to abort, fix the metro.config.js, and try again.
Learn more on customizing Metro
✔ Would you like to abort? … no)

... // long installation

Final output:
[RUN_GRADLEW] FAILURE: Build completed with 2 failures.
[RUN_GRADLEW] 1: Task failed with an exception.
[RUN_GRADLEW] -----------
[RUN_GRADLEW] * Where:
[RUN_GRADLEW] Build file '/tmp/david/eas-build-local-nodejs/d39c1485-0ab1-446c-9baf-b690a2577422/build/node_modules/react-native-appearance/android/build.gradle' line: 23
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred evaluating project ':react-native-appearance'.
[RUN_GRADLEW] > Plugin with id 'maven' not found.
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] ==============================================================================
[RUN_GRADLEW] 2: Task failed with an exception.
[RUN_GRADLEW] -----------
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred configuring project ':react-native-appearance'.
[RUN_GRADLEW] > compileSdkVersion is not specified. Please add it to build.gradle
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] ==============================================================================
[RUN_GRADLEW] * Get more help at https://help.gradle.org
[RUN_GRADLEW] BUILD FAILED in 30s
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Build failed
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
    Error: npx exited with non-zero code: 1

Versions:

$ npm --version
8.19.3
$ node --version
v16.19.1
yarn --version
1.22.19
$ expo-cli --version
6.3.2
$ eas --version
eas-cli/3.7.2 linux-x64 node-v16.19.1