I am using Ionic Framework v5 with Vuejs (created with ionic start).
It builds in production mode, but I want to build in development mode.
I build with ionic build, and it outputs:
> vue-cli-service build
⠴ Building for production...
When I run vue-cli-service directly - I get the same output.
When I run vue-cli-service build --mode development - it builds in development mode.
I tried ionic build --mode development, but it still builds in production mode.
I tried various additional configuration changes, but couldn't get ionic build to build in development.
How can this be done?
When building in production mode - the code gets minified. How can I skip the minification?
UPDATE: I get the same results when I try to run it with ionic build -lcs:
user#ubuntu:~/project (master)$ ionic build -lcs
> vue-cli-service build
⠼ Building for production...Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
⠦ Building for production...
I'm using Ionic 6 instead of 5 but running the below command as shared in this answer should do the trick.
ionic build -- --mode development
you can try
ionic build -lcs
or if you are trying with cordova then and run un device
try this command
note : datacable must be connect to device all the time
ionic cordova build android --device -l
run in emulator :
ionic cordova emulate android -l
Please use Following code for only in browser
ionic serve -w chrome
for future reference please follow :
https://ionicframework.com/docs/cli/commands/cordova-run
https://ionicframework.com/docs/developing/previewing
Related
I am new to Ionic while build the app in android. Its opening a project in Android Studio but while gradle sync its showing the following error
Could not read script 'F:\IonicProjects\mis-tracking-master-latest\mis-tracking-master\mis-tracking\android\capacitor.settings.gradle' as it does not exist.
Try to sync your Ionic project by command:
ionic capacitor sync android
JUST DO
npx cap sync android
If you only use capacitor from (Vuejs, nuxtjs, etc.)
Same thing happen to me. I did a
npm install --save #capacitor/core #capacitor/cli
and this fixes it.
change the name of my file /android/settings.gradle to capacitor.settings.grandle works for me
just do
npm install jetifier
npx jetify
npx cap sync android
Capacitor troubleshooting
https://capacitorjs.com/docs/android/troubleshooting
Over folder project execute: $ capacitor update android
On Android Studio execute: File -> Sync Project with Gradle Files
run ionic build before you run npx cap add android
This is what solved it for me:
I'm using next/JS and I export it. So the build folder is not "build", it is "out".
Just go to the capacitor.config.json and change the webDir property to out
After upgrading my dependancies, I cannot build android on the simulator with the command "npx react-native run-android" but it builds if I build using android studio
you can try in this way
- yarn start
- open android folder with android studio
- sync with gradle files
- run in android studioi
Goal:
I would like to be able to run detox tests for an expo app with Travis.
I created a bare-bones expo app that successfully runs a single detox test on my local machine. After pushing to git and running on Travis, all dependencies install successfully and then the Travis build scripts fail with the following error.
Error:
Error: Could not find build script in detox.configurations["ios.sim"].build
Issue:
It looks like the issue occurs because there isn't a "build" entry in the "ios.sim" configuration for "detox" in package.json. For a non-expo React Native project with detox, the corresponding .xcodeproject or .xxworkspace can be built directly. Expo doesn't have a .xcodeproject or .xcworkspace - what to put for the "build" configuration for an Expo project? While there is an Exponent.the app provided by the expo to run tests with detox, I don't see any .xcodeproject or .xcworkspace to build with.
Repro steps:
Clone git#github.com:bryanboyko/expo-detox-travis-3.git
cd expo-detox-travis-3
npm install
./setup.sh
detox test
push to a new branch and create a PR to see travis build
Travis failure log:
https://travis-ci.com/bryanboyko/expo-detox-travis-3/builds/151879107
i have a problem with react native in ubuntu, i have installed,
java jdk 8 (both javac --version) as well as echo $JAVA_HOME gives the proper output.
I have also installed android studio and set the android environment variables as well as the tools and echo $ANDROID_HOME gives output of the sdk location.
I have also installed gradle version 4.4.
I am unable to start the android app using react-native run-android. can any one let me know if i have missed something during installation.
And react-native as well as android studio works fine as I am currently using react-native start to start the metro builder as well as the other react-native cli commands. also android studio and gradle is also able to generate debug as well as release apks with no problems.
The error i get,
Scanning folders for symlinks in /home/igate-naveed/Documents/ReactNative/mobile-app-android/node_modules (16ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
First of all you need to create a project like this:
react-native init myProjectName
Then, start an emulator from Android Studio... Afterwards:
npm install && npm start
in your project directory, and from another terminal, inside your project directory, run :
react-native run-android
Is this working?
Instead of using the npm install manager, I used yarn and it worked for me. In your project directory, just do:
(project-directory)$ yarn
Update the gradle version.
Create new project:
react-native init projectname
Uninstall the npm pack.
Reinstall the npm pack again.
npm start
react-native start
react-native run-android
By following nativescript docs, installed all dependencies and tns doctor dont find any error.
and followed a tutorial and ran the following commands,
npm install -g #vue/cli #vue/cli-init
vue init nativescript-vue/vue-cli-template hello-vue
cd hello-vue
npm install
All sets fine and then i did my coding for an simple app then i ran below command:
npm run watch:android
This deploy the app in my connected android phone.
so my question is how can i get the apk file, so that i can send to another person?
Note: sidekick even not opening my folder. and when running tns build android shows No project found at or above 'C:\wamp64\www\newapp' and neither was a --path specified.
For building the apk for android, use the following command:
tns build android --release --key-store-path <path-to-your-keystore> --key-store-password <your-key-store-password> --key-store-alias <your-alias-name> --key-store-alias-password <your-alias-password>
Lots more info here : https://docs.nativescript.org/tooling/publishing/publishing-android-apps
If you want to get the debug apk using tns debug android --bundle, it will be located here :
<your project folder>/platforms/android/app/build/outputs/apk/debug/app-debug.apk
If you are having trouble running tns, install nativescript globally using:
npm i -g nativescript
And follow the simple prompts.
I'm not sure if this is what you're looking for (it sounds like you want a debug.apk instead of an output.apk), but you might want to look at the documentation for publishing an Android app.