NativeScript empowers you to access native APIs from JavaScript directly. The framework currently provides iOS and Android runtimes for rich mobile development and can be utilized in a number of diverse use cases.
Setup and Installation
Contribute
$ git clone https://github.com/NativeScript/NativeScript.git
$ cd NativeScript
# setup workspace for development
$ npm run setup
# list all available commands to run
$ npm start
We love you and your PR's
@nativescript/*
- @nativescript/core
- Core iOS/Android for NativeScript
- @nativescript/types
- Types for both iOS/Android below wrapped up as a convenience. Most commonly used.
- @nativescript/types-ios
- Types for iOS
- @nativescript/types-android
- Types for Android
- @nativescript/ui-mobile-base
- UI mobile base native classes used by core
- @nativescript/webpack
- Webpack build utilities and configs used by NativeScript apps
Quick Links
- NativeScript home page
- NativeScript playground
- NativeScript and Angular
- NativeScript on Twitter
- NativeScript on Stack Overflow
- NativeScript documentation
Other source repos
Outside the source centralized in this repo, NativeScript consists of a few other source repos. Here are the major ones:
- iOS runtime
- Android runtime
- CLI
- Docs
- This repo contains the NativeScript framework documentation, which is available at http://docs.nativescript.org/. The docs are written in Markdown.
Implement CSS Box Shadow
Would be great to see a CSS3 style box shadow for UI elements.
Possible implementation:
box-shadow: none|h-shadow v-shadow blur spread color |inset|initial|inherit;
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
🚨 XCode 12 Status
Update (09/27):
We have released
[email protected]
with additional fixes for running on a real device.Details in this PR: https://github.com/NativeScript/ios-device-lib/pull/70
Update (09/23):
We have released
[email protected]
with fixes for running on a real device. This version reverted some changes fromrc.0
- we expect this to run fine for both simulators and devices, however there may be other cases we need to take into account. Please try the latest RC (ideally revert manual changes in Podfiles, build configs etc and runns clean
) and if something isn't working, re-run with--log trace
enable and share the logs with us.We released
[email protected]
that should allow building nativescript apps for the simulator using XCode12.Please try it
And then cleaning your project (
ns clean
) and re-running it. The apps should build successfully, and deploy to the simulator(s). If this works for you, consider leaving a 👍 on this issue to let us know - and if it fails to build/run leave a comment with the output logs (re-run the build with--log trace
to get more verbose logs).Known issues:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0
- this is a warning, that should not cause any issues with the build. If the build fails, it's likely related to another issue.--release
(and--env.production
) not able to build the app. [Should Be OK in RC1]CFBundleName
the cli will fail withNo .ipa found in /.../platforms/ios/build/Debug-iphoneos directory..
[Looking into a fix]Related issues:
Move JS Processing to background thread or allow creation of other WebWorkers/Threads
From what I understand everything runs on the primary thread. So this is a feature request -- but if done possible sooner would eliminate any later incompatibilities. Having the main thread run the interface and JS runtimes means that hiccups can and will occur frequently. Either the design where the interface is run on its own thread; and the engine is on its own or the ability to start webworks will eliminate these types of issues where you need to do any long running calculations.
Please vote for this feature in our ideas portal.
Security for the JS code
Think of ways to IP protection of the JavaScript which is packaged in the app packages.
If you are interested in this feature please leave comment here and vote for this issue in our ideas portal.
Error in properties.js from tns-core-modules
I upgraded my app from {N} v2.something to v3.0 and now I have an error inside the tns-core-modules (which I also updated to 3.0.0).
Here is what I think is the relevant part:
You can find the full stack-trace on PasteBin
I can realize that I've messed up, as the defaul HelloWorld app works, until I replace it with my code, but I have no clue where to start investigating.
It looks CSS related from snooping inside the code, but I have no CSS other than an empty module css and the default app.css.
iOS 14 and Nativescript
Hello,
Has anyone been able to run their Nativescript on iOS 14? Running
"tns-ios": { "version": "6.5.1" }
does not work with iOS 14.
Running it in XCode 12 showed the error in main.m
[runtime executeModule:@"./"]; Thread 1: EXC_BAD_ACCESS (code=1, address=0x2818dd0)
Any ideas on how to resolve this issue?
Allow borders to be applied on a per-side basis in CSS
I'm finding that I frequently need to put a border on one side of a UI component, but NativeScript currently does not support this. I'm requesting that the following CSS properties be added:
border-top-width
border-top-color
border-right-width
border-right-color
border-bottom-width
border-bottom-color
border-left-width
border-left-color
To be consistent with CSS, I would also like the
border-width
andborder-color
shorthands to work like they do in CSS.Thanks.
Page Navigation Transitions
Would be great to be able to customise the transitions between pages. Right now it's either animation or no animation. Both Android and iOS support custom transistions.
[MacOS] build android failed on app:mergeDebugAssets (unable to create new native thread)
Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?
Yes
Tell us about the problem
tns build android failed on ':app:mergeDebugAssets' > unable to create new native thread
Which platform(s) does your issue occur on?
Android development on macOS Sierra
Please provide the following version numbers that your issue occurs with:
node_modules/tns-core-modules/package.json
file in your project)"tns-android"
and"tns-ios"
properties in thepackage.json
file of your project)package.json
file of your project) No pluginPlease tell us how to recreate the issue in as much detail as possible.
I just run
tns create sample-project --template tns-template-tab-navigation-ng
, then runtns build android
and the error mentioned above appeared*note: run
tns debug android --bundle
completed without errortns doctor output
tns debug android --log trace, output attached trace.log.zip
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
No
Feature Request: Paged Slider UI component
There is currently no abstraction for a "paged slider" component (not sure if there's a better name for it). It's where you can scroll horizontally between 'pages' of content, with your position indicated by dots below.
You can see an example of this on the iOS home screen:
change the outDir of the transpiled code
I don't like the
js
files being generated next to myts
/ng
files , it's so annoying , so I was trying to put thecompiled/transpiled
js
files outside theapp
directory, as anyAngular
app.what I did is :
I added
outDir
to thecompilerOptions
inside thetsconfig.json
fileand changed the
main
entrypoint
insideapp/package.json
by doing so the app crashes since it can't find the
main.js
...what is the correct way to achieve that?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Can launch the project with android emilator
Issue Description
I create a new nativescript project and launched tns run android commande but I get this erro
I didn't modify anything in the new project and tns doctor doesn't return any error
does anyone has an idea?
Reproduction
No response
Relevant log output (if applicable)
No response
Environment
No response
Please accept these terms
feat(core): new autoFillTypes
Add new autoFillTypes:
oneTimeCode
on android i choseAUTOFILL_HINT_2FA_APP_OTP
but there is also sms and email otp. Not 100% sure which one to chooseUITextContentTypeNewPassword
was added in iOS 12. Do we need a check for ios version?Error: Build input file cannot be found, when building NativeScript application with Xcode 14.1 using m1 mac
Issue Description
When building nativescript cross-platform application for ios, i get the following error.
Build input file cannot be found: 'xxx/platforms/ios/Build/Products/Debug-iphonesimulator/metadata-arm64.bin'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
Reproduction
xcode 14.1 ✔ Component nativescript has 8.4.0 version and is up to date. ✔ Component @nativescript/core has 8.4.1 version and is up to date. ✔ Component @nativescript/ios has 8.4.0 version and is up to date.
i would be very grateful for help and a way out of this
Relevant log output (if applicable)
No response
Environment
No response
Please accept these terms
iOS: When execute more than one animation it is not canceled
Issue Description
When you run an animation and then run another on the same element on ios the first animation is not cancelled. In android it works fine, my animations types:
Reproduction
No response
Relevant log output (if applicable)
No response
Environment
Dependencies
Please accept these terms
fix(webpack): notify CLI even if there are compilation errors
PR Checklist
What is the current behavior?
When there's a compilation error, webpack may emit files (depending on how it's configured), however the CLI is never notified of these files, so they are not synced to the device. This is generally the right behavior however there are cases where this isn't ideal, most notably with HMR. When there's a compilation error, a new hash is assigned to the compilation, and files are written but never synced. After fixing the error, yet another hash is generated, however the app will not be able to apply hmr because it must first apply the "errored" hash, and then the fixed one - it works like a sequential chain, and if we don't emit the errored chain links, we break HMR.
What is the new behavior?
The CLI is notified regardless of errors in the compilation. This may crash the app - however that's expected in some cases. In other cases this should fix HMR breakage after a single error during development.
References: