Giter Site home page Giter Site logo

android-snapshot's Introduction

NativeScript

Automated Android Tests Passing Automated iOS Tests Passing License NPM Version Discord FOSSA Status website https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg support

NativeScript empowers you to access native APIs from JavaScript directly. Currently iOS, Android, and visionOS runtimes are provided for rich mobile development across a variety of diverse use cases.

FOSSA Status

Contribute

  1. Setup your local development environment

  2. Clone to 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 pull requests ๐Ÿค—. Please follow our contributing guide and see our code of governance to become as involved as you want to be.

@nativescript/*

Quick Links

Other source repos

Outside the source centralized in this repo, NativeScript consists of a few other source repos. Here are the major ones:

  • iOS and visionOS Runtime Empowers JavaScript code to be executed on iOS and visionOS devices written in a mix of C++, Objective-C, and Swift.
  • Android Runtime Empowers JavaScript code to be executed on Android devices written in a mix of C++, Java and Kotlin.
  • CLI Command-line interface empowering you to create, build, and run apps using NativeScript.
  • Docs Documentation available at http://docs.nativescript.org/ written in Markdown.
  • Plugins Various TSC managed plugins. Also a good reference is the plugin marketplace with several additional plugins.
  • Firebase Modular Firebase ๐Ÿ”ฅ implementation for supported platforms.
  • ML Kit Google's ML Kit SDKs for supported platforms.
  • Payments In-App Purchase, Subscriptions, Google Pay and Apple Pay.
  • Artwork Want to use our logo or colors? Feel free to use any of our ready-to-use media material.

Copyright notice

Copyright OpenJS Foundation and NativeScript contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarksโ„ข or registeredยฎ trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.

The OpenJS Foundation | Terms of Use | Privacy Policy | OpenJS Foundation Bylaws | Trademark Policy | Trademark List | Cookie Policy

Made with โค๏ธ

android-snapshot's People

Contributors

blagoev avatar dtopuzov avatar hdeshev avatar ivanbuhov avatar jasssonpet avatar kristinakoeva avatar plamen5kov avatar rosen-vladimirov avatar sis0k0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-snapshot's Issues

Snapshot fails the build if there are unsatisfied peerDependencies

Steps to reproduce:

tns create NGApp --ng
export TNS_ANDROID_SNAPSHOT=1
tns build android --path NGApp -> everthing is fine
cd NGApp 
npm i [email protected] --save-dev
cd ..
tns build android --path NGApp -> fail

Log:

Project successfully prepared (android)
Executing after-prepare hook from /Users/nsbuilduser/workspace/nativescript-ui-release-sdkAngular-android/NGApp/hooks/after-prepare/nativescript-dev-android-snapshot.js
ENOENT: no such file or directory, open '/Users/nsbuilduser/workspace/nativescript-ui-release-sdkAngular-android/NGApp/node_modules/nativescript-angular-snapshot/platform

Actually the problem is caused because when we have unsatisfied peer dependency npm ls --json <some-package> return output that we do not expect.
See: https://github.com/NativeScript/android-snapshot/blob/master/plugin/hooks/common.js#L95

Automate v8 version update

Currently the version is hardcoded in common.js file. We need to be able to automate this as much as possible. The final goal is to be able to download on the developer machine the correct snapshot for the current project's runtime version. Most probably we need to have the v8 version available somewhere in the project template.

Here's an example how we can output the correct v8 version from a build script:

$ echo '#include <stdio.h>\n#include "v8-version.h"\nint main() { printf("%d.%d.%d\\n", V8_MAJOR_VERSION, V8_MINOR_VERSION, V8_BUILD_NUMBER); }' | clang -xc - && ./a.out
$ 5.2.361

Crash using Angular + NS 2.5

Hello,

When installing nativescript-dev-android-snapshot and running tns run android --release my app crashes immediately. My package.json has:

"nativescript": {
"tns-android": {
"version": "2.5.0"
}
},
"dependencies": {
"@angular/common": "2.4.3",
"@angular/compiler": "2.4.3",
"@angular/core": "2.4.3",
"@angular/forms": "2.4.3",
"@angular/http": "2.4.3",
"@angular/platform-browser": "2.4.3",
"@angular/platform-browser-dynamic": "2.4.3",
"@angular/router": "3.4.3",
"nativescript-advanced-webview": "^1.1.3",
"nativescript-angular": "^1.4.0",
"nativescript-dev-webpack": "^0.3.3",
"nativescript-hook": "^0.2.1",
"nativescript-loading-indicator": "^2.2.2",
"nativescript-pulltorefresh": "^1.1.10",
"nativescript-snackbar": "^1.1.6",
"nativescript-telerik-ui": "^1.6.0-2017.2.13.3",
"nativescript-theme-core": "^0.2.1",
"nativescript-toast": "^1.4.5",
"nativescript-web-image-cache": "^2.1.1",
"nativescript-youtubesdk": "0.0.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.0.2",
"tns-core-modules": "^2.5.0",
"zone.js": "^0.7.2"
}

Would this be an issue with not compatible nativescript-angular and tns-core-modules versions?

After-prepare fails if no <app name>/app/package.json file available

After-prepare hook of nativescript-dev-android-snapshot fails to execute if there is no <app name>/app/package.json file available.

Might be it is a good idea to add a simple package.json file in such scenario?

Project successfully prepared
Executing after-prepare hook from /Users/vchimev/Work/master/appTest/hooks/after-prepare/nativescript-dev-android-snapshot.js
ENOENT: no such file or directory, open '/Users/vchimev/Work/master/appTest/platforms/android/src/main/assets/app/package.json'

Snapshot plugin immediate crash with newest NS version

Hi there,

We were updating our Project to angular 2.1.2 and angular/router 3.1.2 and nativescript-angular 1.1.2 and also switched to the @next version of NativeScript.

My tns info output:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Component โ”‚ Current version โ”‚ Latest version โ”‚ Information โ”‚
โ”‚ nativescript โ”‚ 2.5.0-2016-10-31-6971 โ”‚ 2.3.0 โ”‚ Up to date โ”‚
โ”‚ tns-core-modules โ”‚ 2.5.0-2016-10-31-4629 โ”‚ 2.3.0 โ”‚ Up to date โ”‚
โ”‚ tns-android โ”‚ 2.5.0-next-2016-10-31-1332 โ”‚ 2.3.0 โ”‚ Up to date โ”‚
โ”‚ tns-ios โ”‚ 2.5.0-2016-10-31-1 โ”‚ 2.3.0 โ”‚ Up to date โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The problem is easily reproducible by doing the following:

  1. tns create mySnapshotSampleApp --ng
  2. tns platform add android
  3. Open package.json and specify tns-android version as "next" and add tns-core-modules dependency with version "next"
  4. tns install android-snapshot
  5. Try to get the project running with android-snapshot, it'll always crash immediately

Additional info: This behaviour is reproducible in the following combination (I just tested it on a sample project):

  • NativeScript@next + @angular 2.1.2 and nativescript-angular 1.1.2
  • NativeScript@next + @angular 2.0.0 and nativescript-angular 1.0.1
  • NativeScript 2.3 + @angular 2.1.2 and nativescript-angular 1.1.2

My package.json for the sample project:
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN ",
"readme": "NativeScript Application",
"repository": "",
"nativescript": {
"id": "org.nativescript.MySampleApp",
"tns-ios": {
"version": "2.5.0-2016-10-31-1"
},
"tns-android": {
"version": "2.5.0-next-2016-10-31-1332"
}
},
"dependencies": {
"@angular/common": "2.1.2",
"@angular/compiler": "2.1.2",
"@angular/core": "2.1.2",
"@angular/forms": "2.1.2",
"@angular/http": "2.1.2",
"@angular/platform-browser": "2.1.2",
"@angular/platform-browser-dynamic": "2.1.2",
"@angular/router": "3.1.2",
"nativescript-angular": "1.1.2",
"nativescript-theme-core": "^0.1.3",
"reflect-metadata": "~0.1.8",
"rxjs": "5.0.0-beta.12",
"tns-core-modules": "next"
},
"devDependencies": {
"babel-traverse": "6.18.0",
"babel-types": "6.18.0",
"babylon": "6.13.1",
"lazy": "1.0.11",
"nativescript-dev-android-snapshot": "0.0.2",
"nativescript-dev-typescript": "^0.3.2",
"nativescript-dev-webpack": "0.0.20",
"typescript": "^2.0.6",
"zone.js": "~0.6.21"
}
}

Nativescript 2.4, Angular 2, Sample-Groceries: snapshot not found

Building the Sample Geoceries (angular-end branch) with NativeScript 2.4.0, the build process shows errors of snapshots not found, although the end app runs fine on Android, with start-up time with no speedup from what snapshot may provide.

Installing the snapshot plug in, following the instructions, and then try to build the Sample Groceries app, the following errors are show in the build log:

$ tns run android
Executing before-prepare hook from /home/atai/native_script_work/sample-Groceries.git/hooks/before-prepare/nativescript-dev-android-snapshot.js
Required heap snapshot package is not installed. Installing "[email protected]".
Could not find package "[email protected]" in the registry.
Build will now continue without using heap snapshots ...

the build system is Fedora 24 x86-64

NS 2.5 + NG2 'No such file or directory bundle.records.json'. Snapshot not installed

Hey there,

I'm struggling getting android-snapshot working again with NS 2.5.

tns info:

โ”‚ Component        โ”‚ Current version โ”‚ Latest version โ”‚ Information โ”‚
โ”‚ nativescript     โ”‚ 2.5.0           โ”‚ 2.5.0          โ”‚ Up to date  โ”‚
โ”‚ tns-core-modules โ”‚ 2.5.0           โ”‚ 2.5.0          โ”‚ Up to date  โ”‚
โ”‚ tns-android      โ”‚ 2.5.0           โ”‚ 2.5.0          โ”‚ Up to date  โ”‚
โ”‚ tns-ios          โ”‚ 2.5.0           โ”‚ 2.5.0          โ”‚ Up to date  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Angular Dependencies at version 2.4.3, 3.4.3 (router) and 1.4.0 for nativescript-angular
Snapshot depdendency: "nativescript-dev-android-snapshot": "0.0.6"

I already tried uninstalling, clean building and reinstalling and clean building (by rm -rf node_modules/ platforms/ && tns install && tns prepare android && tns run android) but I always face this error:

ENOENT: no such file or directory, open '/Users/myUser/Documents/Development/experimental/nativescript-poc/node_modules/nativescript-angular-snapshot/platforms/android-snapshot-files/bundle.records.json'

but nativescript-angular-snapshot' doesn't even get installed so it clearly won't find the bundle.records.json

I cannot even get it working in a freshly created sample application. Do you have any idea? Is it my computer :P?

Required heap snapshot package is not installed. Installing "[email protected]".

Hello,

I cannot use android snapshot with angular. it needs a component that cannot be installed.

I have android 2.1.1
Native script 2.3
Android platform 2.3

Required heap snapshot package is not installed. Installing "[email protected]".
Could not find package "[email protected]" in the registry.
You can install it manually or remove the "nativescript-dev-android-snapshot" plugin and continue building without heap snapshots.

Best regards

Local MacOS/Linux snapshot generation

  • Build mksnapshot tools for MacOS X
  • Refactor (rewrite) the whole plugin to build snapshots locally instead of downloading pre-build packages
  • Enable generation of .so files instead of .blobs in case the user has Android NDK locally installed.
  • Handle gracefully webpack/snapshot errors. Rebuild mksnapshot tools to log on the console in case of JS error.
  • Remove the webpack bundle generation from the snapshot package.
  • Refactor/move the snapshot generation logic as next step after the nativescript-dev-webpack bundling step (probably as a webpack plugin). Snapshot package is using webpack 1.2, nativescript-dev-webpack is using > 2.0, so this may require some additional effort. The snapshot should be generated from a single webpack bundle produced by the nativescript-dev-webpackplugin.
  • Provide an easy to use snapshot configuration mechanism.
    • Making a webpack bundle snapshottable requires some manual changes of its webpack config file. Ideally we will handle these changes automatically
  • Introduce continuous integration builds.
  • Linux support
  • Documentation

Error in hook

I'm following the tutorial nativescript app and instructions here but it fails on tns build android. Using node v6.3.1 on Fedora Linux. Can't quite figure out where the error even is since that file is just a require.

Executing after-prepare hook from /home/david/Projects/ns/sample-Groceries/hooks/after-prepare/nativescript-dev-android-snapshot.js
Unexpected token 
 in JSON at position 130

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.