Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem trying to create .apk file #1

Open
fecampossantos opened this issue May 20, 2022 · 2 comments
Open

Problem trying to create .apk file #1

fecampossantos opened this issue May 20, 2022 · 2 comments

Comments

@fecampossantos
Copy link

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
Copy link
Owner

blaiti commented Jun 15, 2022

hI @felipecampossantos !

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

@fecampossantos
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants