blaiti / Wallety

Wallety is a budget tracker for personal finance and budget planning.
MIT License
126 stars 31 forks source link

Problem trying to create .apk file #1

Open fecampossantos opened 2 years ago

fecampossantos commented 2 years ago

First of all, congrats for the project!! I was looking for a budget tracker and found one that not only looks greate, but safe and I can check (and change) the code!!

I'm trying to generate the apk file for it, but after running npm install

and cd android/ ./gradlew assembleRelease (I actually had problems for the second line, gradlew didn't have the necessary permissions, so I had to run a chmod u+x gradlew to solve it)

anyways, after running assembleRelease I receive this:

:ReactNative:Unexpected empty result of running '[node, -e, try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}]' command.
:ReactNative:Running '[node, -e, try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script '/home/felipe/git/personal/Wallety/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 213

* What went wrong:
A problem occurred evaluating script.
 > /home/felipe/git/personal/Wallety/node_modules/metro/src/Server.js:376  processRequest = (req, res, next) => {                 ^SyntaxError: Unexpected token =    at Module._compile (internal/modules/cjs/loader.js:723:23)    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)    at Module.load (internal/modules/cjs/loader.js:653:32)    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)    at Function.Module._load (internal/modules/cjs/loader.js:585:3)    at Module.require (internal/modules/cjs/loader.js:692:17)    at require (internal/modules/cjs/helpers.js:25:18)    at Object.<anonymous> (/home/felipe/git/personal/Wallety/node_modules/metro/src/shared/output/bundle.js:14:16)    at Module._compile (internal/modules/cjs/loader.js:778:30)    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

I tried to solve it by installing, via npm, the packages react-native, metro and react-native-community, cli-platform-android. None of them fixed, so after reading more about the error, I tried to install gradle but unfortunately I couldn't fix it.

I'm looking foward to being able to generate the apk, mostly because I woudl really like to propose some changes (like adding Brazilian Real as curreny) but I would like to test it in the apk first.

Thanks!

blaiti commented 2 years ago

hI @felipecampossantos !

Did you follow these steps before generating APK file ? https://reactnative.dev/docs/signed-apk-android

fecampossantos commented 2 years ago

Hi @blaiti !!! Thanks for your help. I haven't done that, but now I did and I'm finding another error.

:ReactNative:Unexpected empty result of running '[node, -e, try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}]' command.
:ReactNative:Running '[node, -e, try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script '/home/felipe/git/personal/Wallety/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 213

* What went wrong:
A problem occurred evaluating script.
> /home/felipe/git/personal/Wallety/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/Server.js:376  processRequest = (req, res, next) => {                 ^SyntaxError: Unexpected token =    at Module._compile (internal/modules/cjs/loader.js:723:23)    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)    at Module.load (internal/modules/cjs/loader.js:653:32)    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)    at Function.Module._load (internal/modules/cjs/loader.js:585:3)    at Module.require (internal/modules/cjs/loader.js:692:17)    at require (internal/modules/cjs/helpers.js:25:18)    at Object.<anonymous> (/home/felipe/git/personal/Wallety/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/shared/output/bundle.js:14:16)    at Module._compile (internal/modules/cjs/loader.js:778:30)    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

* 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 https://help.gradle.org

BUILD FAILED in 1s