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

How to run? Exact steps for noob #1

Closed
pleerock opened this issue Sep 27, 2017 · 18 comments
Closed

How to run? Exact steps for noob #1

pleerock opened this issue Sep 27, 2017 · 18 comments

Comments

@pleerock
Copy link
Member

Last time Ive worked with cordova 3-4 years ago. Can you please provide exact steps so just any noob like me can try this example?

  1. I did npm i cordova -g
  2. I installed plugin: cordova plugin add cordova-sqlite-storage --save
  3. Im trying to run cordova platform add android but it gives me following error:
$ cordova platform add android
Using cordova-fetch for cordova-android@^6.2.3
Adding android project...
Error: Error validating package name. Package name must look like: com.company.Name

Also readme tells me to do:

  1. copy Reflect.js and system.src.js from the node_modules folder into the lib folder

right after npm i and tsc, however I don't have "lib" directory after doing those steps.

@daniel-lang
Copy link
Contributor

I messed the App-ID up. Step 2 is not necessary and step 3 should work now. I also included the lib folder in this repository and updated the README.

@pleerock
Copy link
Member Author

Oh looks like its inside /www directory

@daniel-lang
Copy link
Contributor

Oh yeah, sorry, i will change the README

@pleerock
Copy link
Member Author

pleerock commented Sep 27, 2017

ahh Im handing over an hour trying to figure out current problem. App is running okay however screen is empty. It fails on a first System call. Ive fixed wrong paths:

        <script type="text/javascript" src="lib/typeorm/Reflect.js"></script>
        <script type="text/javascript" src="lib/typeorm/system.src.js"></script>

But problem remains, still trying to figure out a problem. BTW how can I run app and see results of console.log in terminal?

@daniel-lang
Copy link
Contributor

I'm sorry to hear, that the example doesn't work for you.
The paths should be fine if you copy Reflect.js and system.src.js into the www/lib folder.
There is how you can inspect android and iOS.

@pleerock
Copy link
Member Author

Okay I found the way how to print things.

@pleerock
Copy link
Member Author

I don't think its something with me =)

@pleerock
Copy link
Member Author

document.addEventListener("deviceready", function () {
    document.writeln("Hello world");
    console.log("Reflect:");
    console.log(Reflect);
    console.log("System:");
    console.log(System);
    console.log("-----");

prints me:

09-27 09:00:45.845: I/chromium(3782): [INFO:CONSOLE(4)] "Reflect:", source: file:///android_asset/www/lib/typeorm/script.js (4)
09-27 09:00:45.855: D/SystemWebChromeClient(3782): file:///android_asset/www/lib/typeorm/script.js: Line 5 : [object Object]
09-27 09:00:45.855: I/chromium(3782): [INFO:CONSOLE(5)] "[object Object]", source: file:///android_asset/www/lib/typeorm/script.js (5)
09-27 09:00:45.855: D/SystemWebChromeClient(3782): file:///android_asset/www/lib/typeorm/script.js: Line 6 : System:
09-27 09:00:45.865: I/chromium(3782): [INFO:CONSOLE(6)] "System:", source: file:///android_asset/www/lib/typeorm/script.js (6)
09-27 09:00:45.905: D/SystemWebChromeClient(3782): file:///android_asset/www/lib/typeorm/script.js: Line 7 : Uncaught ReferenceError: System is not defined
09-27 09:00:45.915: I/chromium(3782): [INFO:CONSOLE(7)] "Uncaught ReferenceError: System is not defined", source: file:///android_asset/www/lib/typeorm/script.js (7)

@pleerock
Copy link
Member Author

Okay maybe console.log Reflect isnt a good idea because this object is already presents in javascript even without reflect metadata... But the fact is that it does not see systemjs's System for some reason

@pleerock
Copy link
Member Author

Im giving up. Did you actually run this example? Because I found bugs and it obviously cannot be run with them. Please check this example on your machine

@daniel-lang
Copy link
Contributor

I haven't for a while

@daniel-lang
Copy link
Contributor

I updated the example to the newest version of TypeORM. The screenshot below is from my Moto G5 running Android 7.0 and the app was created using cordova 7.0.1
screenshot_20170927-155754

@pleerock
Copy link
Member Author

Okay I just pulled and still have a problem. I guess its something with my emulator. I'll try to install android 7 emulator

@daniel-lang
Copy link
Contributor

What version are you running in the emulator?

@pleerock
Copy link
Member Author

4.4.x

@daniel-lang
Copy link
Contributor

Can I close this issue? And do you think it's a good idea to include the libraries in the www/lib folder?

@pleerock
Copy link
Member Author

pleerock commented Oct 3, 2017

I downloaded and tried 7 emulator but it crashes all the time. I don't know why. Im going to download another emulator and check it before closing this issue.

And do you think it's a good idea to include the libraries in the www/lib folder?

No, I don't think so, it does not look as a good idea.

Also, when are you be able to setup ionic example? Im planning to make a final release today or tomorrow and publish links on reddit, it will be really great if we'll have ionic example for those who are interested in it.

@daniel-lang
Copy link
Contributor

Ionic example is online
And the libraries are removed

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