Giter Club home page Giter Club logo

Comments (35)

Chhekur avatar Chhekur commented on August 25, 2024 1

May be there are some issues in[email protected].
We'll fix this issues ASAP,
For now you can downgrade to older version 1.0.6 follow these steps:

npm uninstall -g androidjs-builder
npm install -g [email protected]

Please report us if you find any other error or bug : )

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024 1

I see the same issue. Downgrading did allow me to continue.

Yeah I think there are few bugs in 1.0.7 😅, we'll fix it ASAP.
We are making Android JS to compatible with react-native and flutter as well to provide Node JS runtime environment in react native and flutter . stay tuned for updates.

And when you done with your app, that you build with Android JS, you can make a pull request on app-showcase to add your app on Android JS homepage :)

from androidjs.

Kingjosh007 avatar Kingjosh007 commented on August 25, 2024

Thank you. Downgrading...

from androidjs.

rickhall avatar rickhall commented on August 25, 2024

I see the same issue. Downgrading did allow me to continue.

from androidjs.

 avatar commented on August 25, 2024

Using Windows 8.1x64
AndroidJS Version : 1.0.6

I'm getting error when I build a project which I created using the command
android g

The error is that after installing, when I launch the app, it starts but after staying for 2-3 seconds, the app closes itself(I could still see it on the task-manager). But the same problem keeps repeating whenever I try to open it/bring it to foreground from task-manager.

But if I build any of the projects which are in the examples, all of them just work fine

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

This is problem just because may be all the dependencies are not installed

Run npm install command to install dependencies into the project folder

from androidjs.

 avatar commented on August 25, 2024

If the dependencies are missing, then the apk shouldn't even build(I think).

Nvm, previously I was using yarn for fetching the modules. Will check with npm & then report.

Btw, this project is good! Thanks 😄

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

When the application crashes, there is always be a run time exception that can't be checked at compile time.
App crash always happend because of mostly node js code so it always better to check all the required modules you have in node_modules and code you have written is correct.

And if you like the project could you please share it to make it more rechable to the community 😉

from androidjs.

 avatar commented on August 25, 2024

NOTE : Only for the case of androidjs-builder version 1.0.6

Ok, I caught the error.

When I use the command
androidjs g
All example files are generated except main.js

I included this file(which I left empty) & now everything worked like a charm

from androidjs.

EnterTheNameHere avatar EnterTheNameHere commented on August 25, 2024

Have the same issue, downgrading works.

I've noticed:

Console log
{ DEBUG: false,
  BUILDER__cwd: 'C:\\Users\\Jan\\AppData\\Roaming\\npm\\node_modules\\androidjs-builder',
  PROJECT__cwd: 'D:\\Developers\\Repositories\\playfrommidi',
  PROJECT__dist: 'D:\\Developers\\Repositories\\playfrommidi\\dist',
  PROJECT__DIST__name: 'dist',
  platform: 'win32',
  force_replace: false }
skipped to copy core module !
Core Modules Copied !
copying user app done.
User data copied
reading  D:\Developers\Repositories\playfrommidi\dist\app-debug\AndroidManifest.xml
User assets cleared
package name com.androidjs.mypkg
{ '$': { 'android:name': 'android.permission.INTERNET' } }
android.webkit.PermissionRequest
Done!
AndroidManifest updated!
changing app name D:\Developers\Repositories\playfrommidi\dist\app-debug\res\values\strings.xml
{ _: 'myapp', '$': { name: 'app_name' } }
App Name updated!
Icon updated!
Building...
(node:4672) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added. Use emitter.setMaxListeners() to increase limit
I: Using Apktool 2.4.0

I: Checking whether sources has changed...

I: Checking whether resources has changed...

I: Building resources...

build process exited with code 1
Build finished!
Sign apk
stderr: provided apk path or file 'D:\Developers\Repositories\playfrommidi\dist\app.apk' does not exist
stderr: 

stderr: java.lang.IllegalArgumentException: provided apk path or file 'D:\Developers\Repositories\playfrommidi\dist\app.apk' does not exist
stderr: 

stderr: 	at at.favre.tools.apksigner.ui.FileArgParser.parseAndSortUniqueFilesNonRecursive(FileArgParser.java:38)

stderr: 	at at.favre.tools.apksigner.SignTool.execute(SignTool.java:63)
	at at.favre.tools.apksigner.SignTool.mainExecute(SignTool.java:48)
	at at.favre.tools.apksigner.SignTool.main(SignTool.java:36)

stderr: 
Cmd history for debugging purpose:
-----------------------


sign process exited with code 1

The line 'build process exited with code 1'
I assume that means some error occured during the build process, however no info about the error is given.

from androidjs.

danbulant avatar danbulant commented on August 25, 2024

1.0.9 still the same error, looks like the build proces fails, but no error given

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

1.0.9 still the same error, looks like the build proces fails, but no error given

We didn't released 1.0.9 yet, How did you get that ?

from androidjs.

hacp0012 avatar hacp0012 commented on August 25, 2024

Plz help me when i want to build , i get this error msg :

/

> usr/lib/node_modules/androidjs-builder/node_modules/progress/lib/node-progress.js:55
>     if ('number' != typeof options.total) throw new Error('total required');
>                                           ^
> 
> Error: total required

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

Plz help me when i want to build , i get this error msg :

/

> usr/lib/node_modules/androidjs-builder/node_modules/progress/lib/node-progress.js:55
>     if ('number' != typeof options.total) throw new Error('total required');
>                                           ^
> 
> Error: total required

Run the build command again and make sure you are connected to internet, this error occurs sometimes when your internet connection is slow and get the payload with size 0 ; P

from androidjs.

annicet avatar annicet commented on August 25, 2024

Having the issue when i wnat to build the package:
Not a androidjs project

I am using version 2.0.2

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

Having the issue when i wnat to build the package:
Not a androidjs project

I am using version 2.0.2

Define project_type attribute in Package.json
Check out the docs

from androidjs.

SOFTWORLDIT avatar SOFTWORLDIT commented on August 25, 2024

C:\Users\USER\desktop\myapp> androidjs b -f
webview: androidjs
building
checking Core
https://github.com/android-js/androidjs-sdk/archive/master.zip
downloading sdk [ ======================================== ] 54041796/54345243 734553/bps 99% 0.4s done
extracting: https://github.com/android-js/androidjs-sdk to: C:\Users\USER.androidjs\androidjs-sdk
✔ done
copying Assets
copying from C:\Users\USER\desktop\myapp
to: C:\Users\USER.androidjs\androidjs-sdk\assets\myapp
[ 'C:\Users\USER\desktop\myapp\dist' ]

But I could not find dist directory in my "myapp"

from androidjs.

SOFTWORLDIT avatar SOFTWORLDIT commented on August 25, 2024

On rebuild: I had this

events.js:174
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, open 'C:\Users\USER\desktop\myapp\ '
Emitted 'error' event at:
at lazyFs.open (internal/fs/streams.js:115:12)
at FSReqWrap.args [as oncomplete] (fs.js:140:20)
PS C:\Users\USER\desktop\myapp>

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

On rebuild: I had this

events.js:174
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, open 'C:\Users\USER\desktop\myapp\ '
Emitted 'error' event at:
at lazyFs.open (internal/fs/streams.js:115:12)
at FSReqWrap.args [as oncomplete] (fs.js:140:20)
PS C:\Users\USER\desktop\myapp>

Looks like you don't have folder with name myapp on desktop
Please check that out first.

from androidjs.

SOFTWORLDIT avatar SOFTWORLDIT commented on August 25, 2024

My good brother, I have it sir.

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

My good brother, I have it sir.

Try to rebuild again and provide me full log.

from androidjs.

SOFTWORLDIT avatar SOFTWORLDIT commented on August 25, 2024

Screenshot_1

from androidjs.

SOFTWORLDIT avatar SOFTWORLDIT commented on August 25, 2024

C:\Users\USER\desktop\myapp> androidjs b -f
webview: androidjs
building
checking Core
using core C:\Users\USER.androidjs\androidjs-sdk
removing C:\Users\USER.androidjs\androidjs-sdk\assets\myapp/*
copying Assets
copying from C:\Users\USER\desktop\myapp
to: C:\Users\USER.androidjs\androidjs-sdk\assets\myapp
[ 'C:\Users\USER\desktop\myapp\dist' ]
changing icon
icons Updated
changing configuration
reading C:\Users\USER.androidjs\androidjs-sdk\AndroidManifest.xml
events.js:174
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, open 'C:\Users\USER\desktop\myapp\ '
Emitted 'error' event at:
at lazyFs.open (internal/fs/streams.js:115:12)
at FSReqWrap.args [as oncomplete] (fs.js:140:20)
PS C:\Users\USER\desktop\myapp>

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

C:\Users\USER\desktop\myapp> androidjs b -f
webview: androidjs
building
checking Core
using core C:\Users\USER.androidjs\androidjs-sdk
removing C:\Users\USER.androidjs\androidjs-sdk\assets\myapp/*
copying Assets
copying from C:\Users\USER\desktop\myapp
to: C:\Users\USER.androidjs\androidjs-sdk\assets\myapp
[ 'C:\Users\USER\desktop\myapp\dist' ]
changing icon
icons Updated
changing configuration
reading C:\Users\USER.androidjs\androidjs-sdk\AndroidManifest.xml
events.js:174
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, open 'C:\Users\USER\desktop\myapp\ '
Emitted 'error' event at:
at lazyFs.open (internal/fs/streams.js:115:12)
at FSReqWrap.args [as oncomplete] (fs.js:140:20)
PS C:\Users\USER\desktop\myapp>

Can you provide your package.json file

from androidjs.

SOFTWORLDIT avatar SOFTWORLDIT commented on August 25, 2024

{
"name": "androidjs",
"version": "2.0.1",
"description": "SOFTWORLD APPS",
"main": "index.js",
"project-type":"webview",
"icon":" ",
"app-name":"myapp ",
"package-name":"package.json",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"build": "node ./src/build.js"
},
"author": "Harendra Chhekur [email protected]",
"license": "MIT",
"dependencies": {
"@types/dom-mediacapture-record": "^1.0.1",
"@types/node": "^11.13.9",
"Buffer": "0.0.0",
"react-native": "^0.59.9",
"socket.io": "^2.2.0",
"socket.io-client": "^2.2.0",
"ts-loader": "^5.4.5",
"typescript": "^3.4.5",
"webpack": "^4.30.0",
"webpack-node-externals": "^1.7.2"
},
"repository": {
"type": "git",
"url": "https://github.com/android-js/androidjs"
},
"homepage": "https://android-js.github.io"
}

from androidjs.

SOFTWORLDIT avatar SOFTWORLDIT commented on August 25, 2024

I follow everything in your study class. I got to your page yesterday. I knew nothing about androidjs before until I met you

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

{
"name": "androidjs",
"version": "2.0.1",
"description": "SOFTWORLD APPS",
"main": "index.js",
"project-type":"webview",
"icon":" ",
"app-name":"myapp ",
"package-name":"package.json",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"build": "node ./src/build.js"
},
"author": "Harendra Chhekur [email protected]",
"license": "MIT",
"dependencies": {
"@types/dom-mediacapture-record": "^1.0.1",
"@types/node": "^11.13.9",
"Buffer": "0.0.0",
"react-native": "^0.59.9",
"socket.io": "^2.2.0",
"socket.io-client": "^2.2.0",
"ts-loader": "^5.4.5",
"typescript": "^3.4.5",
"webpack": "^4.30.0",
"webpack-node-externals": "^1.7.2"
},
"repository": {
"type": "git",
"url": "https://github.com/android-js/androidjs"
},
"homepage": "https://android-js.github.io"
}

There are lot's of mistakes in your package.json file that's why error occurs
Check out the documentation to fix all the configurations click here

from androidjs.

SOFTWORLDIT avatar SOFTWORLDIT commented on August 25, 2024

My brother, should I just copy and paste from this:
This is one of the scripts I found in the link. Do I need to edit the name,app-name and version?
{
"name": "myfirstapp",
"app-name" : "My First App",
"package-name": "myapp",
"permission": ["android.permission.INTERNET", "android.permission.SEND_SMS"],
"dist-path": "./dist",
"project-type":"webview",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC"
}

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

My brother, should I just copy and paste from this:
This is one of the scripts I found in the link. Do I need to edit the name,app-name and version?
{
"name": "myfirstapp",
"app-name" : "My First App",
"package-name": "myapp",
"permission": ["android.permission.INTERNET", "android.permission.SEND_SMS"],
"dist-path": "./dist",
"project-type":"webview",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC"
}

Yes, you can.
but make sure all the configurations are correct because there are 4 to 5 different sections of configuration and one more thing all the configurations are mandatory!

from androidjs.

SOFTWORLDIT avatar SOFTWORLDIT commented on August 25, 2024

I corrected the package.json to:
{
"name": "myfirstapp",
"app-name" : "MyFirstApp",
"package-name": "myapp",
"icon":"./assets/icon/network.png",
"permission": ["android.permission.INTERNET", "android.permission.SEND_SMS"],
"dist-path": "./dist",
"project-type":"webview",
"version": "2.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "Abu",
"license": "ISC"
}

AFTER REBUILD RESULT IS:

C:\Users\USER\desktop\myapp> androidjs b -f
webview: myfirstapp
building
checking Core
using core C:\Users\USER.androidjs\androidjs-sdk
removing C:\Users\USER.androidjs\androidjs-sdk\assets\myapp/*
copying Assets
copying from C:\Users\USER\desktop\myapp
to: C:\Users\USER.androidjs\androidjs-sdk\assets\myapp
[ 'C:\Users\USER\desktop\myapp\dist' ]
changing icon
icons Updated
changing configuration
reading C:\Users\USER.androidjs\androidjs-sdk\AndroidManifest.xml
{ manifest:
{ '$':
{ 'xmlns:android': 'http://schemas.android.com/apk/res/android',
package: 'com.android.js.webview',
platformBuildVersionCode: '28',
platformBuildVersionName: '9' },
'uses-permission':
[ [Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object] ],
application: [ [Object] ] } }
package name com.android.js.myapp
{ '$': { 'android:name': 'android.permission.INTERNET' } }
{ '$': { 'android:name': 'android.permission.SEND_SMS' } }
Done!
Updating C:\Users\USER.androidjs\androidjs-sdk\res\values\strings.xml
{ _: 'MyFirstApp', '$': { name: 'app_name' } }
Building APK
events.js:174
throw er; // Unhandled 'error' event
^

Error: spawn java ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

I corrected the package.json to:
{
"name": "myfirstapp",
"app-name" : "MyFirstApp",
"package-name": "myapp",
"icon":"./assets/icon/network.png",
"permission": ["android.permission.INTERNET", "android.permission.SEND_SMS"],
"dist-path": "./dist",
"project-type":"webview",
"version": "2.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "Abu",
"license": "ISC"
}

AFTER REBUILD RESULT IS:

C:\Users\USER\desktop\myapp> androidjs b -f
webview: myfirstapp
building
checking Core
using core C:\Users\USER.androidjs\androidjs-sdk
removing C:\Users\USER.androidjs\androidjs-sdk\assets\myapp/*
copying Assets
copying from C:\Users\USER\desktop\myapp
to: C:\Users\USER.androidjs\androidjs-sdk\assets\myapp
[ 'C:\Users\USER\desktop\myapp\dist' ]
changing icon
icons Updated
changing configuration
reading C:\Users\USER.androidjs\androidjs-sdk\AndroidManifest.xml
{ manifest:
{ '$':
{ 'xmlns:android': 'http://schemas.android.com/apk/res/android',
package: 'com.android.js.webview',
platformBuildVersionCode: '28',
platformBuildVersionName: '9' },
'uses-permission':
[ [Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object] ],
application: [ [Object] ] } }
package name com.android.js.myapp
{ '$': { 'android:name': 'android.permission.INTERNET' } }
{ '$': { 'android:name': 'android.permission.SEND_SMS' } }
Done!
Updating C:\Users\USER.androidjs\androidjs-sdk\res\values\strings.xml
{ _: 'MyFirstApp', '$': { name: 'app_name' } }
Building APK
events.js:174
throw er; // Unhandled 'error' event
^

Error: spawn java ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)

Kindly generate the project using CLI tool, it will automatically create a sample app with all configuration for you!

from androidjs.

SOFTWORLDIT avatar SOFTWORLDIT commented on August 25, 2024

Heeeeeee! brother! which one is CLI tool?

from androidjs.

Chhekur avatar Chhekur commented on August 25, 2024

Heeeeeee! brother! which one is CLI tool?

androidjs-builder check out the documentation click here

from androidjs.

RayanLA avatar RayanLA commented on August 25, 2024

Having the same issue stderr: provided apk path or file '...path-to-project\dist\app.apk' does not exist
but even for version androidjs 1.0.6 ...
please help o_O

from androidjs.

auxmall avatar auxmall commented on August 25, 2024

I am getting this problem can you help me

root@kali:~/Downloads/sample-app-master/music app# androidjs b -f
copying user app done.
User data copied
app core copied !
Core Modules Copied !
reading /root/Downloads/sample-app-master/music app/dist/app-debug/AndroidManifest.xml
package name com.androidjs.music
{ '$': { 'android:name': 'android.permission.INTERNET' } }
{
'$': { 'android:name': 'android.permission.WRITE_EXTERNAL_STORAGE' }
}
{ '$': { 'android:name': 'android.permission.READ_EXTERNAL_STORAGE' } }
Done!
AndroidManifest updated!
changing app name /root/Downloads/sample-app-master/music app/dist/app-debug/res/values/strings.xml
{ _: 'My Music', '$': { name: 'app_name' } }
App Name updated!
Icon updated!
Building...
(node:6983) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added to [ReadStream]. Use emitter.setMaxListeners() to increase limit
I: Using Apktool 2.4.0

I: Checking whether sources has changed...

I: Smaling smali folder into classes.dex...

I: Checking whether resources has changed...

I: Building resources...

build process exited with code 1
Build finished!
Sign apk
stderr: provided apk path or file '/root/Downloads/sample-app-master/music app/dist/app.apk' does not exist

stderr: java.lang.IllegalArgumentException: provided apk path or file '/root/Downloads/sample-app-master/music app/dist/app.apk' does not exist
at at.favre.tools.apksigner.ui.FileArgParser.parseAndSortUniqueFilesNonRecursive(FileArgParser.java:38)
at at.favre.tools.apksigner.SignTool.execute(SignTool.java:63)
at at.favre.tools.apksigner.SignTool.mainExecute(SignTool.java:48)
at at.favre.tools.apksigner.SignTool.main(SignTool.java:36)

stderr:
Cmd history for debugging purpose:

sign process exited with code 1

from androidjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.