Giter Club home page Giter Club logo

plugins's Introduction

How to use?

This workspace manages the suite of plugins listed above.

Prerequisites

  • Node 18+ is recommended
  • yarn v1 is required

In general, when in doubt with what to do, just npm start.

npm run setup
npm start

// Ensure all plugins build properly first
> type "build-all" (and hit ENTER)

If you don't build all the plugins, you will at least need to build localize to run the demos because it contains hooks that need to be built first.

If building only localize, type: npm start > localize (this will narrow down menu to @nativescript.localize.build) and then hit 'enter'. You can now run the demo apps.

In general, when in doubt with what to do, just npm start.

How to add a new package to workspace?

npm run add

At the prompt, enter the name of the new package.

  • This adds a plugin harness in packages with the necessary boilerplate to just start developing
  • Updates all demo app flavors to support demoing the new package
  • Adds shared code in tools/demo where you can write demo code once and share across all demo flavors
  • Updates build tooling to support the new package
  • Updates the npm start interactive display
  • Updates the README here to list the new package

How to add Angular compatibility to a package

npm run add-angular

At the prompt, enter the name of the package to add an angular folder to it with the necessary boilerplate to provide Angular support to the package.

How to focus on just 1 package to develop in isolation

npm start
  • Choose the focus commands for the package you wish to focus on and hit enter.
  • All the demo app's will be updated to isolate that 1 package and for supported IDE's (currently VS Code), the source code will also become isolated in the workspace.

Note: good to always clean the demo you plan to run after focusing. (You can clean any demo from npm start as well)

How to publish packages?

npm run publish-packages
  • You will be prompted for the package names to publish. Leaving blank and hitting enter will publish them all.
  • You will then be prompted for the version to use. Leaving blank will auto bump the patch version (it also handles prerelease types like alpha, beta, rc, etc. - It even auto tags the corresponding prelease type on npm).
  • You will then be given a brief sanity check ๐Ÿง ๐Ÿ˜Š

Made with โค๏ธ

plugins's People

Contributors

agonper avatar alexander-mai avatar asharghi avatar boutier avatar bradmartin avatar captainhaddockfr35 avatar catchabus avatar davecoffin avatar edusperoni avatar felixkrautschuk avatar grigala avatar guillemc23 avatar herefishyfish avatar jamescodesthings avatar janoshrubos avatar jcassidyav avatar keerl avatar kefahb avatar lekhmanrus avatar mrsnoozles avatar mukaschultze avatar nathanwalker avatar ombuweb avatar peterstaev avatar rigor789 avatar rob4226 avatar siewedu avatar triniwiz avatar vallemar avatar wdrai avatar

Stargazers

 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

plugins's Issues

[@nativescript/datetimepicker] Exception on Android with NS7 and v2.0.4

From NativeScript/nativescript-datetimepicker#77:

If the demo apps cannot help and there is no issue for your problem, tell us about it

I get the following exception when trying to load the date picker on Android using NS7 and @nativescript/[email protected] (and @2.0.4). The picker never displays.

I have a TextField with an tap listener getDate that calls:

DateTimePicker.pickDate({
  maxDate: new Date(),
  date: startingDate,
})
.then((res) => {...});

Exception

Exception has occurred: Error
_createNativeDatePicker(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:51160:22)
	at (/Users/user/websites/test/picker/platforms/android/app/src/main/assets/app/vendor.js:51117:48)
	at pickDate(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:51108:22)
	at getDate(file:///data/user/0/org.nativescript.picker/files/app/bundle.js:77:83)
	at invokeWithErrorHandling(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:64687:26)
	at invoker(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:65392:14)
	at _executeCallback(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:31043:23)
	at TapAndDoubleTapGestureListenerImpl._handleSingleTap(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:30711:11)
	at TapAndDoubleTapGestureListenerImpl.onSingleTapUp(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:30670:12)
	at androidOnTouchEvent(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:30961:35)
	at (/Users/user/websites/test/picker/platforms/android/app/src/main/assets/app/vendor.js:23144:18)
	at handleGestureTouch(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:23143:12)
	at TouchListenerImpl.onTouch(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:22817:13)

This works fine on NS7 iOS14

Which platform(s) does your issue occur on?

  • Android 10 emulator

Please, provide the following version numbers that your issue occurs with:

  • CLI: 7.0.8
  • Cross-platform modules: 7.0.9
  • Runtime(s): 7.0.0 (android)
  • Plugin(s):
  "dependencies": {
    "@nativescript/core": "~7.0.9",
    "@nativescript/datetimepicker": "^2.0.3",
    "@nativescript/theme": "~2.3.0",
    "nativescript-vue": "~2.8.1"
  },
  "devDependencies": {
    "@babel/core": "~7.11.6",
    "@babel/preset-env": "~7.11.5",
    "@nativescript/android": "7.0.0",
    "@nativescript/webpack": "~3.0.3",
    "babel-loader": "~8.1.0",
    "nativescript-vue-template-compiler": "~2.8.1",
    "node-sass": "^4.14.1",
    "vue-loader": "~15.9.3"
  },

Please, tell us how to recreate the issue in as much detail as possible.

I created a new project (ns create picker --vue) and added a TextField with an onTap handler called getDate. Run the debugger on the app, monitor All Exceptions, then tap the TextField. You should see the error. I've attached the minimal test project.

[@nativescript/background-http] iOS 14 compatibility

I am having an issue with iOS 14 where if I try to upload multiple files the app crashes, I was able to verify and the images are being uploaded, but looks like the app crashes when it tries to execute the events:

task.on("progress", onUploadProgress);
task.on("error", onUploadError);
task.on("complete", onUploadCompleted);

Here is my console logs:

***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught Error: -[NSInvocation getArgument:atIndex:]: NULL address argument
at
readProp(file: node_modules/@nativescript/background-http/index.ios.js:218:0)
at get upload(file: node_modules/@nativescript/background-http/index.ios.js:235:0)
at onProgress(file: node_modules/@nativescript/background-http/index.ios.js:7:0)
at push.../node_modules/@nativescript/zone-js/zone-nativescript.js.ZoneDelegate.invoke(file: node_modules/@nativescript/zone-js/zone-nativescript.js:388:0)
at push.../node_modules/@nativescript/zone-js/zone-nativescript.js.Zone.runGuarded(file: node_modules/@nativescript/zone-js/zone-nativescript.js:151:0)
at (file: node_modules/@nativescript/zone-js/zone-nativescript.js:129:0)
at (file: node_modules/@nativescript/background-http/index.ios.js:78:0)
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught Error: -[NSInvocation getArgument:atIndex:]: NULL address argument
at
readProp(file: node_modules/@nativescript/background-http/index.ios.js:218:0)
at get upload(file: node_modules/@nativescript/background-http/index.ios.js:235:0)
at onProgress(file: node_modules/@nativescript/background-http/index.ios.js:7:0)
at push.../node_modules/@nativescript/zone-js/zone-nativescript.js.ZoneDelegate.invoke(file: node_modules/@nativescript/zone-js/zone-nativescript.js:388:0)
at push.../node_modules/@nativescript/zone-js/zone-nativescript.js.Zone.runGuarded(file: node_modules/@nativescript/zone-js/zone-nativescript.js:151:0)
at (file: node_modules/@nativescript/zone-js/zone-nativescript.js:129:0)
at (file: node_modules/@nativescript/background-http/index.ios.js:78:0)
', reason: '(null)'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff2043a126 __exceptionPreprocess + 242
1   libobjc.A.dylib                     0x00007fff20177f78 objc_exception_throw + 48
2   NativeScript                        0x0000000104cee344 _ZN3tns21NativeScriptException15OnUncaughtErrorEN2v85LocalINS1_7MessageEEENS2_INS1_5ValueEEE + 914
3   NativeScri<โ€ฆ>

Also the single file upload does not work either, it does nothing.

@nativescript/camera does not properly support Android 11

the camera plugin required requestLegacyExternalStorage to be enabled in order to work in android 10, but this option is no longer available in Android 11, now we have to use preserveLegacyExternalStorage

However looking at the doc for this: https://developer.android.com/reference/android/R.attr#preserveLegacyExternalStorage
We can see that this won't always be taken into account

Note that this may not always be respected due to policy or backwards compatibility reasons.

This part seemingly affect simulators on Android 11

So as it stands it looks like the plugin has to support the new external storage to work reliably on Android 11, and I'm not sure this option will stay for Android 12

@nativescript/social-share iOS sharing image crashes

When sharing an image with the social-share plugin under Nativescript 7 our app crashes without even showing the modal share dialogue. This is reproducible by:

import * as SocialShare from "@nativescript/social-share";
import { ImageSource } from "@nativescript/core";

const image = ImageSource.fromResourceSync("YOUR_IMAGE_RESOURCE_NAME");
SocialShare.shareImage(image);

I tried some things and changing the following

export function shareImage(image) {
  share([image]);
}

to

export function shareImage(image) {
  // using the native UIImage instead of Nativescript ImageSource when sharing
  share([image.ios]);
}

in the file index.ios.ts seems to fix the issue (sharing works fine then).

[@nativescript/imagepicker] imagepicker partly broken by scoped storage (Android 11)?

Taking a photo works as expected, but selecting a photo from the gallery doesn't seem to work anymore (see log below โ€” as comment).

This issue duplicates an issue from the old imagepicker repositoryย : NativeScript/nativescript-imagepicker#309
And seems related to NativeScript/NativeScript#7866

% ns info
โœ” Getting NativeScript components versions information...
โœ” Component nativescript has 7.0.11 version and is up to date.
โœ” Component @nativescript/core has 7.0.13 version and is up to date.
โœ” Component @nativescript/ios has 7.0.5 version and is up to date.
โœ” Component @nativescript/android has 7.0.1 version and is up to date.
    Imagepicker.create({ mode: 'multiple' })
      .authorize()
      .then(() => context.present())
      .then((selection) => {
        selection.forEach((imageAsset) => {
          console.log(imageAsset);
                // JS: {
                // JS:   "_observers": {},
                // JS:   "_options": {
                // JS:     "keepAspectRatio": true,
                // JS:     "autoScaleFactor": true
                // JS:   },
                // JS:   "_android": "/storage/emulated/0/DCIM/Camera/NSIMG_20200928_161415.jpg"
                // JS: }
          ImageSource.fromAsset(imageAsset)
                // Asset '/storage/emulated/0/DCIM/Camera/NSIMG_20200928_161415.jpg' cannot be found.

Noteย : The ImagePicker.present() function gets a URI (of the form "content://โ€ฆ") that is converted by the imagepicker into an absolute path (as above), but the ImageSource seems unable to interpret it. I first thought that maybe ImageAsset.android should be a URI rather than an absolute path (and ImageSource being able to interpret it). But some API seems to be compatible with absolute paths [1], so I'm not even sure anymore it's an imagepicker bug rather than a ImageSource bugโ€ฆ anyway, posting here since the bug arise when using imagepicker.

[1] From https://developer.android.com/about/versions/11/privacy/storage

Access files using direct file paths and native libraries

To help your app work more smoothly with third-party media libraries, Android 11 allows you to use APIs other than the MediaStore API to access media files from shared storage using direct file paths. These APIs include the following:

  • The File API.
  • Native libraries, such as fopen().

[@nativescript/background-http] upload error responseCode = -1

Please, provide the following version numbers that your issue occurs with:

CLI: 7.0.10
"@nativescript/android": "7.0.1",
"@nativescript/ios": "7.0.5",

angular 10.2.1

When I upload a file, I get the error below.

e.responseCode = -1

this is my code

public _uploadBinary(fileName: string) {
    this.file = fileName;
    const name = this.file.substr(this.file.lastIndexOf('/') + 1);
    const description = `${name}`;

    const request = {
        url: this.avatarUrl,
        method: 'POST',
        headers: {
            "Content-Type": "application/octet-stream",
            "File-Name": name,
            "Authorization": `Bearer ${this.authTokenService.token}`
        },
        description: description,
        androidAutoDeleteAfterUpload: true,
        androidNotificationTitle: 'NativeScript HTTP background',
    };

    let task: Task;

    var params = [{name: name, value: "value"}, {name:"fileToUpload", filename: this.file, mimeType: 'image/jpeg'}];
    task = this.session.multipartUpload(params, request);
    task.on("progress", (e) => {
        console.log("upload progress", JSON.stringify(e));
    });
    task.on("error", (e) => {
        console.log("upload error", JSON.stringify(e));
        alert("error received " + e.responseCode + " code.");
    });
    task.on("responded", (e) => {
        console.log("responded", JSON.stringify(e) );
        console.log("responded data", JSON.stringify(e.data) );
    });
    task.on("complete", (e) => {
        console.log("upload complete", JSON.stringify(e));
    });

    this.tasks.push(task);
}

[@nativescript/camera] IOS Camera stays behind page content if opened in nested page-router-outlet

let me paste the bug from the previous version
unfortunately still not fixed, hence the request for help

NativeScript/nativescript-camera#234

"
I have a nested page-router-outlet configuration in my app. Root component template has a page-router-outlet. Child page has the following template:

<grid-layout rows="*, auto"> <page-router-outlet row="0"></page-router-outlet> <stack-layout row="1" style="height:50;background-color:red;"></stack-layout> </grid-layout>

I load a child page inside the page-router-outlet shown inside the template above. If I open the camera inside that child component, stack-layout component in the template above stays above the camera and blocks the camera buttons.

If I use a router-outlet inside the template above, I still have the same problem.
"
is there any chance to fix this or adjust the patch?

iOS 7.1.0, device

is there any chance to fix this or adjust the patch?

[@nativescript/camera] NativeClass is not defined

After updating NativeScript the camera package is crashing the app. This error is common when ts-patch is not being ran properly for a package build replacing the NativeClass decorator. The latest version 5.0.4 of @nativescript/camera seems to have this issue.

Versions

โœ” Component nativescript has 7.1.2 version and is up to date.
โœ” Component @nativescript/core has 7.1.4 version and is up to date.
โœ” Component @nativescript/ios has 7.1.1 version and is up to date.
โœ” Component @nativescript/android has 7.0.1 version and is up to date.

@nativescript/[email protected]

Crash

***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught ReferenceError: NativeClass is not defined
at
../node_modules/@nativescript/camera/index.js(file: app/packages/camera/index.ios.ts:4:6)
at __webpack_require__(file: app/webpack/bootstrap:816:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/@acme/nativescript-core/image.js(file:///app/vendor.js:765:78)
at __webpack_require__(file: app/webpack/bootstrap:816:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/@acme/nativescript-core/index.js(file: app/packages/nativescript-core/index.ios.ts:1:0)
at __webpack_require__(file: app/webpack/bootstrap:816:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/ts-loader/index.js?!../node_modules/vue-loader/lib/index.js?!./components/App.vue?vue&type=script&lang=ts&(file:///app/bundle.js:1555:83)
at __webpack_require__(file: app/webpack/bootstrap:816:0)
at fn(file: app/webpack/bootstrap:120:0)
at ./components/App.vue?vue&type=script&lang=ts&(file: app/components/App.vue?2c2a:1:0)
at __webpack_require__(file: app/webpack/bootstrap:816:0)
at<โ€ฆ>
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught ReferenceError: NativeClass is not defined
at
../node_modules/@nativescript/camera/index.js(file: app/packages/camera/index.ios.ts:4:6)
at __webpack_require__(file: app/webpack/bootstrap:816:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/@acme/nativescript-core/image.js(file:///app/vendor.js:765:78)
at __webpack_require__(file: app/webpack/bootstrap:816:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/@acme/nativescript-core/index.js(file: app/packages/nativescript-core/index.ios.ts:1:0)
at __webpack_require__(file: app/webpack/bootstrap:816:0)
at fn(file: app/webpack/bootstrap:120:0)
at ../node_modules/ts-loader/index.js?!../node_modules/vue-loader/lib/index.js?!./components/App.vue?vue&type=script&lang=ts&(file:///app/bundle.js:1555:83)
at __webpack_require__(file: app/webpack/bootstrap:816:0)
at fn(file: app/webpack/bootstrap:120:0)
at ./components/App.vue?vue&type=script&lang=ts&(file: app/components/App.vue?2c2a:1:0)
at __webpa<โ€ฆ>

Temporary Solution

Downgrading to version 5.0.3 from 5.0.4. However, doing so, we don't get the Android 11 fixes.

DatePicker error when created

I have this issue, but it's not critical. The DatePicker is displayed and works at the first look.

I'm using Angular and I share code between mobile and web verions.

Error: node_modules/@nativescript/datetimepicker/angular/index.d.ts:3:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (@nativescript/datetimepicker/angular) which declares NativeScriptDateTimePickerModule
has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is
available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

3 export declare class NativeScriptDateTimePickerModule {

[@nativescript/datetimepicker] Android Datepicker returns March when February is selected

As mentioned in the title, when we select the month as february, march is returned regardless of the date and the year. We have updated and downgraded the version of the plugin, but the bug still persist

This is the code that we have

DateTimePicker.pickDate({โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹
    context:args.object._context,
    title:global.dateTimePickerTitle(),
      }โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹)
        .then((result) => {โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹
            // "2021-03-27T16:00:00.000Z" is returned instead of "2021-02-27T16:00:00.000Z" when we selected 27 february 2021
            console.log(JSON.stringify(result)); 
        });

[@nativescript/camera] Upgrading to 5.0.3+ breaks permissions on Android 6

After upgrading plugin to version 5.0.3+, saving picture doesn't work anymore. It has to do something with dependency @nativescript/imagepicker which is included in this version.

โˆš Getting NativeScript components versions information...
โˆš Component nativescript has 7.1.2 version and is up to date.
โˆš Component @nativescript/core has 7.1.4 version and is up to date.
โˆš Component @nativescript/ios has ^7.1.1 version and is up to date.
โˆš Component @nativescript/android has 7.0.1 version and is up to date.

"@nativescript/camera": "^5.0.6",

Tested on Android 6:

Error: java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=4228, uid=10061 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission()
    at android.app.ActivityThread.deliverResults(ActivityThread.java:3699)
    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742)
    at android.app.ActivityThread.-wrap16(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302)
    at com.tns.Runtime.callJSMethodImpl(Runtime.java:1188)
    at com.tns.Runtime.callJSMethod(Runtime.java:1175)
    at com.tns.Runtime.callJSMethod(Runtime.java:1153)
    at com.tns.Runtime.callJSMethod(Runtime.java:1149)
    at com.tns.NativeScriptActivity.onActivityResult(NativeScriptActivity.java:63)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
    at android.content.ContentProviderProxy.insert(ContentProviderNative.java:476)
    at android.content.ContentResolver.insert(ContentResolver.java:1231)
    ... 18 more

Reverting back to version 5.0.2 works as expected without any additional permissions.

[@nativescript/datetimepicker] Class '-border' not applying style as per the parent TextField

Hi,
When I use class '-border' for the fields, it is not having the same styling as the parent TextField.
When the date is not picked, it has a underline stroke and after picked it has non rounded borders.

<DatePickerField class="nt-input -border" hint="Enter date of birth" formControlName="dateOfBirth" required keyboardType="datetime" returnKeyType="next" [isEnabled]="!updatingTraderDetails"> </DatePickerField>

Also when the device is in light mode (white background) can't see any elements of the field [Check the Date of Birth Field] below

image
image
image
image

NS7 migration nativescript-animated-circle issue in 'setFillCircleColor'

We were using nativescript-animated-circle and now I am trying to upgrade our project NS7 for IOS 14.1 crash issue.
Now I tried to use @nativescript/animated-circle 1.1.5 but while running for android it is giving error

Cannot read property 'setFillCircleColor' of undefined

because of this plugin If you see plugin code ./node_modules/@nativescript/animated-circle/index.android.js has the reference for

set fillColor(value) {
this._fillColor = value;
if (value instanceof Color) {
this.android.setFillCircleColor(value.argb);
}
else {
this.android.setFillCircleColor(new Color(value).argb);
}
}

My project configuration :

โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Plugin โ”‚ Version โ”‚
โ”‚ @nativescript-community/ui-material-bottomnavigationbar โ”‚ ^5.1.16 โ”‚
โ”‚ @nativescript/animated-circle โ”‚ ^1.1.5 โ”‚
โ”‚ @nativescript/appversion โ”‚ ^2.0.0 โ”‚
โ”‚ @nativescript/core โ”‚ ^7.0.13 โ”‚
โ”‚ @nativescript/local-notifications โ”‚ ^5.1.0 โ”‚
โ”‚ @nota/nativescript-webview-ext โ”‚ ^7.0.1 โ”‚
โ”‚ @nstudio/nativescript-floatingactionbutton โ”‚ ^3.0.4 โ”‚
โ”‚ @nstudio/nativescript-pulltorefresh โ”‚ ^3.0.1 โ”‚
โ”‚ @proplugins/nativescript-cardview โ”‚ ^5.0.0 โ”‚
โ”‚ @proplugins/nativescript-dom โ”‚ ^2.2.3 โ”‚
โ”‚ @proplugins/nativescript-globalevents โ”‚ ^1.4.4 โ”‚
โ”‚ @proplugins/nativescript-orientation โ”‚ ^2.5.0 โ”‚
โ”‚ @proplugins/nativescript-pager โ”‚ ^12.0.3 โ”‚
โ”‚ @proplugins/nativescript-purchase โ”‚ ^6.0.0 โ”‚
โ”‚ crypto-js โ”‚ ^4.0.0 โ”‚
โ”‚ fuse.js โ”‚ ^3.4.6 โ”‚
โ”‚ nativescript-feedback โ”‚ ^2.0.0 โ”‚
โ”‚ nativescript-https โ”‚ ^2.2.2 โ”‚
โ”‚ nativescript-intl โ”‚ ^4.0.2 โ”‚
โ”‚ nativescript-iqkeyboardmanager โ”‚ ^1.5.1 โ”‚
โ”‚ nativescript-nodeify โ”‚ ^0.8.0 โ”‚
โ”‚ nativescript-randombytes โ”‚ ^1.0.0 โ”‚
โ”‚ nativescript-sqlite โ”‚ ^2.6.6 โ”‚
โ”‚ nativescript-toasts โ”‚ ^1.0.3 โ”‚
โ”‚ sjcl โ”‚ ^1.0.8 โ”‚
โ”‚ uuid โ”‚ ^3.3.3 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Dev Dependencies:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Plugin โ”‚ Version โ”‚
โ”‚ @nativescript/android โ”‚ 7.0.1 โ”‚
โ”‚ @nativescript/ios โ”‚ 7.0.6 โ”‚
โ”‚ @nativescript/webpack โ”‚ ~3.0.0 โ”‚
โ”‚ nativescript-worker-loader โ”‚ ^0.12.1 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

@nativescript/imagepicker is blocking tap events

Hello, lately I upgrade my app to nativescript 7 to support ios 14. I use the @nativescript/imagepicker plugin to select images.

Strangely the imagepicker causing a bug at the tap events in my application. After I selected an image using the imagepicker, I cannot press any button which uses a tap event to fire function calls.

I am using @nativescript/core at version 7.0.0 and @nativescript/angular at version 10.1.0
I also using the @nativescript/imagepicker at version 1.0.0

Here are the dependencies of my application:

{
"dependencies": {
    "@angular/animations": "~10.1.0",
    "@angular/common": "~10.1.0",
    "@angular/compiler": "~10.1.0",
    "@angular/core": "~10.1.0",
    "@angular/forms": "~10.1.0",
    "@angular/platform-browser": "~10.1.0",
    "@angular/platform-browser-dynamic": "~10.1.0",
    "@angular/router": "~10.1.0",
    "@nativescript/android": "~7.0.0",
    "@nativescript/angular": "~10.1.0",
    "@nativescript/camera": "~5.0.0",
    "@nativescript/core": "7.0.0",
    "@nativescript/firebase": "~11.0.0",
    "@nativescript/imagepicker": "~1.0.0",
    "@nativescript/iqkeyboardmanager": "^2.0.0",
    "@nativescript/theme": "~2.2.1",
    "@nativescript/webpack": "3.0.0",
    "@types/lodash": "^4.14.149",
    "core-js": "^2.6.9",
    "jquery": "^3.4.1",
    "lodash": "^4.17.15",
    "mobx": "^5.15.1",
    "mobx-angular": "^3.0.3",
    "nativescript-couchbase": "^1.0.18",
    "nativescript-plugin-regions": "^1.0.2",
    "nativescript-ui-listview": "^9.0.2",
    "nativescript-webview-interface": "^1.4.3",
    "reflect-metadata": "~0.1.12",
    "rxjs": "~6.5.5",
    "rxjs-compat": "^6.5.4",
    "schematics": "^0.2.0",
    "tslib": "1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.1000.8",
    "@angular/cli": "^10.1.2",
    "@angular/compiler-cli": "^10.1.2",
    "@nativescript/ios": "7.0.0",
    "@nativescript/schematics": "^9.0.0",
    "@nativescript/tslint-rules": "~0.0.5",
    "@nativescript/types": "^7.0.3",
    "@ngtools/webpack": "10.1.0",
    "@types/node": "^12.11.1",
    "@typescript-eslint/eslint-plugin": "^3.4.0",
    "@typescript-eslint/parser": "^3.4.0",
    "codelyzer": "^5.1.2",
    "eslint": "^7.3.1",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-prettier": "^3.1.4",
    "node-sass": "^4.7.1",
    "prettier": "^2.0.5",
    "protractor": "~5.4.3",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.9.0"
  }
}

[@nativescript/localize] In iOS, error thrown for `null` value

Currently in iOS, if null is passed to the localize method or to the localize pipe | L, an error is thrown:
TypeError: Cannot read property 'match' of null

Could the method and pipe be changed to match match the behavior in android, which is to return an empty string? This would be more in keeping with the library's otherwise more lenient edge case handling.

localize("unknown key");  // returns "unknown key"
localize("");  // returns ""
localize(null);  // throws error in iOS, returns "" in android

Dependencies:

"@nativescript/localize": "^5.0.2",
"@nativescript/angular": "~11.0.0",
"@nativescript/core": "~7.0.0",

Devices:

  • iPhone 12 Pro iOS 14.2 simulator
  • Pixel 3 Android API 29 emulator

[@nativescript/background-http] error Context.startForegroundService() did not then call Service.startForeground()

Hello,
We are using @nativescript/background-http on NativeScript with Angular to upload photos, web API .net Core 3.1

We have this error

System.err: An uncaught Exception occurred on "main" thread.
System.err: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{6fabfc7 u0 it.openweb.next2u/net.gotev.uploadservice.UploadService}
System.err:
System.err: StackTrace:
System.err: android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{6fabfc7 u0 it.openweb.next2u/net.gotev.uploadservice.UploadService}
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2052)
System.err: at android.os.Handler.dispatchMessage(Handler.java:107)
System.err: at android.os.Looper.loop(Looper.java:214)
System.err: at android.app.ActivityThread.main(ActivityThread.java:7710)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

Version numbers:
-CLI 7.1.1
"@nativescript/android": "7.0.1",
"@nativescript/ios": "7.1.0",

"@nativescript/background-http": "^5.0.1",

package.json:

"dependencies": {
"@angular/animations": "~11.0.5",
"@angular/common": "~11.0.5",
"@angular/compiler": "~11.0.5",
"@angular/core": "~11.0.5",
"@angular/forms": "~11.0.5",
"@angular/platform-browser": "~11.0.5",
"@angular/platform-browser-dynamic": "~11.0.5",
"@angular/router": "~11.0.5",
"@nativescript/angular": "~11.0.0",
"@nativescript/background-http": "^5.0.1",
"@nativescript/core": "^7.1.0",
"@nativescript/theme": "~3.0.1",
"@nativescript/types": "^7.1.0",
"@nativescript/webpack": "^4.0.0",
"jwt-decode": "^2.2.0",
"nativescript-ui-sidedrawer": "~9.0.3",
"reflect-metadata": "~0.1.13",
"rxjs": "~6.6.3",
"zone.js": "~0.11.3"
},
"devDependencies": {
"@angular/compiler-cli": "~11.0.5",
"@nativescript/android": "7.0.1",
"@nativescript/ios": "7.1.0",
"@ngtools/webpack": "~11.0.5",
"codelyzer": "~6.0.0",
"node-sass": "^4.14.1",
"tslint": "~6.1.3",
"typescript": "~4.0.0"
}

UploadFile.ts

public _uploadFile() {

   const name = this.file.substr(this.file.lastIndexOf('/') + 1);
    const description = `${name}`;

    const request = {
        url: `${this.avatarUrl}`,
        method: 'POST',
        utf8: true,
        headers: {
            "Content-Type": "multipart/form-data",
            "File-Name": name
        },
        description: description,
        androidAutoDeleteAfterUpload: false,
        androidNotificationTitle: 'Uploading Product Image',
        androidDisplayNotificationProgress:true
    };

    let task: Task;
    let lastEvent = '';

    const params = [
        { name: 'test', value: 'value' },
        { name: 'testInt', value: 10 },
        { name: 'bool', value: true },
        { name: 'fileToUpload', filename: this.file, mimeType: 'image/jpeg' },
    ];

    task = this.session.multipartUpload(params, request);

    function onEvent(e) {
        if (lastEvent !== e.eventName) {
            // suppress all repeating progress events and only show the first one
            lastEvent = e.eventName;
        } else {
            return;
        }

        this.events.push({
            eventTitle: e.eventName + ' ' + e.object.description,
            eventData: JSON.stringify({
                error: e.error ? e.error.toString() : e.error,
                currentBytes: e.currentBytes,
                totalBytes: e.totalBytes,
                body: e.data,
                responseCode: e.responseCode,
            }),
        });
    }

    task.on('progress', onEvent.bind(this));
    task.on('error', onEvent.bind(this));
    task.on('responded', onEvent.bind(this));
    task.on('complete', onEvent.bind(this));
    lastEvent = '';
    this.tasks.push(task);
}

web API .net Core 3

    [HttpPost("attachement")]
    public async Task<ActionResult> UploadAttachement([FromForm] IFormFile file)
    {
        var attachement = new modelProfile
        {
            ContentType = file.ContentType,
            name = file.FileName
        };
        using (var stream = file.OpenReadStream())
        {
            attachement.content = new byte[file.Length];
            await stream.ReadAsync(attachement.content, 0, (int)file.Length);
        };

        await serviceUpload.uploadProfile(attachement);

        return Ok();
    }

Can you please help with this error and the way to fix it?
Thank you

[@nativescript/datetimepicker] angular ios spinner style seems to break after first use (ns-dark)

Overview

When using DateTimePickerFields in nativescript angular on ios. The first time the spinner opens it's styled exactly as expected.

The second time it appears it's backed off to light styling? or something else has borked.
Styling is using the default styling from @nativescript/theme for the .date

Env

ios 14 sim.
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ @nativescript/[email protected]
โ”œโ”€โ”€ @nativescript/[email protected]
โ”œโ”€โ”€ @nativescript/[email protected]
โ”œโ”€โ”€ @nativescript/[email protected]
First Time Second Time
Simulator Screen Shot - iPhone 11 Pro Max - 2020-10-23 at 17 37 22 Simulator Screen Shot - iPhone 11 Pro Max - 2020-10-23 at 17 38 11

[@nativescript/localize + more] Better Tutorials for these plugins [Enhancement]

I'm used to the old version of Localize but there's no step by step documentation on how to set it up via the plugins. The demo files really don't help since they don't have the same structure as a typical project.

I'm used to this in my typescript:
import { NativeScriptLocalizeModule } from 'nativescript-localize/angular'; // added to app.module

import localize from 'nativescript-localize'; // added to component where it's used
const textString = localize('@@Translated_Text');

But now it's to be used like a pipe? Can I still use it in the Typescript?

Is the en.default now a *.js file? I was using a *.json?

Just some clarification would be awesome here.

social-share | RangeError: Maximum call stack size exceeded

When I use social-share with tabview I get the following error message when I try to share a url, text or an image: RangeError: Maximum call stack size exceeded

To reproduce the error, simply create a new typescript project with ns create and choose the Tabs template. From any view, try to share a URL, text or image.

env:
nativescript @7.0.10
@nativescript/core @7.0.13
@nativescript/ios @7.0.4

@nativescript/camera plugin

Hi,
Is there documentation for the @nativescript/camera plugin?
I would like to use the take photos as well as picking from the gallery. Plain JavaScript if possible.

Thanks,

[@nativescript/directions] Error when trying to navigate to specific address

Hi guys, since version 2.0.0 I am getting this error:

CONSOLE ERROR: ERROR Error: Uncaught (in promise): Error: Either set 'address' or 'lat' and 'lng'.
Error: Either set 'address' or 'lat' and 'lng'.
at new ZoneAwareError (file: node_modules/@nativescript/zone-js/zone-nativescript.js:1298:0)
at Function.getFromToQuerystring (file: node_modules/@nativescript/directions/directions.common.js:28:0)
at file: node_modules/@nativescript/directions/directions.ios.js:11:0
at new ZoneAwarePromise (file: node_modules/@nativescript/zone-js/zone-nativescript.js:902:0)
at Directions.navigate (file: node_modules/@nativescript/directions/directions.ios.js:9:0)
at file: src/app/pages/jobs/jobs.component.ts:300:20
at ZoneDelegate.push.../node_modules/@nativescript/zone-js/zone-nativescript.js.ZoneDelegate.invoke (file: node_modules/@nativescript/zone-js/zone-nativescript.js:388:0)
at Object.onInvoke (file: node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:27486:0)
at ZoneDelegate.push.../node_modules/@nativescript/zone-js/zone-nativescript.js.ZoneDelegate.invoke (file: node_modules/@nativescript/zone-js/zone-nativescript.js:387:0)
at Zone.push.../node_modules/@nativescript/zone-js/zone-nativescript.js.Zone.run (file: node_modules/@nativescript/zone-js/zone-nativescript.js:138:0)
at file: node_modules/@nativescript/zone-js/zone-nativescript.js:883:0

My code looks like this:

let dir = new Directions();

dir.available().then(avail => {
    if (avail) {
        dir.navigate({
            to: [{
                address: item.ShipToAddress
            }]
        });
    }
});

According to the docs, this code should work. Any help with this? Thanks!

Memory Allocation Issue

Environment
{
"@angular/animations": "~10.1.4",
"@angular/common": "~10.1.4",
"@angular/compiler": "~10.1.4",
"@angular/core": "~10.1.4",
"@angular/forms": "~10.1.4",
"@angular/platform-browser": "~10.1.4",
"@angular/platform-browser-dynamic": "~10.1.4",
"@angular/router": "~10.1.4",
"@nativescript/angular": "10.1.4",
"@nativescript/background-http": "^5.0.1",
"@nativescript/camera": "^5.0.2",
"@nativescript/core": "~7.1.0",
"@nativescript/imagepicker": "^1.0.2",
"@nativescript/theme": "~2.5.0",
"@nativescript/types": "^7.0.4",
"@nstudio/nativescript-checkbox": "^2.0.4",
"nativescript": "^7.1.2",
"nativescript-background-fetch": "^1.2.1",
"nativescript-bitmap-factory": "^1.8.1",
"nativescript-download-progress": "^1.2.0",
"nativescript-mediafilepicker": "^4.0.1",
"nativescript-pdf-view": "^2.0.1",
"nativescript-ui-listview": "^9.0.4",
"nativescript-webview-interface": "^1.4.3",
"reflect-metadata": "~0.1.10",
"rxjs": "~6.6.0",
"tns-ios": "^6.5.2",
"tslib": "1.10.0",
"zone.js": "~0.11.1"
},
"devDependencies": {
"@angular-devkit/core": "~10.1.4",
"@angular/cli": "~10.1.4",
"@angular/compiler-cli": "~10.1.4",
"@nativescript/ios": "7.1.1",
"@nativescript/webpack": "~4.0.0",
"@ngtools/webpack": "~10.1.4",
"typescript": "~3.9.0"
}

Describe the bug
I created an app where users create checklists and upload images for different items. I am using imagepicker to accomplish this. With the latest iOS version, we noticed users experiencing crashing when uploading multiple images. Taking a deeper look, we saw memory was capping out causing the crashing. When the saveToFile function is called, it allocates memory to save, and then never releases it. When that line is commented out, the behavior is expected; memory goes up when the image is uploaded, and then goes right back down.

Code Associated

selectImages() {

let context = imagepicker.create({
  mode: "multiple",
  maximumNumberOfSelection: 10
});

context.authorize().then(() => {
  return context.present();
}).then((selection) => {
  
  const documents: Folder = <Folder>knownFolders.documents();
  const folder: Folder = <Folder>documents.getFolder("photos");
  let running = false;
  selection.forEach((selected) => {
  
    var newImage:ImageSource;
    ImageSource.fromAsset(selected).then((res) => {
      newImage = res;
      let newPath = folder.path + "/cameraPic_" + (new Date()).getTime();
      let newPathThumbnail = newPath + "_thumbnail.jpeg"
      newPath = newPath + ".jpeg";
      let photoJson = {path: "file://" + newPath,thumb: "file://" + newPathThumbnail}
              
      newImage.saveToFile(newPath,"jpeg");
      
      running = false;
    });        
  });
});

}

[@nativescript/local-notifications] Custom interval not working on iOS - incomplete feature

Hi,
after updating plugin to version 5.1.0, which introduce the capacity of set a custom number interval (in days) when notification is scheduled, I noticed that custom intervals not works on iOS.
For example when I set a notification to schedule every X days (it works nice if scheduled daily).

In the iOS implementation of the plugin, call to method NSCalendar.componentsFromDate should be called with a CalendarUnit object and date object according to apple reference but CalendarUnit can only represent a specific range unit such minute, hour, day, month, etc. so currently is impossible to schedule a notification that triggers, for example, every 2 days and when this value is passed it introduces the insertion of a badly scheduled notification.

Example

LocalNotifications.schedule([
	{
		title: 'The title',
		body: 'Recurs every minute until cancelled',
                ...
		interval: 2,
		at: new Date(new Date().getTime() + 10 * 1000), // 10 seconds from now
	},
]).then(...)

Tested with
@nativescript/ios: "7.0.0"
@nativescript/core: "7.0.9"
nativescript-cli version 7.1.2

I hope this may help anyone, any suggestions are appreciated.
Thank you.

Stripe support

I really like nativescript for cross-platform mobile app development.
But I realize that I spend a lot of time looking for plugins and that the community doesn't always provide the must-have plugins compared to others SDK like Flutter or React-Native. Is there a plugin for the integration of stripe for payment. Especially for Nativescript 7
Thank you in advance

The plugin does not work with the new version of nativescript-vue

The dependecies are as follows:

"@nativescript/core": "^7.0.3",
"@nativescript/localize": "^5.0.2",
"@nativescript/theme": "^2.3.3",
"@panter/vue-i18next": "^0.15.2",
"@vue/devtools": "^5.3.3",
"nativescript-socketio": "^3.3.1",
"nativescript-toasty": "^3.0.0-alpha.2",
"nativescript-vue": "^2.8.1",
"nativescript-vue-devtools": "^1.4.0",
"vuex": "^3.5.1"

Followed steps as per documentation.

  • tns add plugin @nativescript/localize

  • Then added in main.js -

    import {localize} from '@nativescript/localize'
    Vue.filter('L', localize)

  • Then in the vue template

Used that, with en.default.json & de.json format file. Nothing changes nor works. I tried rebuilding the app as well. Does someone have a fix for this? Or have I missed out importing something? How does the plugin pick the json files? Should I import them somewhere??

A little help on this would be really appreciated. Also I could help if something is missing in the documentation. Its really hard to figure out without the documentation to be perfect.

iOS @nativescript/social-share Error: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]

Hi,

I'm getting this message when invoking SocialShare.shareUrl(someUrl, someTitle);

Error: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]

The share sheet didn't display. I've discovered this on iOS, yet to confirm on Android.

Platform: Nativescript 7.0.12 (Angular)
Mobile OS: iOS 14.3 (Emulator)
XCode version: 12.3
@nativescript/social-share version: 2.0.1

I have imported the library:

import * as SocialShare from '@nativescript/social-share';

Help needed. Thank you.

Not able to build the global demo app for Android and iOS

Hello,

right now I am not able to build the demo app in this repository, I get the following error message while preparing the project:

Preparing project...
Multiple errors were thrown:
Cannot find module '@nativescript/localize/hooks/before-watchPatterns.js'
Require stack:

  • /Users/felixkrautschuk/PhpstormProjects/Forks/NativeScriptPlugins/apps/demo/hooks/before-watchPatterns/nativescript-localize.js
  • /usr/local/lib/node_modules/nativescript/lib/common/services/hooks-service.js
  • /usr/local/lib/node_modules/nativescript/lib/common/yok.js
  • /usr/local/lib/node_modules/nativescript/lib/bootstrap.js
  • /usr/local/lib/node_modules/nativescript/lib/nativescript-cli.js
  • /usr/local/lib/node_modules/nativescript/bin/tns
    Cannot find module '@nativescript/localize/hooks/before-watchPatterns.js'
    Require stack:
  • /Users/felixkrautschuk/PhpstormProjects/Forks/NativeScriptPlugins/apps/demo/hooks/before-watchPatterns/nativescript-localize.js
  • /usr/local/lib/node_modules/nativescript/lib/common/services/hooks-service.js
  • /usr/local/lib/node_modules/nativescript/lib/common/yok.js
  • /usr/local/lib/node_modules/nativescript/lib/bootstrap.js
  • /usr/local/lib/node_modules/nativescript/lib/nativescript-cli.js
  • /usr/local/lib/node_modules/nativescript/bin/tns

[@nativescript/imagepicker] Memory Allocation Bug

Environment
{
"@angular/animations": "~10.1.4",
"@angular/common": "~10.1.4",
"@angular/compiler": "~10.1.4",
"@angular/core": "~10.1.4",
"@angular/forms": "~10.1.4",
"@angular/platform-browser": "~10.1.4",
"@angular/platform-browser-dynamic": "~10.1.4",
"@angular/router": "~10.1.4",
"@nativescript/angular": "10.1.4",
"@nativescript/background-http": "^5.0.1",
"@nativescript/camera": "^5.0.2",
"@nativescript/core": "~7.1.0",
"@nativescript/imagepicker": "^1.0.2",
"@nativescript/theme": "~2.5.0",
"@nativescript/types": "^7.0.4",
"@nstudio/nativescript-checkbox": "^2.0.4",
"nativescript": "^7.1.2",
"nativescript-background-fetch": "^1.2.1",
"nativescript-bitmap-factory": "^1.8.1",
"nativescript-download-progress": "^1.2.0",
"nativescript-mediafilepicker": "^4.0.1",
"nativescript-pdf-view": "^2.0.1",
"nativescript-ui-listview": "^9.0.4",
"nativescript-webview-interface": "^1.4.3",
"reflect-metadata": "~0.1.10",
"rxjs": "~6.6.0",
"tns-ios": "^6.5.2",
"tslib": "1.10.0",
"zone.js": "~0.11.1"
},
"devDependencies": {
"@angular-devkit/core": "~10.1.4",
"@angular/cli": "~10.1.4",
"@angular/compiler-cli": "~10.1.4",
"@nativescript/ios": "7.1.1",
"@nativescript/webpack": "~4.0.0",
"@ngtools/webpack": "~10.1.4",
"typescript": "~3.9.0"
}

Describe the bug
I created an app where users create checklists and upload images for different items. I am using imagepicker to accomplish this. With the latest iOS version, we noticed users experiencing crashing when uploading multiple images. Taking a deeper look, we saw memory was capping out causing the crashing. When the saveToFile function is called, it allocates memory to save, and then never releases it. When that line is commented out, the behavior is expected; memory goes up when the image is uploaded, and then goes right back down.

Code Associated

selectImages() {

let context = imagepicker.create({
  mode: "multiple",
  maximumNumberOfSelection: 10
});

context.authorize().then(() => {
  return context.present();
}).then((selection) => {
  
  const documents: Folder = <Folder>knownFolders.documents();
  const folder: Folder = <Folder>documents.getFolder("photos");
  let running = false;
  selection.forEach((selected) => {
  
    var newImage:ImageSource;
    ImageSource.fromAsset(selected).then((res) => {
      newImage = res;
      let newPath = folder.path + "/cameraPic_" + (new Date()).getTime();
      let newPathThumbnail = newPath + "_thumbnail.jpeg"
      newPath = newPath + ".jpeg";
      let photoJson = {path: "file://" + newPath,thumb: "file://" + newPathThumbnail}
              
      newImage.saveToFile(newPath,"jpeg");
      
      running = false;
    });        
  });
});

}

[@nativescript/camera] _nativescript_core__WEBPACK_IMPORTED_MODULE_0__.Utils.isNullOrUndefined is not a function

Hi,

I had this issue by using

"nativescript-camera": "^4.4.0"

So i saw it was fixed on version 5.0.2 of @nativescript/camera , i removed the last one and puted this. But now i have another error message :

TypeError: nativescript_core__WEBPACK_IMPORTED_MODULE_0_.Utils.isNullOrUndefined is not a function

I'm on nativescript (v6.5.1) angular, android 11, this is my package.json if needed:

{
  "nativescript": {
    "id": "myID",
    "tns-android": {
      "version": "6.5.3"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@angular/animations": "~8.2.0",
    "@angular/common": "~8.2.0",
    "@angular/compiler": "~8.2.0",
    "@angular/core": "~8.2.0",
    "@angular/forms": "~8.2.0",
    "@angular/http": "8.0.0-beta.10",
    "@angular/platform-browser": "~8.2.0",
    "@angular/platform-browser-dynamic": "~8.2.0",
    "@angular/router": "~8.2.0",
    "@nativescript/camera": "^5.0.2",
    "@nativescript/theme": "^3.0.1",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "@nstudio/nativescript-camera-plus": "^3.1.0",
    "@nstudio/nativescript-loading-indicator": "^1.0.0",
    "nativescript-angular": "^8.20.4",
    "nativescript-background-http": "^3.4.0",
    "nativescript-datetimepicker": "^1.2.3",
    "nativescript-imagecropper": "^3.0.0",
    "nativescript-imagepicker": "^7.1.0",
    "nativescript-nfc": "4.0.1",
    "nativescript-permissions": "^1.3.8",
    "nativescript-plugin-firebase": "9.0.2",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-ui-chart": "^7.1.1",
    "nativescript-ui-sidedrawer": "^8.0.1",
    "reflect-metadata": "~0.1.10",
    "rxjs": "^6.4.0",
    "tns-core-modules": "^6.3.2",
    "zone.js": "^0.9.1"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~8.2.0",
    "@nativescript/schematics": "~0.5.0",
    "@ngtools/webpack": "~8.2.0",
    "@types/jasmine": "^3.5.11",
    "nativescript-dev-webpack": "^1.4.1",
    "tns-platform-declarations": "6.0.1",
    "typescript": "~3.5.3"
  },
  "readme": "NativeScript Application"
}

Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
	package="__PACKAGE__"
	android:versionCode="20031"
	android:versionName="2.31">

	<supports-screens
		android:smallScreens="true"
		android:normalScreens="true"
		android:largeScreens="true"
		android:xlargeScreens="true"/>

	<uses-sdk
		android:minSdkVersion="26"
		android:targetSdkVersion="__APILEVEL__"/>
		
	<uses-permission android:name="android.permission.CAMERA"/>
	<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
	<uses-permission android:name="android.permission.INTERNET"/>
	
	
	<uses-feature android:name="android.hardware.camera" android:required="false" />
	<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
	<meta-data
	android:name="com.google.firebase.ml.vision.DEPENDENCIES"
	android:value="barcode"/>

	<application
		android:name="com.tns.NativeScriptApplication"
		android:allowBackup="true"
		android:icon="@drawable/icon"
		android:label="@string/app_name"
		android:requestLegacyExternalStorage="true"
		android:largeHeap="true"
		android:theme="@style/AppTheme">


		<activity
			android:name="com.tns.NativeScriptActivity" 
			android:label="@string/title_activity_kimera"
			android:configChanges="keyboardHidden|orientation|screenSize|uiMode" 
 		    android:theme="@style/LaunchScreenTheme"
			android:screenOrientation="portrait">

 			<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" /> 

			<intent-filter> 
 			<action android:name="android.intent.action.MAIN" /> 
 			<category android:name="android.intent.category.LAUNCHER" /> 
 			</intent-filter> 
		</activity>
		<activity android:name="com.tns.ErrorReportActivity"/>
	</application>
</manifest>

Please help ! Thanks !

@nativescript/camera problem with meta-data provider

Hi.
I installed this plugin. when im tring to take picture, getting this error;

Error -> java.lang.IllegalArgumentException: Couldn't find meta-data for provider with authority org.nativescript.xxx.provider

How can i add provider ? There is no provider tag in my manifest.xml

please help

Plugin issues, here or main package?

Looking at @nativescript/background-http, and there is a section for NS7 stating: "Source managed here", being a link to this repo, NativeScript/plugins

There is an issue we have also ran into, NativeScript/nativescript-background-http#270 (caught us off-guard for iOS 14, breaks our app)

Should issues be posted here since that is where source code is managed, or is the existing issue at the right place?

[@nativescript/social-share] conflicts with nativescript-facebook

Hi everyone,

the new version of @nativescript/social-share 2.0.2 has defined its one provider for com.facebook.FacebookContentProvider in the AndroidManifest.xml which conflicts with the definition of the provider which is necessary for nativescript-facebook to work.

How can that be fixed and where do I need to specify the ApplicationID in AndroidManifest.xml?

Thanks in advance,

Philipp

[@nativescript/localize] Exception thrown when changing translations

Environment

  • CLI: 7.0.10
  • Cross-platform modules: 7.0.12
  • Android Runtime: 7.0.1
  • iOS Runtime:
  • Plugin(s):

Describe the bug
Sometimes, when I add a new translation to localize plugin's language file (en.default.json), this error shows up:

System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4567)
System.err:     at android.app.ActivityThread.access$1500(ActivityThread.java:151)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1402)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:110)
System.err:     at android.os.Looper.loop(Looper.java:193)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:5322)
System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
System.err:     at java.lang.reflect.Method.invoke(Method.java:515)
System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
System.err:     at dalvik.system.NativeStart.main(Native Method)
System.err: Caused by: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
System.err:     at com.tns.Module.bootstrapApp(Module.java:316)
System.err:     at com.tns.Runtime.run(Runtime.java:680)
System.err:     at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4564)
System.err:     ... 10 more
System.err: Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
System.err:     at com.tns.Module.resolvePathHelper(Module.java:151)
System.err:     at com.tns.Module.bootstrapApp(Module.java:314)
System.err:     ... 14 more
System.err: An uncaught Exception occurred on "main" thread.
System.err: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
System.err: StackTrace:
System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4567)
System.err:     at android.app.ActivityThread.access$1500(ActivityThread.java:151)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1402)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:110)
System.err:     at android.os.Looper.loop(Looper.java:193)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:5322)
System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
System.err:     at java.lang.reflect.Method.invoke(Method.java:515)
System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
System.err:     at dalvik.system.NativeStart.main(Native Method)
System.err: Caused by: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
System.err:     at com.tns.Module.bootstrapApp(Module.java:316)
System.err:     at com.tns.Runtime.run(Runtime.java:680)
System.err:     at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4564)
System.err:     ... 10 more
System.err: Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
System.err:     at com.tns.Module.resolvePathHelper(Module.java:151)
System.err:     at com.tns.Module.bootstrapApp(Module.java:314)
System.err:     ... 14 more

In order to get rid of it, I usually have to build my app once more.

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.