Build an existing ionic2 app using windows phone platform - windows

I have ionic2 app that already works on (Android & IOS) platforms.
After I have copied the source folder to Win7 and downloaded the requirements
I did
1) ionic cordova platform add windows#6.0.0
2) cordova build windows -- --appx=8.1-phone
I got a .sln file in platform/windows folder and output in platforms/windows/AppPackages folder.
but the output .appx file was too small (3.625 K) just like an empty app with splashscreen (contains cordova icon).
Here is the end of the second command
The cordova requirements

I have solved this issue by creating a new ionic app
ionic start MyIonicProject tutorial
and replaced the src folder and every thing what I need from my app with the current .
and after that
ionic cordova platform add windows#6.0.0
cordova run windows
It works like a charm :)
I tried every thing else and didn't get any result.

To build apps for Windows Universal, download and install Visual Studio 2015 Community Edition. During the installation, Select “Tools for Cross Platform Development” as well as the SDK for Windows Universal Apps.
With everything installed, you’ll be able to add a windows platform from the command line with this command:
ionic cordova platform add windows
By default the build command produces two packages: Windows 8.1 and Windows Phone 8.1, which Ionic does not support. To upgrade Windows package to version 10 the following configuration setting must be added to configuration file (config.xml).
<preference name="windows-target-version" value="10.0" />

Related

Windows application build using flutter not working on every windows machine

I am trying to build windows app using flutter. After successful build i have added msvcp140.dll, vcruntime140.dll, vcruntime140_1.dll as instructed. but still in some windows 10 and on all windows 7 machine it is crashing. Any suggestion what to do?
My release tree looks like follows:
build -> windows -> runner -> release
Data(Folder)
plugin(Folder)
bitsdojo_window_windows_plugin.lib
connectivity_plus_windows_plugin.dll
dart_vlc_plugin.dll
desktop_window_plugin.dll
flutter_windows.dll
msvcp140.dll
vcruntime140.dll
vcruntime140_1.dll
libvlc.dll
libvlccore.dll
App.exe
psg.exp
psg.lib
webview_windows_plugin.dll
WebView2Loader.dll
bitsdojo_window doesn't support all the versions of Windows that Flutter does. It unconditionally links against APIs that are only present in newer versions of Windows 10.

When doing Cordova builds for multiple platforms, should Cordova add platform be done on the specific platform and not checked in?

Since our development occurs on both macOS because it is required by iOS and on Windows for those that are not doing iOS development normally and Linux for the CI servers (except for the one that is building for iOS). Should Cordova platform add only be done locally and not checked in?
I was wondering because if I add the Xcode platform it tries to download it on Windows and Linux. Not sure if it will have issues.
Maybe I should just avoid npx cordova build and instead just limit to npx cordova build [platform]
Tracking any platform projects in platforms/ is not recommended in the Cordova ecosystem because those platform projects are considered volatile build artifacts so are liable to be wiped if you update the platform project (e.g. cordova platform rm ios && cordova platform add ios#latest).
If you want to build only Android on a non-OSX machine, after checking out the repo, you should run npx cordova platform add android && npx cordova build android

NativeScript Installation Issues

I was just trying to install NavtiveScript, for this I followed the official installation guide available at
http://docs.nativescript.org/angular/start/quick-setup but I am stuck at "Step 3: Install iOS and Android requirements"
When I run the below command in Command Prompt (with administrative privileges)
#powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://www.nativescript.org/setup/win'))"
Everything seems to be installed without any issue. But when I try to verify the installation through command, "tns doctor" I returns below warnings:
D:\>tns doctor
WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to install the Android SDK and its dependencies.
WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to build your projects for Android and run them in the native emulator.
To be able to build for Android and run apps in the native emulator, verify that you have
installed the latest Android SDK and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to install the Android SDK and its dependencies.
NOTE: You can develop for iOS only on Mac OS X systems.
To be able to work with iOS devices and projects, you need Mac OS X Mavericks or later.
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.
Run $ android to manage your Android SDK versions.
You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=24'.
Run android from your command-line to install required Android Build Tools.
You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.
Run $ android to manage the Android Support Repository.
Can anyone please guide?
I am using Windows 10, and have Visual Studio 2015 (update 3) and Visual Studio Code installed on my machine.
The command line of installing Android also didn't work for me and gave me the same errors as you. I figured out this by downloading and installing Android Studio. After your installation, you should be able to find the location of the android sdk, which is /Users/myMacUserName/Library/Android/sdk in my situation. And you could select all the needed things through SDK Manager. In the terminal, you then do 'export ANDROID_HOME=/Users/myMacUserName/Library/Android/sdk' instead of the command from NativeScript installtion instruction 'export ANDROID_HOME=/usr/local/opt/android-sdk'. After all these, you should be okay with the Android SDK errors.
https://developer.android.com/studio/index.html
Install the android studio from the above link and then after that run the studio and install the desired android sdk packages from within the studio.

ionic-box vagrant box - Install Android target: "android-22"

I'm using the latest ionic-box as of 27th April 2015. I've been able to ionic platform add android but getting the following error when ionic build android:
[Error: Please install Android target: "android-22".
Hint: Open the SDK manager by running: /home/vagrant/android-sdk-linux/tools/android
You will require:
1. "SDK Platform" for android-22
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)]
I've tried updating the sdk with the following command
android update sdk --no-ui
where I get the output of fetching a number of "https://dl-ssl.google.com/android*" File not found. However, if i copy that url and paste it on a browser the file is there.
My vagrant box is now bridged on the network to have direct access to the internet, since NAT was giving me the same errors.
Any help is much appreciated.
Follow these steps.
1) Type android on command line.(Make sure ANDROID_HOME and PATH are set properly)
2) Select API 22 from the populated list.
3) Click install packages.
4) Type android avd on command line.
5) Set API level and other config.
6) Now type ionic build android.
i work around this by changing https to http or vise versa, in options but as a quick fix
for supporting andorid API 21 like #astroanu commented this will help. it will add the support of API 21 in project.
$ cordova platforms remove android
$ cordova platforms add android#3.7.1
I was able to build an android apk by doing the following:
Open up the SDK manager after downloading/installing the android SDK (android studio). AndroidStuido>Appearance&Behavior>System Settings>Android SKD. Alternatively, you can just click on the "SDK Manager" button on the "Welcome to Android Studio" window that appears when you open Android Studio.
Under SDK Platforms, click on Android 5.1.1 - API Level 22 and hit apply to install the package.

Build phonegap windows8 project using command line

I want to build a phonegap project (on windows 8.1) for windows 8 but somehow I get an error. Building a Android project goes without any errors. When I run the command 'phonegap run windows8' I get the following error:
I also tried 'phonegap install windows8', same problem. I installed phonegap last week using 'npm install -g phonegap'. Maybe a stupid question, but how do I know I use the latest release (currently 2.9.1)? When I do 'phonegap version' it returns 3.3.0-0.18.0.
I installed cordova instead of phonegap in my command-line (npm install cordova). with cordova everything went just fine. I searched in the platform list of the phonegap install and noticed phonegap doesn't support windows 8. Very confusing since the phonegap website tells us to install phonegap instead of cordova. If anyone has question about building a app phonegap for windows 8 let me know.

Resources