Xcode not generating app with latest changes - xcode

My latest changes in Ionic app are not reflected on simulator or in ipa file which i am generating with xcode 10.
I tried many solution like removed build folder, remove ios folder from platform and add it again but none of works.
Any one has idea what might be problem is ?

Only use these commands
cordova clean
and
npm run clean

For Xcode 10 you likely will need to force the use of the legacy build system. This is described in this blog post.
Summary: Create a build.json file in the root of your project with the following contents:
{
"ios": {
"debug": {
"buildFlag": [
"-UseModernBuildSystem=0"
]
},
"release": {
"buildFlag": [
"-UseModernBuildSystem=0"
]
}
}
}

Related

Nativescript: TypeError: Invalid Version: 1.?2.0

I'm getting the error while installing the plugin.
TypeError: Invalid Version: 1.?2.0
I've created the plugin for NativeScript.
Here is how my package.json looks like.
{
"name": "nativescript-toaster",
"version": "1.0.1",
"main": "index.js",
"nativescript": {
"platforms": {
"android": "1.​2.0"
}
}
}
As described in some forums I've tried to remove the android entries from package.json of NS projects, and clean cache npm cache clean. But as I add android platform tns platform add android it comes again.
Please share if you've any idea about this.
Thanks Guys
I was getting the same error. In my case, I was trying to include iOS and Android native code; I tried changing it like this: "1.3.0" , and the error disappeared.

How to run fsharp test on Mac from terminal?

I want to learn fsharp. So I'm looking at exercism.io
In their readme they instruct to use Xamarin Studio for running the test
http://exercism.io/languages/fsharp/tests
But I would like to just run the tests from the terminal. The exercises from exercism only include one F# file e.g. HelloWorldTest.fs.
This answer Running tests on Mac OS X console using mono/nunit-console/4 instructs to run nunit-console with a .csproj or .dll file. But these files are not present in the exercism files. So I'm not clear what to do.
I have install mono using homebrew.
How do I run the NUnit test from the terminal in OSX?
You may have to use xbuild on the command line to compile the fsproj file then the resulting dll can be executed with nunit on the commandline also.
If you don't have the fsproj you can use fsharpc on the file directly then call nunit, remembering to use mono to execute nunit.
fsharpc HelloWorldTest.fs
mono nunit-console.exe HelloWorldTest.exe
Sorry am not in a position to test this, but should be something like this.
I figured out how to do this:
1. install dotnet as described https://www.microsoft.com/net/core#macos
2. In the folder of the exercise run
dotnet new --lang f#
3. Rename Program.fs to the name of the exercise e.g. HelloWorld.fs
4. Change project.json to
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true,
"compilerName": "fsc",
"compile": {
"includeFiles": [
"HelloWorld.fs",
"HelloWorldTest.fs"
]
}
},
"dependencies": {
"NUnit": "3.4.1",
"dotnet-test-nunit": "3.4.0-beta-2"
},
"tools": {
"dotnet-compile-fsc": "1.0.0-preview2-*"
},
"frameworks": {
"netcoreapp1.0": {
"imports": "portable-net45+win8",
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
},
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160629"
}
}
},
"testRunner": "nunit"
}
This includes the nunit dependency.
Note includeFiles, this should include the source code file for the exercise and the test file. e.g. HelloWorld.fs and HelloWorldTest.fs
5. Install required packages by doing
dotnet restore
6. Add your code to the previously renamed source file e.g. HelloWorld.fs
7. Finallly, run test by doing
dotnet test

Exclude .js, include .min.js when publishing to Azure with VS 2015

I found this (seemingly) related SO post, but following the suggestions from both answers didn't help, all my js files are getting pushed to Azure (not just the *.min.js files from my js folder.)
What am I doing wrong? Is this possible? I could update my gulp script I suppose to read an environment variable ("Development", or "Production") and then delete the source js files conditionally. It just seems to be better to make the build task function as I wish (especially since it looks doable.)
Js files for my project are in [solution folder][project folder]\wwwroot\js.
According to the comment you added in the related SO post you mentioned, I assumed that your application is Based on ASP.NET Core. As far as I know, we could determine that which file/folder could be included or excluded when publishing your web application by configuring the publishOptions section in your project.json file as follows:
"publishOptions": {
"include": [
"wwwroot",
"wwwroot/js/**/*.min.js",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
],
"exclude": [
"wwwroot/js/**/*.js"
]
}
But, as this tutorial mentioned that the exclude patterns have higher priority than the include patterns, hence a file found in both will be excluded. In this situation, you need to configure all the included/excluded files in the includeFiles/excludeFiles node of the publishOptions.
According to your requirement, Using Gulp would be an ideal approach to achieve it.
Additionally, if your project is an ASP.NET MVC application, you could add the following to your .pubxml file.
<ItemGroup>
<ExcludeFromPackageFiles Include="wwwroot\js\**\*.js" Exclude="wwwroot\js\**\*.min.js">
<FromTarget>Project</FromTarget>
</ExcludeFromPackageFiles>
</ItemGroup>
I ended up going the gulp route thus far (still interested in the other alternatives if viable.)
Created a new task in my gulpfile...
var del = require("del");
gulp.task("remove-non-minjs", function () {
return del([
paths.scripts.dest + "**/*.js",
"!" + paths.scripts.dest + "**/*.min.js"
]);
});
And then added this to my project.json's prepublish script...
"scripts": {
"prebuild": [ "gulp default" ],
"prepublish": [ "npm install", "gulp default", "gulp remove-non-minjs" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
I verified it works, but just seems a bit hacky.
This seemed to do the trick for me:
https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/advanced-enterprise-web-deployment/excluding-files-and-folders-from-deployment
Via the Solution Explorer, you can edit the Properties of each file in your project and set the Build Action to NONE. It looks like you might be able to select multiple files at one time while doing this.

Cannot find module after creating and adding plugin in Nativescript

Using the latest version of Nativescript I've created a plugin as per the documentation and after running tns plugin add ../nativescript-keychain I get the message Successfully installed plugin nativescript-keychain.
I can also see that it's been added to the node_modules directory of my app but require("nativescript-keychain") doesn't work as I get the error Cannot find module 'nativescript-keychain'
My plugin package.json looks like
{
"name": "nativescript-keychain",
"version": "0.0.1",
"nativescript": {
"platforms": {
"ios": "2.2.1"
}
}
}
There are several reasons why this might occur; it would be helpful if you provided a repo to see all the code.
package.json doesn't have a link to the source, typically you have a main: "somefile" key.
Did you do tns run ios --emulator after you installed the plugin, you have to rebuild the app before it will take effect, plugins can't be synced via livesync...
Is the code TypeScript or JavaScript, if it is TypeScript it needs to be transpiled to JS before you can add it to your demo application. TNS will NOT compile any TS code in the plugins. Plugins have to ship with the final JS code.
You need typings for TS to use the auto-complete and not throw warnings about what methods are available.

Global.json and running web application

I am trying to create a new web application using OS X and VS Code from scratch without using any scaffolding tool. My starting point is Scott Allen's tutorial on pluralsight:
https://app.pluralsight.com/library/courses/aspdotnet-core-1-0-fundamentals/table-of-contents
My project structure is:
The global.json file contains
{
"projects": [ "src" ],
"sdk": {
"version": "1.0.0-rc1-update2"
}
}
And the project.json currently contains
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": false
},
"dependencies": {
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.Hosting": "1.0.0-rc1-final"
},
"frameworks": {
"dnx451": {},
"dnxcore50": {}
},
"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000"
},
"exclude": [
"wwwroot",
"node_modules"
]
}
I have run dnu restore to get the packages and now I would like to run the web. I need to go to the web app folder and run dnx web in order to do so and the app starts
Is it possible to run the application directly from the root folder, not from the web app folder? Is the global.json file needed in such setup? And how do I change the hosting environment? I have gone through the documentation, but the hosting environment is only clear when using VS 2015.
You cannot simply run from the root because there could be multiple projects that are "executable". But you can pass the project to dnx using the --project/-p argument.
The environment is set using the ASPNET_ENVIRONMENT environment variable.
The global.json file is useful for two things:
The sdk section is only by VS.
The projects section is used all the time and it's useful if you have the projects in multiple folders (for example src and test). If everything is in a single folder, you don't need it.
So, the bare minimum in order to run an web application is:
A folder for your project
A project.json file
A startup file

Resources