How to release windows build of ionic app? - ionic-framework

I am trying to release windows build of ionic app used below two command ionic platform add windows and ionic build windows but at the time of run second command getting following error at cmd
D:\#Ionic\ChefsRecipes>ionic build windows
Running command: "C:\Program Files\nodejs\node.exe" D:\#Ionic\ChefsRecipes\hooks\after_prepare\010_add_platform_class.js D:\#Ionic\ChefsRecipes
add to body class: platform-windows
Error: No valid MSBuild was detected for the selected target.
I have set PATH variable to "C:\Windows\Microsoft.NET\Framework64\v4.0.30319;". I am using windows 8.0 please suggest me right step for release build for windows ?

Related

after ionic v3 to ionic v5 migration - ionic build command not working

We have migrated from ionic v3 to ionic v5 ... ionic serve command working but showing blank page when launched.
ionic build command throwing following error..
[11:57:17] ionic-app-script task: "build"
[11:57:17] TypeError: Cannot read property 'compilation' of undefined
TypeError: Cannot read property 'compilation' of undefined
at DefinePlugin.apply (/Users/upgrade/node_modules/webpack/lib/DefinePlugin.js:280:18)
at Compiler.apply (/Users/upgrade/node_modules/#ionic/app-scripts/node_modules/tapable/lib/Tapable.js:375:16)
at webpack (/Users/upgrade/node_modules/#ionic/app-scripts/node_modules/webpack/lib/webpack.js:33:19)
at /Users/upgrade/node_modules/#ionic/app-scripts/dist/webpack.js:132:24
at new Promise ()
at runWebpackFullBuild (/Users/upgrade/node_modules/#ionic/app-scripts/dist/webpack.js:113:12)
at webpackWorker (/Users/upgrade/node_modules/#ionic/app-scripts/dist/webpack.js:70:19)
at Object.webpack (/Users/upgrade/node_modules/#ionic/app-scripts/dist/webpack.js:29:12)
at bundleWorker (/Users/upgrade/node_modules/#ionic/app-scripts/dist/bundle.js:13:22)
at Object.bundle (/Users/upgrade/node_modules/#ionic/app-scripts/dist/bundle.js:6:12)
[ERROR] An error occurred while running subprocess ionic-app-scripts.
ionic-app-scripts build exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
we need to use this project for all 3 platform i.e. browser, android and ios .. so for that purpose we need www folder with files. ionic build command achieve this.
how should i fix this ...
Create a new project using ionic 6, migrate cordova plugins to capacitor and copy over code. This is your best bet. Goodluck.

Issue in setting up the Android emulator with React native

I am fairly new to React native and trying to set up Android environment with Visual studio. All the installation has been fairly successful, however, when I try to run the sample app on the android emulator executing the npx react-native run-android command it shows below error -
'C:\Users\Home' is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:109)
However, when i execute adb devices on visual studio, it shows the list of emulator connected -
List of devices attached
emulator-5554 device
What could be the possible reason? Is this because my users name is Home PC? (Is this because there is a space in between) and it is not able to get the correct path?
This is because your java version is updated to the latest version and gradle is not supported with the installed version. what you can do is update the gradle as well
So go to gradle/wrapper folder inside the android folder
Edit gradle-wrapper.properties file and replace distributionUrl
with following value
https\://services.gradle.org/distributions/gradle-6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
I too faced the same issue.The problem is with the JDK. From JDK 14 i downgraded to JDK 11(LTS) version. And it worked.
Hope it helps.
Install Java 8 version, which is available Java 8 download
Gradle is not keeping up with the Java Latest versions, so roll back
to previous versions

Ionic 2: error while running on Android platform

I'm using Ionic 2 when I used the command ionic cordova run android I had this error:
Fetching plugin "mx.ferreyra.callnumber#~0.0.2" via npm
ERROR running one or more of the platforms: Android SDK not found.
Make sure that it is installed. If it is not at the default location,
set the ANDROID_HOME environment variable.
You may not have the required environment or OS to run this project.
Can anyone tell me the solution?
Make sure that you have Android Studio installed. If it is, then set the environment variable mentioned in the error to the directory of where your SDK is,
on Windows %AppData%/Local/Android/SDK

Ionic run / build not working

when execute "ionic run android " nothing happens !!!
No Errors, No Messages - what happens?
I had the same issue, dropping my version of Node to 4.2.1 fixed it.
See: Ionic run does nothing
I thing the steps below can help, at least you can get a better log, to solve your problem:
Make sure you added a platform to your project
$ ionic platform add android
Once you have a platform try to run using cordova
$ cd {YOUR_PROJECT_DIR}/platforms/android/cordova
$./run
i just got in same kind..!
so,just check setup with ionic info command
Your system information:
Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.1.0
Ionic CLI Version: 1.7.12
Ionic App Lib Version: 0.6.5
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.2 LTS
Node Version: v5.4.0
i just upgrade cordova version to 5.4.1
this setup,worked for me..!
fix is here (FOR WINDOWS ONLY)
I am facing the same problem of Build then i finally found out the solution.
SOLUTION
So You must have the Android Api 23 in order for this command to work.
Error of Daemon process will be solve after installing the Api 23 and extra build tools and run command
COMMAND : cordova build android --release
I am sure this fix would help you to solve the problem.
STEPS
1. First check the version of android through this COMMAND:
cordova platform help
2. Run the build command after installing the Api 23 and extra build tools.
3. If Even this not work then Try add the variable in the
Environment variables > System variables >
add _JAVA_OPTIONS and value = -Xmx512M
Then Run cordova build android --release
BUT FIRSTLY SET UP THE ENVIRONMENT VARIABLES
Environment Variable setup Image
android API 23
COPY FROM HERE
ENVIRONMENT VARIABLES:-
USER VARIABLES
PATH
C:\Ruby23\bin;C:\Users\kumar\AppData\Roaming\npm;C:\ANDROID_SDK\tools;%SystemRo
ot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;
SYSTEM VARIABLES
ADD NAME AND VALUE
2.1 _JAVA_OPTIONS -Xmx512M
2.2 ANDROID_HOME C:\ANDROID_SDK
2.3 PATH ->
C:\ProgramFiles\Java\jdk1.8.0_60\bin;C:\ProgramFiles\nodejs;C:\Gradle\gradle-4.0\bin;C:\ANDROID_SDK\tools;%SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;%SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;

Netbeans cannot create build/create cordova application

I try to create a sample Cordova project in Netbeans after starting an Android emulator.
This is exactly what I am getting when I run the project:
cordova.cmd -d create C:\DOCUME~1\user\LOCALS~1\Temp\/nb_temp_project com.coolappz.Cordova Cordova
Creating a new cordova project with name "Cordova" and id "com.coolappz.Cordova" at location "C:\DOCUME~1\user\LOCALS~1\Temp\nb_temp_project"
Using stock cordova hello-world application.
cordova library for "www" already exists. No need to download. Continuing.
Copying stock Cordova www assets into "C:\DOCUME~1\user\LOCALS~1\Temp\nb_temp_project\www"
Copying 6 files to C:\Documents and Settings\user\My Documents\netbeans7.41projects\Cordova
Deleting directory C:\DOCUME~1\user\LOCALS~1\Temp\nb_temp_project
Deleting directory C:\Documents and Settings\user\My Documents\netbeans7.41projects\Cordova\www
Copying 13 files to C:\Documents and Settings\user\My Documents\netbeans7.41projects\Cordova\www
create-android:
cordova.cmd -d platform add android
cordova library for "android" already exists. No need to download. Continuing.
'C:\Documents' is not recognized as an internal or external command,
Checking if platform "android" passes minimum requirements...
Creating android project...
Running command: cmd args=["/c","C:\\Documents and Settings\\user\\.cordova\\lib\\android\\cordova\\3.4.0\\bin\\create","--cli","C:\\Documents and Settings\\user\\My Documents\\netbeans7.41projects\\Cordova\\platforms\\android","com.coolappz.Cordova","Cordova"]
Command finished with error code 1: cmd /c,C:\Documents and Settings\user\.cordova\lib\android\cordova\3.4.0\bin\create,--cli,C:\Documents and Settings\user\My Documents\netbeans7.41projects\Cordova\platforms\android,com.coolappz.Cordova,Cordova
operable program or batch file.
C:\Documents and Settings\user\My Documents\netbeans7.41projects\Cordova\nbproject\build.xml:145: exec returned: 1
BUILD FAILED (total time: 5 seconds)
First, try to run your project in web browser before you build in Android application. If there is no error or bug, then compile the project to Apk. you have to connect internet while in progress