I'm facing an issue using ionic creator, how can I upload an image from the phone gallery ?
What I tried (most relevant tries) :
followed this tutorial : https://forum.ionicframework.com/t/how-to-user-ngcordova-with-ionic-creator/68619/2 to set the environnement with "ionic-native.min.js".
=> Get : Uncaught SyntaxError: Unexpected token (
ionic.bundle.js:13443 Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:nomod] Module 'app' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
Tried to use "imagepicker" (without the warranty that I really have installed the plugin in my environnement, because in the creator I can't install sources from the web. So, crossed fingers and hope "ionic-native.min.js" provides it.) : https://ionicframework.com/docs/native/image-picker/
=> still not working.
An finally I tried this : http://blog.ionic.io/ionic-native-accessing-ios-photos-and-android-gallery-part-2/
=> For the exact same result : white screen and errors.
I'm testing the app with both the web browser emulator (which I know sometimes doesn't work with cordova functions) and the ionic creator app on iphone. I'm sure someone have already faced and succeed this problem, thank you guys.
All you have to do is adding cordova-plugin-camera to your project, it should works like a charm (Ionic 2.x) :
ionic cordova plugin add cordova-plugin-camera
Related
I want show custom splash screen with animation. I tried add LottieSplashScreen plugin but i can't do this.
Tried with this code
cordova plugin add cordova-plugin-lottie-splashscreen
But i facing
'sh' is not recognized as an internal or external command,
operable program or batch file.
Failed to install 'cordova-plugin-lottie-splashscreen': Error: Hook failed with error code ENOENT: C:\Users\bbara\Desktop\GuvercinSepetim\plugins\cordova-plugin-lottie-splashscreen\hooks\ios\update_pod_repo.sh
at C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:224:23
at _rejected (C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:864:24)
at C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:890:30
at Promise.when (C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1142:31)
at Promise.promise.promiseDispatch (C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:41)
at C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:624:44
at runSingle (C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:137:13)
at flush (C:\Users\bbara\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:125:13)
at processTicksAndRejections (internal/process/next_tick.js:74:9)
Hook failed with error code ENOENT: C:\Users\bbara\Desktop\GuvercinSepetim\plugins\cordova-plugin-lottie-splashscreen\hooks\ios\update_pod_repo.sh
You are running a cordova node but not ionic cordova:
cordova plugin add cordova-plugin-lottie-splashscreen
According to ionic documentation:
npm install #ionic-native/lottie-splash-screen
ionic cordova plugin add cordova-plugin-lottie-splashscreen
And here is the referance:
https://ionicframework.com/docs/native/lottie-splash-screen
And here is the github reposatory of the plugin :
https://github.com/timbru31/cordova-plugin-lottie-splashscreen
Try looking into Capacitor instead of Cordova. You can still use all your Cordova libraries, but the Capacitor build is a bit cleaner. I followed this tutorial and found it very useful with good tools. It worked for me first time, which is never the case with some Ionic stuff!
https://enappd.com/blog/icon-splash-in-ionic-react-capacitor-apps/114/
The issue you are describing was fixed in the v0.8.1 release. It originated from preparing/building the iOS platform on a Windows machine - which won't work anyways. Because cordova-ios supports recent Pod installations out of the box, it's no longer required to sync the repo, i.e, the hook is obsolete. However, the lottie plugin won't fail anymore.
Side note: I'm the author of this plugin.
following the official getting started tutorial I get the following error when I try to deploy the application in my phone using this command: ionic serve --devapp (it works on browser):
[ERROR] Could not find cordova integration in the default project.
I get this error both on Windows and MacOS.
I'm using Node 6.4.1 and Ionic CLI 4.10.3
Does the official tutorial missing something?
I had the same issue. In fact, with the default project, you have to copy the cordova assets to prepare the native build for mobile.
You can find more info here : Ionic documentation
Try this :
ionic cordova prepare
And then go again with :
ionic serve --devapp
The accepted answer is 100% correct .
But the reason why this occurred for me was that somehow the default was capacitor and not cordova.
so first i ran
ionic integrations disable capacitor
then ran
ionic cordova prepare
which solved my issue
I'm installing Ionic with the aim of learning this Framework, but I'm not getting results when I give the command ionic serve .... I get the following error: [ERROR] Sorry! ionic serve can only be run in an Ionic project directory.
error
While I create my project files, I do not know if these are well named .... I attach a photo of these
explorer
I have installed Node, Apache Cordova and Ionic ... I do not know what's happening ... any help for me?
Do that inside primerapp folder
I have searched all over to get this answer but nothing works.
I am building an iPad app in Ionic 2 that uses various native plugins.
I want to be able to test the native features and observe the console logs but nothing gets logged, using either the ios emulator or an iPad device.
Ideally I also want livereload but I'll take what I can get.
I eventually got to display console logs in Xcode but that involves running
cordova platform prepare
then running the process from Xcode manually every time I make a single edit. This takes much longer than
ionic cordova run ios --target="iPad-Air" -c
Why can I not just see the logs when I use run?
I have looked at where it says the console.log file is saved to but no file gets created. I created the file myself and gave it full 777 permissions and still nothing.
ionic info:
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.0.1
Cordova Platforms : browser 5.0.3 ios 4.5.2
Ionic Framework : ionic-angular 3.7.1
System:
ios-deploy : 1.9.2
Node : v8.8.0
npm : 5.4.2
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
To help anyone else who has trawled the forums and tried all the solutions where it seems everyone else can console.log except you, I will post what I have discovered. This is not a total solution but may identify the cause for some.
I was specifying the target as iPad-Air. When I didn't, the simulator started in iPhone-6. That is not what I wanted but there in my console was a very welcome console log message.
So I experimented a little and found that iPad-Air 10.0 and iPad-Air-2 10.0 and above will log to the console but 9.3 and lower (Not tested exhaustively) would not.
So for me, this solution will let me continue to develop with livereload and console logs and what's left of my hair.
Hopefully it will save someone else's hair loss too.
FYI you can set your chosen device as a project default in platforms/ios/cordova/lib/run.js in the deployToSim function. There should be a line like if (emulator.indexOf('iPhone') === 0) { swap out 'iPhone' (or whatever it is for you) and replace it with 'iPad-Air-2, 10.0' or whatever you need and have available in your simulator list. ios-sim showdevicetypes
Good luck!
Windows Phone 7 app development with cordova 2.3.0. I get the error 'Unable to locate command :: org.apache.cordova.facebook.Connect' on FB.login. I started off with the code base that works fine in Android. What am I missing or not doing right on Windows? Any detailed documentation about PhoneGap WP7 and Facebook plugin integration?
try to set the namespace in call method:
look my example:
Cordova.exec(null, null, "WP7GapClassLib.PhoneGap.Commands.MyCommand", "SendRequest", args);