Nativescript NativeAPI can't find NSURL, NSURLRequest, NSObject - cocoapods

I need to Implement Native API in Nativescript Angular to add WebSocket support using StompClient.
Already added template declaration using
npm i tns-platform-declarations --save-dev and configured exactly as per the documentation.
but when I run the project it can't find
Cannot find name 'NSURLRequest' , NSURLRequest.requestWithURL(NSURL.URLWithString(url)), Cannot find name 'NSObject'
However, in vs code it is able to find using autocomplete.
Any good suggestions pls?

Related

Sass not working in Svelte and StorybookJS

I am using Google Material on Svelte and thank GOD finally was able to successfully make it work. Now, I created it in a separate code base. On the other hand I am actually creating a separate codebase for different components in StorybookJS. So when I ported my working codebase (actually copy pasted the component) the button for example that I am testing is not working anymore. I checked all the necessary npm installations that I need and it's all good.
But now when I check the Developer Tools on my browser (I am using Brave) I got this error:
Refused to apply style from 'http://localhost:60809/theme-mui.scss' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
My theme-mui.scss mentioned on the error above is the initializer for my Google Material to work on Svelte (or other framework for that matter). I tried to transfer the above scss file to no avail. I followed the instruction of setup from my separate code base but it still is not working. I tried to follow the sass config using this link from Storybook but still to no avail. What could have gone wrong?

Are there any naming conventions for filenames?

I'm new to nativescript and tried to open a modal.
Everything works fine if I use a filename like "connect-modal-page".
But if I use "connect" only I get the message:
JS ERROR Error: NativeScript encountered a fatal error: Error: Failed to load component from module: ./views/modals/connect.xml
So I guess there is something like a naming convention. But which?
The docs says there isn't any real convention.
Did I miss something?
This filename works:
connect-modal-page.xml
These filenames do not work:
connect-modal.xml
connect.xml
You are using NativeScript and bundling with Webpack (with the upcoming version this will be the default workflow). The thing is that Webpack needs to "know" about any resources that need to be bundled.
So to resolve this issue by design the NativeScript team has provided a pattern that will automatically bundle all pages that are ending with -page or -root. Any other resource that you want to become part of the bundle should be explicitly included in the webpack.config.js file (in the CopyWebpackPlugin section). So with NativeScript 5.x.x you will need to either rename all your files to end with -page or to add them explicitly in the webpack configuration. Note that I am talking about a project for NativeScript Core (plain JavaScript or TypeScript) and not NativeScript Angular.
From NativeScript 6 (upcoming release expected in mid-July2019) this won't be needed anymore and all *.xml and *.ts resources (talking about NativeScript Core) will be bundled by default.

#pnp/sp seems to be missing the .get() method

I am running into a strange (and hopefully very simple) issue where the .get() method does not seem to be defined in my spfx project.
This is a typescript 2.4.2 project for creating an spfx webpart for SharePoint 2016 on prem.
The project was started using yo #microsoft/sharepoint
There was a fix applied to update some typescript 2.2.2 references as per instructions here
The dependencies for PnP were loaded:
npm install #pnp/logging #pnp/common #pnp/odata #pnp/sp --save
Imports included
import { sp, Web } from '#pnp/sp';
Within a function of my render() method I am trying to make a very simple call as follows
let web = new Web(this.context.pageContext.site.absoluteUrl);
return web.lists.getByTitle(this.properties.listName).fields.filter("Title eq 'Decision Status'").get();
I am getting an error that says Property 'get' does not exist on type 'Fields'. To try and make it even simpler I tried running
let web = new Web(this.context.pageContext.site.absoluteUrl);
web.get();
And I get a similar error saying 'get' does not exist on type 'Web'. The examples they show in the documentation show very similar code, but I can't determine what about my code is incorrect here.
If this issue is still relevant,check the version of the #pnp/sp installed. The latest one as of today is 1.2.9 and should support get
I was dealing with this issue, my solution was install this others dependencies with the same version.
#pnp/common
#pnp/logging
#pnp/odata
#pnp/sp
hope that helps for anyone with this problem!

Unable to get gRPC to work in Xamarin Android

I have created a Xamarin Android project. Via NuGet, I have added a reference to the Grpc package.
In my activity, I want to create a Grpc.Core.Server instance, but it won't let me because of the following runtime error:
System.IO.FileNotFoundException: Error loading native library. Not found in any of the possible locations: /storage/emulated/0/Android/data/DecodingPoC.DecodingPoC/files/.override/libgrpc_csharp_ext.x64.so,/storage/emulated/0/Android/data/DecodingPoC.DecodingPoC/files/.override/runtimes/linux/native/libgrpc_csharp_ext.x64.so,/storage/emulated/0/Android/data/DecodingPoC.DecodingPoC/files/.override/../../runtimes/linux/native/libgrpc_csharp_ext.x64.so
I haven't been able to find any information on this for Xamarin, only iOS, so I am hoping someone here can provide a suggestion on how to proceed.
Please note that gRPC c# support for Xamarin is currently experimental. The stable packages in nuget.org don't provide the support yet (that will change with the upcoming v1.15.x release).
See HelloWorldXamarin instructions on how to obtain the correct nuget package (or use the https://www.nuget.org/packages/Grpc.Core/1.15.0-pre1 pre-release package which already supports Xamarin):
https://github.com/grpc/grpc/tree/master/examples/csharp/HelloworldXamarin#experimental-only
You might also need this workaround if you are using Xamarin.Forms: https://github.com/grpc/grpc/issues/16250

Xamarin Support Library v7 AppCompat 21.0.0-beta1

I am trying to use the latest Xamarin Support Library v7 AppCompat 21.0.0-beta1 in my project. I am getting the following error.
Xamarin/Android.Support.v7.AppCompat/21.0.0-appcompat-v7/embedded/./res/values-v11/values.xml:43: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
It is pretty much identical to the issue on the following thread but it is related to xamarin envrionment.
appcompat-v7:21.0.0': No resource found that matches the given name: attr 'android:actionModeShareDrawable'
Any ideas would be appreciated.
You should override and set your target level to v21. You need to run the Xamarin Alpha channel to be able to do this.

Resources