Posts

Showing posts with the label Cordova

Cordova Run (in Real) Android Device Using Command Line?

Answer : You can force the run on device like this cordova run android --device If you get an error message like "No devices found" then make sure that you have developer mode and USB Debugging enabled on the device and also run adb kill-server and then adb devices should list your device and cordova run android --device should work For iOS you can run from macOS cordova run ios --device If it doesn't work, make sure you have ios-sim and ios-deploy installed and that you have your development certificate and a wildcard provisioning profile on your machine. You can open the .xcworkspace file on /platforms/ios/ and Xcode will help you to create the certificates and provisioning profiles when you try to run the app. If a real device is connected to your pc and it is recognized as well, you ca just use cordova run android and the app will start on your device. It worked for me.

Cordova Android Requirements Failed: "Could Not Find An Installed Version Of Gradle"

Answer : Solution for linux with apt-get (eg.: Ubuntu, Debian) I have quite similar problem. I obtained error: Error: Could not find an installed version of Gradle either in Android Studio, or on your system to install the gradle wrapper. Please include gradle in your path, or install Android Studi but without Exception. I solved it on Ubuntu by sudo apt-get install gradle I found also commands that allows install newest version of gradle in Ubuntu. It works only when first command is executed before (probably some dependecies are incorrect). sudo add-apt-repository ppa:cwchien/gradle sudo apt-get update sudo apt-get install gradle-ppa https://wtanaka.com/node/8079 If it does not work, try: export PATH=$PATH:/opt/gradle/gradle-3.5/bin More info: https://askubuntu.com/questions/915980/package-is-installed-and-is-not-detected-gradle/915993#915993 For CentOS Instruction of instalation gradle for CentOS is under this link https://gist.github.com/parzonka/9371885 Update Now I inst...

Cordova Info.plist NSCameraUsageDescription Key Is Missing

Answer : NEW ANSWER: Since Cordova CLI 6.5.0 you can write in the info.plist directly by using the edit-config tag in the config.xml like this: <string>your usage message</string> </edit-config> But make sure you are using latest version of the plugins or values might be overwritten by the plugin variables. For localizations you can use the resource-file tag and InfoPlist.strings files like in this plugin (but you don't need the plugin, resource-file tag is supported from the config.xml) https://github.com/MBuchalik/cordova-plugin-ios-permissions OLD ANSWER: You can't write on the info.plist from the config.xml using the config-file tag yet (it's being worked on) Latest version of the camera plugin allows you to add the NSCameraUsageDescription when you install the plugin cordova plugin add cordova-plugin-camera --variable CAMERA_USAGE_DESCRIPTION="your usage message" Right now it's not possible to localize this string Here are...

Android Widget Using Cordova

Answer : Yes, widgets are native Android constructions. But you CAN create your widget for your app with the help of cordova plugin called "cordova-plugin-ace". Made by Microsoft and opened to everyone. Documentation: Official site - http://microsoft.github.io/ace/ Doc for creating widget - http://microsoft.github.io/ace/docs/native-ui/#four I hope it'll be helpfully for you, me and others cordova devs. Widgets are android native constructs that extend a view on the application screen. http://developer.android.com/reference/android/widget/package-summary.html A cordova/phonegap app is an app with a webview backing. Note: webview not android native view. Until someone finds a way to construct a native widget that embeds a webview, then what you have been told so far is correct... i.e. "no". http://cordova.apache.org/docs/en/4.0.0/guide_overview_index.md.html#Overview http://cordova.apache.org/docs/en/4.0.0/guide_hybrid_webviews_index.md.html#...

Cordova InAppBrowser - How To Disable URL And Navigation Bar?

Answer : To remove the URL, just set the ' location ' option to " no ". var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'location=no'); On Android, this removes the 'Back/Forward' buttons, URL and 'Done' button, not just the URL, but thankfully there’s a special Android-only ‘ hideurlbar ’ option to remove ONLY the URL. var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', ‘hideurlbar=yes’); The 'Done' button text can be changed by adding a ' closebuttoncaption ' option. (Now works on Android if using InAppBrowser plugin v2.0.2 or above.) var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'closebuttoncaption=My Button Name'); On iOS, the toolbar can be removed by setting the ' toolbar ' option to " no ". var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'toolbar=no'...

Cordova - Current Working Directory Is Not A Cordova-based Project

Answer : If you are getting this error on Ionic2 This issue generally occur when we just clone / download app and try to add platform to it. its very easy to resolve, then here are the steps- just create a "www" directory in application root. "./www" can also do by this command- mkdir www now we can easily run following command - ionic platform add android or ionic platform add ios Hope it will help!!! Solution is to make sure there's a www/ directory inside the root directory. mkdir www make sure your .gitignore file doesn't include www/ directory on it. Yes, as QuickFix said, you need to be in a Cordova project before being able to use most of cordova Commands. If you are curious about what defines a Cordova project, this is what I found: Has a .cordova directory, with a config.json inside. Has a www directory, with a config.xml inside. Has a platforms directory. With that in place you can use Cordoba commands without problem. If you need examples o...