Phonegap Android Analytics plugin calling method error - android

I'm trying to add the analytics plugin to my phonegap (2.0) project. I have it working fine in iOS but in Android, I followed the instructions from the following link but it end with this error:
https://groups.google.com/d/msg/phonegap/uqYjTmd4w_E/JbKNgAQbQpUJ
Everytime I try to run the app in the simulator, I got the following error:
Uncaught TypeError: Cannot call method 'start' of undefined at file...
Is someone got the same error?
Thanks

Related

Trying to get the Xamarin xam.plugin.hud library to work on Android

I am trying to get the Xamarin xam.plugin.hud library to work on the Android phone. It works with iOS but I cannot seem to get it to work on Android.
I get this exception whenever I try to access any method from that library. The exception is:
Unhandled Exception:
System.MissingMethodException: Method not found: void AndroidHUD.AndHUD.ShowToast(Android.Content.Context,string,AndroidHUD.MaskType,System.Nullable`1,bool,System.Action,System.Action) occurred
I have tried using different versions of AndHUD and of XAM.Plugin.HUD. My target framework is Android 8.1. I can use AndHud and use the ShowToast method directly in my android project.

Getting Uncaught TypeError while calling Titanium.Filesystem.getSeperator on Android

Was trying to use the function Titanium.Filesystem.getSeperator on Appcelerator and it works well on ios. However on Android we got the following error:
[ERROR] V8Exception: Exception occurred at /scripts.js:1: Uncaught TypeError: Titanium.Filesystem.getSeperator is not a function
Anyone has any idea? Tried to google but nothing..
You have a typo in your code. It is not seperator but separator. Why it works on iOS baffles me.
Always check the docs and verify your code. When it says method is not defined, it should ring a bell

Angular-Meteor package on Android device is throwing "Unexpected token <"

I was able to run my Angular-Meteor Cordova application no problem until I made a minor change. Now whenever I run meteor run android-device it tries to start the application on the device but when it starts has trouble loading the packages. This is the log out put:
=> App running at: http://localhost:3000/
=> Started app on Android Device.
I20160308-12:51:21.879(0) (android:http://meteor.local/packages/angular_angular.js:1) Uncaught SyntaxError: Unexpected token <
I20160308-12:51:21.954(0) (android:http://meteor.local/packages/angular_angular-animate.js:32) Uncaught TypeError: Cannot read property 'noop' of undefined
I20160308-12:51:21.955(0) (android:http://meteor.local/packages/angular_angular-sanitize.js:42) Uncaught TypeError: Cannot read property '$$minErr' of undefined
I20160308-12:51:21.955(0) (android:http://meteor.local/packages/angularui_angular-ui-router.js:49) Uncaught TypeError: Cannot read property 'isDefined' of undefined
I20160308-12:51:22.359(0) (android:http://meteor.local/packages/driftyco_ionic.js:13355) Uncaught ReferenceError: angular is not defined
...
Oh, I should say this runs on the desktop fine.
----- Update -----
I've inspected the WebView with Chrome and weirdly enough the offending file angular_angular.js seems to contain HTML! See picture below:
This is totally different from the contents of the same file on the desktop, which contains valid javascript.
After inspecting the webview via Chrome I discovered the mobile was using old application files. Answer was to go into the settings -> apps -> myapp and clear the cache/local files.
I thought this would have been expired by meteor but it's not the case. Or perhaps it didn't do it one time because of an error. I'll find out soon enough, but if not I'll have to figure out a way to stop the caching of obsolete files.

How to use phonegap-facebook-plugin in ionic?

I'm building an app in ionic/Cordova in which I want my users to be able to log in using Facebook. So I'm trying to install the PhonegapFacebookPlugin that I found on ngCordova.com.
The first thing that I noticed was that the docs on the ngCordova.com website for installing the plugin on Android are different from the docs on the project's github docs. So I first tried using the (simpler) instructions on the github page first, which after installing and trying to use the following code:
facebookConnectPlugin.login(['email'],
function(data){ console.log(JSON.stringify(data));},
function(error){console.log(error);});
led to these errors:
file:///android_asset/www/lib/phonegap-facebook-plugin-master/facebookConnectPlugin.js: Line 181 : Uncaught ReferenceError: require is not defined
file:///android_asset/www/js/app.js: Line 23 : Uncaught TypeError: Cannot read property 'Keyboard' of undefined
file:///android_asset/www/lib/ionic/js/ionic.bundle.js: Line 19387 : TypeError: Cannot call method 'login' of undefined
at Scope.$scope.fbLogin (file:///android_asset/www/js/controllers.js:10:31)
at $parseFunctionCall (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:20124:18)
at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:50863:9
at Scope.$eval (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:22178:28)
at Scope.$apply (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:22276:23)
at HTMLButtonElement.<anonymous> (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:50862:13)
at HTMLButtonElement.eventHandler (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:10823:21)
at triggerMouseEvent (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:2811:7)
at tapClick (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:2800:3)
at HTMLDocument.tapTouchEnd (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:2918:5)
After running into these errors, I tried continuing with the more extensive installation instructions on the ngCordova website, but the following command:
android update project --subprojects --path "platforms/android" --target android-19 --library "com.phonegap.plugins.facebookconnect/FacebookLib"
led to the following error:
Resolved location of library project to: /Users/kramer65/repos/my-app/platforms/android/com.phonegap.plugins.facebookconnect/FacebookLib
Error: Project folder '/Users/kramer65/repos/my-app/platforms/android/com.phonegap.plugins.facebookconnect/FacebookLib' is not a valid directory.
Error: No Android Manifest at: /Users/kramer65/repos/my-app/platforms/android/com.phonegap.plugins.facebookconnect/FacebookLib
This makes sense, because there is no folder called com.phonegap.plugins.facebookconnect/ in the platforms/android/ folder. I don't really know why not though. Do I need to copy-paste it there? Or did something go wrong in a previous step?
I'm stuck here and I really need to get this working. Any help would be greatly appreciated!

Camera Plugin Issue on Phonegap 3.3

I'm trying to use the Full Example given in:
http://docs.phonegap.com/en/3.3.0/cordova_camera_camera.md.html#camera.getPicture
I've created a project, added platform Android, added the Camera Plugin,
Then I've copied the example as is into index.html .
Ran it on an Android 4.3 device, I see an error in the Eclipse's console:
01-22 19:48:26.661: E/Web Console(22707): Uncaught TypeError: Cannot read property 'PictureSourceType' of undefined:19
(Yes onDeviceReady() is fired like it should)
What am I doing wrong ?
Thanks.
Try changing:
pictureSource=navigator.camera.PictureSourceType;
to:
pictureSource=navigator.camera.PictureSourceType.CAMERA;
If you use phongap build you have to add:
<gap:plugin name="org.apache.cordova.core.camera" />
to your config.xml no need cordova add plugin etc..
From what I've experienced with this camera plugin, sometimes the plugin won't expose the window.camera as is. Instead, try to access it through window.plugins, and if that doesn't work either, try using ngCordova with which you will be able to get it working faster.
You should also know that there are some bugs in Android which may crash the Android app.

Categories

Resources