-
-
Notifications
You must be signed in to change notification settings - Fork 24
Code Sharing Project does not build for Android #151
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
Comments
Hey @NickIliev, I'm not sure if it's related, but maybe it is.
Did run webpack upgrade sccript task.
PS1: the line that starts with "Unable to apply changes" occurs after some seconds of waiting for emulator to actually starts the app; |
@NickIliev I set those packages to the versions you specified and the android build still fails with |
@NickIliev Also I got this error: NPM could not find any package of 2.8.0 when I had that set |
This is the package.json I used that seems to be working fine for builds. Still though I I think the different teams should try to corrdinate better so we dont have these issues if possible.
|
@Lightk3ira the issue is now resolved and a new version of nativescript-schematics it published with the fix. Just update your nativescript-schematics versions and create new project. If you want to fix a project that was already created then bump the TypeScript version to 2.8.0 and above. Resolved via #146 |
I've updated the nativescript-schematics and Im getting the error below. Machine settings: TNS Vesion: 5 Package Version@angular-devkit/architect 0.10.3 ng new -c=@nativescript/schematics sharedTest --shared --style=scss ERROR --> <--- Last few GCs ---> [9208:000002741A5AD690] 272821 ms: Mark-sweep 1354.6 (1454.0) -> 1340.0 (1454.0) MB, 61.8 / 0.0 ms (average mu = 0.310, current mu = 0.282) allocation failure scavenge might not succeed <--- JS stacktrace ---> ==== JS stack trace ========================================= Security context: 0x0179acb1e6e1
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory |
@jfalmoguera, take a look at NativeScript/nativescript-cli#2756 and |
@Lightk3ira commented on Mon Nov 12 2018
Environment
√ Component nativescript has 5.0.0 version and is up to date.
‼ Update available for component tns-core-modules. Your current version is 4.2.1 and the latest available version is 5.0.2.
√ Component tns-android has 5.0.0 version and is up to date.
× Component tns-ios is not installed.
Operating System: Windows 10 PRO 64 BIT
OS Build: 17134.345
Processor: 3.4- ghz
Installed RAM: 16GB
CLI: @angular/cli": "^6.2.0
Cross-platform modules: 5.0.0
Android Runtime: 5.0.0
iOS Runtime: N/A
Plugin(s):
Describe the bug
The bug happens with a brand new code sharing project on android build. After creating a new code sharing project and running
tns run android -- bundle
or using Nativescript Sidekick the app with fail with errors in the terminal as well as shows logs and exceptions in mobile.To Reproduce
I Installed the latest Node and the NP
M. Android studio is installed on the computer with all SDK's.
Following the steps here
I ran the following commands:
npm i -g @angular/cli
2.
npm i -g @nativescript/schematics
ng new -c=@nativescript/schematics sass-project --shared --style=scss
cd sass-project
npm install
tns run android --bundle
I also tried using NativeScript Sidekick at step 6 on a different attempt.
I have also tried installing all packages to their latest using
@latest
I have also tried cloud building both from terminal using tns cloud run android --bundle as well as using the NativeScript Sidekick.
Expected behavior
As This tutorial shows how to create a new Angular Web and Mobile application template I would assume that Web, Android, and iOS will all build out of the box.
Sample project
For the attached project folder I deleted the
node_modules
as the folder size made it too large to upload.Additional context
I have tried to run this tutorial and get a working android build for development for a few days now. I have tried on 2 Windows computers both running Windows 10. as well as 1 Macbook running High Sierra version 10.13.6
Terminal Logs:
ERROR in node_modules/@types/jasmine/index.d.ts(138,47): error TS1005: ';' expected.
node_modules/@types/jasmine/index.d.ts(138,90): error TS1005: '(' expected.
node_modules/@types/jasmine/index.d.ts(138,104): error TS1005: ']' expected.
node_modules/@types/jasmine/index.d.ts(138,112): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,113): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(138,121): error TS1005: ')' expected.
node_modules/@types/jasmine/index.d.ts(138,147): error TS1005: '(' expected.
node_modules/@types/jasmine/index.d.ts(138,162): error TS1005: ']' expected.
node_modules/@types/jasmine/index.d.ts(138,163): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,164): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(138,165): error TS1136: Property assignment expected.
node_modules/@types/jasmine/index.d.ts(138,179): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,183): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(138,208): error TS1005: '{' expected.
node_modules/@types/jasmine/index.d.ts(138,217): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(138,222): error TS1005: ',' expected.
node_modules/@types/jasmine/index.d.ts(138,227): error TS1005: ':' expected.
node_modules/@types/jasmine/index.d.ts(138,228): error TS1109: Expression expected.
node_modules/@types/jasmine/index.d.ts(138,230): error TS1005: ')' expected.
Webpack compilation complete. Watching for file changes.
Webpack build done!
Mobile Device Crash:
sass-project.zip
@petplan-Pat commented on Mon Nov 12 2018
same
System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.codeSharing/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: System.err: Calling js method onCreate failed System.err: System.err: TypeError: Cannot read property 'create' of undefined System.err: File: "file:///data/data/org.nativescript.codeSharing/files/app/vendor.js, line: 12284, column: 14 System.err: System.err: StackTrace: System.err: Frame: function:'', file:'file:///data/data/org.nativescript.codeSharing/files/app/vendor.js', line: 12284, column: 15
@skopekreep commented on Tue Nov 13 2018
After digging for a while with the same issue I found the following that seems to resolve the issue.
According to this thread the reason for the @types/jasmine errors that @Lightk3ira posted above is that "@types/jasmine": "~2.8.6" updates to 2.8.11, which is incompatible with Typescript 2.7.
After changing
"@types/jasmine": "~2.8.6"
to
"@types/jasmine": "2.8.6"
to pin the version to 2.8.6 the app ran as expected.Note that this also fixes the same errors that appeared during an iOS build with 2.8.11.
@Lightk3ira commented on Tue Nov 13 2018
That is the version the nativescript and angular team had in their code sharing project. If that is the issue then they did not test that updating the packages did not break anything.
@Lightk3ira commented on Tue Nov 13 2018
As well as Jasmine is just a testing framework. That should not have anything to do with the on create failrue. Will test and see
@skopekreep commented on Tue Nov 13 2018
The breaking change is with @types/jasmine, which only happened 7 days ago (see version history). According to the thread linked in my previous post, one of the updates to the package requires Typescript > 2.7.2. Arguably, per semver guidelines, this was a breaking change and should have been named something like 3.0.0 instead of 2.8.x.
Now, why exactly this leads to the error about "create failure", I'm not completely sure, but it is a typescript error that exists prior to building. I'll defer to someone more familiar with the inner workings of NS.
@NickIliev commented on Tue Nov 13 2018
@Lightk3ira @skopekreep thank you guys for bringing this one into our attention. The issue is already addressed via this PR and will be fixed with the upcoming version of nativescript-schematics.
Meanwhile, if you want to address and fix the issue in already create shared projects then open the package.json and bump the versions of
typescript
to~2.8.0
or abovetns-core-modules
to5.0.2
nativescript-dev-webpack
to0.17.0
and then update the config files via the upgrade scriptThe text was updated successfully, but these errors were encountered: