I have been trying to get my camera to work on iOS for a couple days now. I found this Ionic Cordova Camera not working, but when I get to the part that says to put this into the command line "cordova plugin add org.apache.cordova.camera" it returns this error "Error: Registry returned 404 for GET on https://registry.npmjs.org/org.apache.cordova.camera" I tried finding why it was returning that error but can't find a good response.
I also did the add before and still nothing.
EDIT I was able to do a little more digging and found an error "Error: Can't find variable: Camera"
I should add that this works just fine on android but iOS wants nothing to do with the camera.
run below command in your working directory. That will add camera plugin in your projects.--save flag will save your plugin in config.xml file.
cordova plugin add cordova-plugin-camera --save
cordova plugin add cordova-plugin-camera
Related
I'm using expo managed flow to develop my app and I'm trying to use camera roll in order to show some images.
I'm using expo's MediaLibrary and once I grant access to the camera roll via MediaLibrary.getPermissionsAsync() then, I try to call MediaLibrary.getAssetsAsync() but my android crashes. Everything works on IOS.
Note: when I add MediaLibrary.getAssetsAsync({ after: "" }) it does not crash but I've got an error where it says that "after key should be valid ID"...
Anyone knows what's the issue here?
I had the same inssue, I solved by doing this:
=>Run expo upgrade in your project directory (requires the latest version of expo-cli, you can update with npm i -g expo-cli).
They corrected in Expo SDK 39~40, mine was 38
I am developing a mobile app with using react-native on WebStorm and trying to test it via an Android emulator(Pixel API 28) which I created via using AVD Manager of Android Studio. The problem is when I run the react-native run-android command, I get the following error:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration
':app:debugRuntimeClasspath'.
> Could not resolve com.facebook.react:react-native:+.
Required by:
project :app
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from
https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
> Could not HEAD
'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/35.158.228.205, jcenter.bintray.com/3.120.47.203] failed: Read timed out
I tried to clean up the cache with using the command below but it did not worked:
npm cache clean --force
I could not find some similar problems on the web and I am not sure what to show related with this problem.
When I try to run one of my previous project which was perfectly running, after getting this error and I saw that it also throws the same error. Similarly, when I create a new react-native project and try to run it, then I also got the same error. How can I solve this?
I am still loking for a solution. Anyone knows how to solve it?
I finally figured out the problem. I was connecting to internet via my school's network and it was restricting some downloads. So, that is why I got this error. For the ones who encountered with the same error, try to connect to the link in the error to if it is forbidden or not.
I got a Meteor project from a friend who develops on MacOS.
When trying to run it, I get:
This project uses METEOR#1.0.2.1, which isn't available on Windows. To
work with this app on all supported platforms, use meteor update
--release METEOR#1.2.1 to pin this app to the newest Windows-compatible release.
When running it, I get:
While checking for cfs:gridfs#0.0.27: no compatible binary file
found...
Then, when I try to override (use run instead of update), without actually updating, it starts proxy and Mongo, but then breaks at, but skips the first error
While building package npm-container: error: No plugin known to handle
file '../../packages.json'. If you want this file to be a static
asset, use addAssets instead of addFiles; eg,
api.addAssets('../../packages.json', 'client').
I read that this error is fixed by updating meteorhacks, but when I try to, I get the Meteor version conflicts (see very first error) and I have no idea how to break out of the loop.
Can someone shine some light on how to fix any of these error?
Everything works fine except there is no output when calling console.log(...) in the Browser window log (Netbeans).
I created a new HTML5 (Cordova Application) project in Netbeans.
I start the android emulator (Intel Atom x86 API Level 19. Galaxy Nexus. With Use Host GPU option checked). Then build/run the project BUILD SUCCESSFUL (total time: 10 seconds) and I can see the app running in the emulator with the 'Device is ready' text blinking.
But there is not console log output. I have made sure the Debugger Console plugin is selected (inside the project properties). I also have added android:debuggable="true" inside <application .../> tag in AndroidManifest.xml file. And still no console log output.
I have also tested with API 21 and still no ouput from console.log
What am I missing?
I'm using cordova 4.3.0, Netbeans 8.0.2, Java version: 1.8.0_45, Apache Ant 1.9.4.
Thanks in advance.
UPDATE: I can see the log entry with DDMS but since I'm using Use Host GPU, Logcat is spammed with an error and by the looks of it, the filter doesn't work as expected and sometimes it stops logging for whatever reason (DDMS). At least I know the console.log call works inside the javascript. By the looks of it, DDMS is buggy.
I think I found out why Netbeans isn't picking up any log output.
Debugger console seems to only work for Xcode and/or maybe Netbeans isn't configured to get any log from LogCat. Cordova redirects console.log calls to their respective platform logger. That's why I can see the log entry just fine with adb logcat -s "CordovaLog" (CordovaLog being the tag to filer).
Edit:
Netbeans doesn't connect fast enough and it doesn't show you earlier logs. I recommend to use Chrome remote debugging instead of Netbeans.
While this is not a direct answer to your question, NetBeans personally recommends that you use Chrome with their extension for HTML5 projects:
https://netbeans.org/kb/docs/webclient/html5-gettingstarted.html
Hope that works for you!
2 things that might help: Make sure you have Cordova plugin called "Debugger Console" in your project
Second thing try to use NetBeans dev build from here . The dev build contains importnant fix - IDs of core Cordova plugins has been changed recently and as a result NetBeans could be removing these plugins from build when building the project.
I am currently working on a rather large PhoneGap project using a handful of cordova plugins and I'm experiencing dificulties using the Network Information plgin to retrieve the connection type of the device.
It should be noted that I'm using the command line tool to build my PhoneGap project, not Adobe's "Build" service.
The versions of the phonegap and cordova cli tools are the following:
% phonegap -v
4.2.0-0.23.0
% cordova -v
4.2.0
Here is the list of plugins currently in use:
% phonegap plugins
com.darktalker.cordova.screenshot 0.1.0 "Screenshot"
nl.x-services.plugins.socialsharing 4.3.14 "SocialSharing"
org.apache.cordova.console 0.2.13 "Console"
org.apache.cordova.device 0.3.0 "Device"
org.apache.cordova.inappbrowser 0.6.0 "InAppBrowser"
org.apache.cordova.network-information 0.2.15 "Network Information"
Here is the code responsible for using the plugin, it's located in a much larger object and is only called when I open to a certain page of the project:
checkDeviceConnexion:function(){
require(['cordova', 'cordova_plugins'], function(cordova){
checkConnexion();
});
function networkConnexion(){
if (navigator.connection.type == 'none'){ //Connection.NONE
return false;
}
return true;
}
function checkConnexion(){
if (!networkConnexion()){
app.showMsgError(tradu[lang]['msg-error-connexion']);
}
}
}
I'm doing my tests on android therefor I'm using adb as a mean to debug the application. When I run the code above, this is what I get:
I/chromium(12465): [INFO:CONSOLE(1145)] "Uncaught TypeError: Cannot read property 'type' of undefined", source: file:///android_asset/www/js/app.js (1145)
I scrapped and rebuilt the android project several times to make sure that all plugins were properly copied but it didn't help.
What's even more puzzling is that the output of the adb hints that somehow somewhere the network manager should be working properly as shown here:
D/CordovaNetworkManager(21764): Connection Type: wifi
D/CordovaNetworkManager(21764): Connection Extra Info: "atelier8"
But I'm unable to see the connection property in the navigator object.
Has anyone experienced similar issues? Any idea on how to fix this problem?
Thanks in advance for any tip or answer.