Hi all, I’m new to the Capacitor party so I have got some newbie questions
Unlike Cordova, no more config.xml, so we have to manage Info.plist and AndroidManifest.xml. Do you guys then only commit these files in your repo or do you commit the all “platforms” or do you commit nothing? What’s the general best practice there to ensure the lifecycle of the app
If I want to write hooks (I know myself, at some point I gonna remove plugins and platforms and gonna add them again), is there something specific to Capacitor in order to chain them or should I take care of it by myself? I meant, with Cordova I was writing “Cordova’s hook” (https://cordova.apache.org/docs/fr/latest/guide/appdev/hooks/), is there any look a like idea with Capacitor?
About the Camera, as far as I saw, no Gallery support yet. Is that something in the roadmap? Same question for supporting result of type FILE instead of Base64?
Thx in advance for any hints and congrats for the alpha release. Works fine and documentation is super easy to understand!
P.S: Asked the same questions on the slack channel
We only change the info.plist and AndroidManifest on capacitor add platform to set the name and identifier/package name, then you manage it as you wish. Unlike Cordova, in Capacitor apps, the ios and android folders (where the native apps are), are not build artifacts, we won’t change them ever, so you have to commit them.
We don’t have hooks so far, or events where to hook them, so you should run them manually for now.
It has gallery support, at least on iOS, should double check Android. About FILE, probably.
I tried to ran my demo with ionic serve but was unable to run neither the camera or the geolocation in a browser, face errors with both of them in my browser. If I understand the doc (https://capacitor.ionicframework.com/docs/web/) basically I have nothing to do, everything should be handled by the cli right? or do I miss something?
ionic serve not yet supported. first build the app and then run npx cap serve. Furthermore the following need to be added in index.html (I guess till a better solution)
What is the size (width/height) of the photo taken with Camera.getPhoto? max width/height according the device used or a defined size? These options are also in the roadmap?
are you getting issues opening Studio after running npx cap open android for the first time? I need to set “windowsAndroidStudioPath” to a proper location (instead of some sort of H-folder). Easy fix to put it the new config in capacitor.config.json. I bet there is some feature request to automate this using PATH?)
android studio is complaining “Unregistered VCS root detected”. Probably not a big deal. So I skipped it.
When I run, it wants me to select Android SDK first. So through Stackoverflow I found a fix : Tools -> Android -> Sync Project with Gradle Files (Android Studio 3.0.1)
-> in android studio, i see under app->java three folders, the one related to my project and two unknown com.getcapacitor.myapp (androidTest) and com.getcapacitor.myapp (test). What are those
The camera plugin worked on a Galaxy TAB A 10.1. But not on my emulator (Pixl2 with emulated camera - the camera app works).
I didn’t faced that problem. I’m on a Mac that could be the reason why.
Agree with you safe to ignore. One the Git repo is safe, this warning will disappear. Android Studio is based on IntellIJ and that’s a typical IntellIJ information.
Didn’t had this neither but Android Studio made a lot of updates the first time I ran my test project
In Android Studio which tab did you opened? When I check my Project view it does look like the following:
Also may I ask you @Tommertom, where you able to add the iOS platform?
I’m still facing issue and can’t try iOS with capacitor
when I do
ionic start captest
cd captest/
npm install --save @capacitor/core @capacitor/cli
npx cap init captest com.something.captest
ionic build
npx cap add ios
I get
iOS found these plugins: []
[info] No Capacitor plugins found. That's ok, you can add more plugins later by npm installing them.
X Updating iOS native dependencies: undefined
X update ios: undefined
(node:3593) UnhandledPromiseRejectionWarning: Analyzing dependencies
Fetching podspec for `CordovaPlugins` from `../../node_modules/@capacitor/cli/assets/capacitor-cordova-ios-plugins`
Fetching podspec for `CordovaPluginsResources` from `../../node_modules/@capacitor/cli/assets/capacitor-cordova-ios-plugins`
[!] Unable to find a specification for `Capacitor`
D:\Data\Coding Projects\ionic\capitest>npx cap add ios
D:\Data\Coding Projects\ionic\capitest\node_modules\@capacitor\cli\bin\capacitor
[error] Not running Mac OS X, can't add ios platform
Simple as that…
(there is an issue raised on their github for this)