ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.15k stars 1.01k forks source link

[Bug]: #7573

Open IsaacPere opened 3 months ago

IsaacPere commented 3 months ago

Capacitor Version

bun run android not function defined eacess.....

Other API Details

bunjs --version latest

Platforms Affected

Current Behavior

I am having an issues with capacitor cli that aid in running android platform, can you consider to rewrite the entire cli android run.js file and then refactor the initialization of gradle and it running.

Expected Behavior

running smoothly and brazing fast in bun and node

Project Reproduction

capactor/cli/android/dist/run.js

Additional Information

No response

ionitron-bot[bot] commented 3 months ago

This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed. Please see the Contributing Guide for how to create a Sample App. Thanks! Ionitron 💙

IsaacPere commented 3 months ago

The best example is to create a JavaScript project using vite then install capacitor dependencies include android dependency then build it and run it using bun you will found that the cli of android file in particular run.js file will bring an error of unidentified and used EACESS. And it seems that Android dependencies and the whole process is always dramatic and nightmare. Once again use bun runtime enivormment for the issue diagnostics

jcesarmobile commented 3 months ago

can you provide the sample app?

IsaacPere commented 3 months ago

I have created a new repo named BunJSCapactiorJS please use bunjs runtime for diagnostics and application development

jcesarmobile commented 3 months ago

You didn't link the app, is it this one https://github.com/IsaacPere/BunJSCapactiorJS ?

I've tested it and it's working fine on my computer (macbook with macOS Sonoma 14.5)

I ran:

git clone https://github.com/IsaacPere/BunJSCapactiorJS
cd BunJSCapactiorJS
bun install
bun run build   
bun cap sync 
bun cap run android

I had bun 1.1.3 installed, also updated to latest (1.1.21) and also worked fine.

because you mean bun, right? in the description you mentioned bunjs, which is a 4 year old Chinese package.

You also mention bun run android, the correct command would be bun cap run android, with bun run android I get

Script not found "android" So that's not your problem and it's probably just a typo.

IsaacPere commented 3 months ago

✔ Copying web assets from dist to android/app/src/main/assets/public in 14.42ms ✔ Creating capacitor.config.json in android/app/src/main/assets in 2.66ms [info] Inlining sourcemaps ✔ copy android in 37.92ms ✔ Updating Android plugins in 1.62ms ✔ update android in 54.27ms ✖ Running Gradle build - failed! [error] TypeError: Executable not found in $PATH: "./gradlew" at spawn (native) at spawn (node:child_process:721:8) at (node:child_process:2:21) at spawn (/home/isaacpere/BunJSCapactiorJS/node_modules/cross-spawn/index.js:12:24) at spawn (/home/isaacpere/BunJSCapactiorJS/node_modules/@ionic/utils-subprocess/dist/index.js:170:12) at run (/home/isaacpere/BunJSCapactiorJS/node_modules/@ionic/utils-subprocess/dist/index.js:105:24) at (/home/isaacpere/BunJSCapactiorJS/node_modules/@ionic/utils-subprocess/dist/index.js:68:30) at output (/home/isaacpere/BunJSCapactiorJS/node_modules/@ionic/utils-subprocess/dist/index.js:66:20) at (/home/isaacpere/BunJSCapactiorJS/node_modules/@capacitor/cli/dist/util/subprocess.js:8:24) at runCommand (/home/isaacpere/BunJSCapactiorJS/node_modules/@capacitor/cli/dist/util/subprocess.js:5:27) error: "cap" exited with code 1

I gotten the messages but I forgot to tell you that I am using kali linux I have tried everything and seems that you need to reconfigure the capacitor cli node modules and also the android node modules in javascript, what should we do ?