countly / countly-sdk-cordova Goto Github PK
View Code? Open in Web Editor NEWCountly Product Analytics SDK for Cordova, Icenium and Phonegap (Archived, Sunsetted)
License: MIT License
Countly Product Analytics SDK for Cordova, Icenium and Phonegap (Archived, Sunsetted)
License: MIT License
I noticed that on android I was only getting the first segment.
I think the problem is in the loop in CountlyCordova.java
for(int i=3,il=5;i<il;i+=2){
should be
for(int i=3,il=args.length();i<il;i+=2){
1.i follow up the construction https://github.com/trinisofttechnologies/countly_ionic_example ,but encountered some problems
1)Couldn't store configuration in Countly Messaging
2)i did not get google-play service and i don't want and need push service ~
how should i do ?
i have push notification in my app .
in my AndroidManifest.xml
<service android:enabled="true" android:exported="false" android:icon="@drawable/logo" android:label="${package_name}" android:name=".tcp.service.SfPushService" android:process=":SfPushService" /> <receiver android:name=".service.reciver.TcpNotifyReceiver"> <intent-filter> <action android:name="com_sf_tcp_network_action" /> <action android:name="com_sf_tcp_push_action" /> </intent-filter> </receiver>
in my build.gradle
compile 'com.google.android.gms:play-services:9.4.0'
if i did not add this dependency ,it fails build
my error log
09-22 16:14:37.316 15066-15413/com.sf.sasp.debug E/MessagingAdapter: Couldn't store configuration in Countly Messaging
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at ly.count.android.sdk.MessagingAdapter.storeConfiguration(MessagingAdapter.java:40)
at ly.count.android.sdk.Countly.init(Countly.java:197)
at ly.count.android.sdk.CountlyCordova.execute(CountlyCordova.java:28)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
at org.apache.cordova.PluginManager.exec(PluginManager.java:133)
at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0
at android.content.res.Resources.getText(Resources.java:1468)
at android.content.res.Resources.getString(Resources.java:1564)
at android.content.Context.getString(Context.java:415)
at ly.count.android.sdk.messaging.CountlyMessaging.storeConfiguration(CountlyMessaging.java:142)
at java.lang.reflect.Method.invoke(Native Method)
at ly.count.android.sdk.MessagingAdapter.storeConfiguration(MessagingAdapter.java:40)
at ly.count.android.sdk.Countly.init(Countly.java:197)
at ly.count.android.sdk.CountlyCordova.execute(CountlyCordova.java:28)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
at org.apache.cordova.PluginManager.exec(PluginManager.java:133)
at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.os.HandlerThread.run(HandlerThread.java:61)
09-22 16:14:44.346 15066-15413/com.sf.sasp.debug W/GooglePlayServicesUtil: Cannot find Google Play services package name.
android.content.pm.PackageManager$NameNotFoundException: com.google.android.gms
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:201)
at com.google.android.gms.internal.zzro.getPackageInfo(Unknown Source)
at com.google.android.gms.common.zze.zzby(Unknown Source)
at com.google.android.gms.common.zze.zzbx(Unknown Source)
at com.google.android.gms.common.zze.zzbs(Unknown Source)
at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
at ly.count.android.sdk.messaging.CountlyMessaging.checkPlayServices(CountlyMessaging.java:215)
at ly.count.android.sdk.messaging.CountlyMessaging.init(CountlyMessaging.java:126)
at java.lang.reflect.Method.invoke(Native Method)
at ly.count.android.sdk.MessagingAdapter.init(MessagingAdapter.java:27)
at ly.count.android.sdk.Countly.initMessaging(Countly.java:264)
at ly.count.android.sdk.Countly.initMessaging(Countly.java:248)
at ly.count.android.sdk.CountlyCordova.execute(CountlyCordova.java:131)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
at org.apache.cordova.PluginManager.exec(PluginManager.java:133)
at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.os.HandlerThread.run(HandlerThread.java:61)
09-22 16:14:48.806 15066-15413/com.sf.sasp.debug E/MessagingAdapter: Couldn't store configuration in Countly Messaging
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at ly.count.android.sdk.MessagingAdapter.storeConfiguration(MessagingAdapter.java:40)
at ly.count.android.sdk.Countly.initMessaging(Countly.java:271)
at ly.count.android.sdk.Countly.initMessaging(Countly.java:248)
at ly.count.android.sdk.CountlyCordova.execute(CountlyCordova.java:131)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
at org.apache.cordova.PluginManager.exec(PluginManager.java:133)
at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0
at android.content.res.Resources.getText(Resources.java:1468)
at android.content.res.Resources.getString(Resources.java:1564)
at android.content.Context.getString(Context.java:415)
at ly.count.android.sdk.messaging.CountlyMessaging.storeConfiguration(CountlyMessaging.java:142)
at java.lang.reflect.Method.invoke(Native Method)
at ly.count.android.sdk.MessagingAdapter.storeConfiguration(MessagingAdapter.java:40)
at ly.count.android.sdk.Countly.initMessaging(Countly.java:271)
at ly.count.android.sdk.Countly.initMessaging(Countly.java:248)
at ly.count.android.sdk.CountlyCordova.execute(CountlyCordova.java:131)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
at org.apache.cordova.PluginManager.exec(PluginManager.java:133)
at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:39)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.os.HandlerThread.run(HandlerThread.java:61)
There might be excess number of commented code. We should clean up all commented code which is unnecessary.
Hi,
I would like to use your services like push notifications for my ionic 3 project. However, I could not find any concrete example using Countly on the web. Could you please provide an example for Ionic 3 if you have any chance to do so? Thank you in advance.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Getting this error when building my app. I understand this is required if you want to use Android push notifications, but what if I just want to capture analytics, how can this error be resolved?
Thanks
Hi, I am using countly-sdk-js with ionic, and I have been successfully ran your demo app. Ionic works wth AngularJS and I want to use countly in each controller to send event, but console error : ReferenceError: Countly is not defined.
I want to know how to using countly-sdk-js in angularjs Dependency injection.
Demo code
.controller('DashCtrl', function($scope) { Countly.init("http://172.28.112.102","16be70383b9d4af3e87f81b4de318b53e5d3ecd4"); var events = {"eventName":"event_segment_sum","eventCount":1,"eventSum":"0.99"}; events.segments = {"Country" : "Turkey", "Age" : "28"}; Countly.sendEvent(events); })
Rich push notifications tested on HTC One M8, Samsung Galaxy S6, LG G5 and iPhone 6S devices – same result.
It would be nice to have an instruction on how to implement the script ;)
I'm trying out Appgyvers "Steroids" and would like to know what I need to include..
OS version and device name cannot be sent (eg Galaxy S7, Android 8.1., iphone 7, iOS 11)
We've got a problem with receiving iOS push notifications(We work with Cordova SDK). We set APN Auth key and after that we initialize device, receive registration id from APN, but still can't' receive notifications on device.
Commands we used:
Countly.init("https://us-try.count.ly","our_app_key");
Countly.initMessaging({"messageMode": Countly.messagingMode.PRODUCTION, "projectId": "gcm_id"})
Countly.start();
var push = PushNotification.init({
android: {
senderID: "gcm_id"
},
ios: {
alert: "true",
badge: "true",
sound: "true"
}
});
push.on('registration', function(data) {
Countly.onRegistrationId({
"registrationId": data.registrationId,
"mode": Countly.messagingMode.PRODUCTION,
"projectId": "gcm_id"
})
console.log(data.registrationId) // here we get registrationId
});
On dashboard we have something like this:
We can create notification from our app, but can't receive them!
Implement rich push notifications for Cordova iOS SDK.
Hi, we have a compilation error with the following env :
17:40:04 callbackContext.success("Success");
17:40:04 ^
17:40:04 /home/jenkins/workspace/scana_scanav2-app_release_2.5.3/platforms/android/src/ly/count/android/sdk/CountlyCordova.java:369: error: local variable callbackContext is accessed from within inner class; needs to be declared final
17:40:04 callbackContext.error(error);
17:40:04 ^
17:40:04 /home/jenkins/workspace/scana_scanav2-app_release_2.5.3/platforms/android/src/ly/count/android/sdk/CountlyCordova.java:381: error: local variable callbackContext is accessed from within inner class; needs to be declared final
17:40:04 callbackContext.success("Success");
17:40:04 ^
17:40:04 /home/jenkins/workspace/scana_scanav2-app_release_2.5.3/platforms/android/src/ly/count/android/sdk/CountlyCordova.java:383: error: local variable callbackContext is accessed from within inner class; needs to be declared final
17:40:04 callbackContext.error(error);
17:40:04 ^
17:40:04 /home/jenkins/workspace/scana_scanav2-app_release_2.5.3/platforms/android/src/ly/count/android/sdk/CountlyCordova.java:399: error: local variable callbackContext is accessed from within inner class; needs to be declared final
17:40:04 callbackContext.success("Success");
17:40:04 ^
17:40:04 /home/jenkins/workspace/scana_scanav2-app_release_2.5.3/platforms/android/src/ly/count/android/sdk/CountlyCordova.java:401: error: local variable callbackContext is accessed from within inner class; needs to be declared final
17:40:04 callbackContext.error(error);
17:40:04 ^
17:40:04 /home/jenkins/workspace/scana_scanav2-app_release_2.5.3/platforms/android/src/ly/count/android/sdk/CountlyCordova.java:417: error: local variable callbackContext is accessed from within inner class; needs to be declared final
17:40:04 callbackContext.success("Success");
17:40:04 ^
17:40:04 /home/jenkins/workspace/scana_scanav2-app_release_2.5.3/platforms/android/src/ly/count/android/sdk/CountlyCordova.java:419: error: local variable callbackContext is accessed from within inner class; needs to be declared final
17:40:04 callbackContext.error(error);
I think you add "final" to the parameter callbackContext in the method definition.
Best regards
Laurent M.
There are four versions in the plugin: The tag is 2.6, package.js is 0.0.3, package.json is 1.1.0 and plugin.xml is 0.0.1. We should unify those.
Hi, I could not get over this issue for a couple of days. It says it sends push notification successfully. However, when I go and see the details of the sent message. It says:
Most probably Countly competes for tokens with other GCM / Firebase SDK you have in your app. Please override the way Countly or another SDK get a token so they would end up using the same token.
I need Countly for push notification facility, but I can't use or set it up correctly.
I am developing a cross platform app using Ionic Framework and could't find any documentation for integrating countly push notification with angularjs/ionic/cordova.
There is very clear documentation for android and ios separately but same is missing for ionic. The example on github(phonegap example) doesn't run straightaway and the countly.js is lacking explanation on GCM integration.
Can you please provide some resources for implementing push notification in mobile apps created using ionic via countly.
Request coming through JS SDK needs to send its own SDK meta data (version and name) for both iOS and Android.
Please edit these lines as below:
2.2
(or 2.2.1
if you plan to make a new release)
js-cordova-ios
iOS
https://github.com/Countly/countly-sdk-js/blob/master/src/ios/sdk/CountlyCommon.m#L19
https://github.com/Countly/countly-sdk-js/blob/master/src/ios/sdk/CountlyCommon.m#L20
Android
https://github.com/Countly/countly-sdk-js/blob/master/src/android/Countly.java#L52
https://github.com/Countly/countly-sdk-js/blob/master/src/android/Countly.java#L56
Until we come up with a better solution, manually overriding these values for each JS SDK release is ok.
Any chance this supports Capacitor apps?
On android I am getting the error
cordova/platforms/android/src/ly/count/android/api/CountlyCordova.java:121:Countly.sharedInstance().onRegistrationId(registrationId);
The method onRegistrationId(String) is undefined for the type Countly
I have added the plugin from
https://github.com/nicolsondsouza/countly-sdk-js
However on iOS I now get the error
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Cannot create an NSPersistentStoreCoordinator with a nil model'
Thrown from CountlyDB.h on line 226
s_persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
This is how I am calling the code in javascript
if (window.CountlyCordova) {
//initialize
CountlyCordova.init(this.countlyServer, this.key);
var event = {
"eventName": "mypaymentevent",
"eventCount": 1
};
CountlyCordova.sendEvent(event);
}
Hi,
I would like to be able to log javascript errors with the Cordova Countly JS SDK.
A quick-win would be to add a Countly.log_error(string) method.
And we will use it like this :
Countly.log_error(JSON.stringify(err));
U can have a look at the cordova countly web sdk too :
recordError
You can tell if it is a fatal or non-fatal crash, and add segments on the error.
It seems to handle the format of the error (string/object, stack, ...).
They also have added a feature to capture globally all javascript errors :
track_errors
JS SDK should honor the following items to support new Countly server related features
The issue is:
I have signed the app with my personal account, and the ananyltics is working.
But when I signed the app with enterprise account the analytics doesn't work on iOS.
Events that are created with startEvent("Event") and ended with additional information via endEvent({eventName:"Event",countCount:1,segments:{...}}) will not be sent completely to the countly server.
Thanks for the plugin. How can I send events with segmentation
Like the example here
http://resources.count.ly/v1.0/docs/custom-events
Hi will this plugin work in Ionic 3?
Queue method calls when init is not called,
As the analytics are all over the place.
And don't know if the inits where called.
Issue created from slack on behalf of "Bramzor"
Thanks
Unusued files/folders like Countly.xcdatamodeld
, .DS_Store
needs to be removed
I found a problem recently on my android device Nexus-5, my app be came lagging and slow , or even blocked at least 3 seconds. all of these happened just when a RecordEvent method had been invoked. I'm sure of this because when I stopped running RecordEvent, everything became right. It runs nicely till our server of Countly-Service has been stopped for a long while for some reasons. Then I found that the SDK of android is using SharePreference file to cache Event-Data, and this file started becoming larger, like 600kb+. meanwhile my app started to be very slow and lagging, even blocked for a while. So I checked all data of this file and found a very huge 'string' label or element inside of it. I think this might not be a good design for data cache, So my question is how can I prevent this happening again or I just need to run RecordEvent asynchronously every time?
Ii'm a game developer. i used cocos2d game engine to develop products.
it's a way to use sdk in cocos2d-js version?
From customer Danny Lopes
I know it’s been sometime and I have been working on a couple other projects myself so I apologize for not keeping this topic alive but I wanted to follow up on if you were able to complete making the Countly.sharedInstance method available so that we can manually clear the Countly environment data when switching our environments on a device.
The SDK currently does kinda support this kind of functionality, where the required action would be to change the environment/target server.
But the downside would be that all currently not sent data would be erased from the device.
You could call:
"Countly.sharedInstance().halt();"
and then reinitialize the SDK with the new server url and appKey.
I am getting an error in the recordEvents function on the line NSString *data ( number 790 ) of countly.m
It only happens sometimes after a new install
Error
Thread 1: EXC_BAD_ACCESS ( code=1 address=0xc)
Function
(void)recordEvents:(NSString *)events
{
NSString *data = [NSString stringWithFormat:@"app_key=%@&device_id=%@×tamp=%ld&events=%@",
self.appKey,
[CountlyDeviceInfo udid],
time(NULL),
events];
[[CountlyDB sharedInstance] addToQueue:data];
[self tick];
}
The event object I was sending last
{"eventName":"view-home","eventCount":1,"segments":{"appcountry":"NZ","userId":"7233001","deviceId":"B396AAD6-7E92-48CD-8A88-A0E193D3CB99"}}
Hi,
I think something is not correct in the build process when i use this plugin.
First, my environnement:
cordova 8.1.2
cordova ios 4.5.5
I have created a cordova project and i have added the plugin with the command in the documentation.
cordova plugin add https://github.com/Countly/countly-sdk-js.git
** In package.json:
Dependencies:
"countly-sdk-js.git": "https://github.com/Countly/countly-sdk-js.git"
Cordova part:
"ly.count.cordova": {}
** In config.xml
<plugin name="ly.count.cordova" spec="https://github.com/Countly/countly-sdk-js.git" />
When in run "cordova platform add [email protected]", it works but i got the plugin twice (in deps) in package.json :
"countly-sdk-js": "git+https://github.com/Countly/countly-sdk-js.git",
"ly.count.cordova": "https://github.com/Countly/countly-sdk-js.git"
Then, i delete my package-lock.json and rerun npm install to get a new one that matches the last updates of the file.
Then, i run "npm ci" (it deletes the node_modules, checks that all is correct between package.json and package-lock.json) but i got the error :
npm ERR! Missing: ly.count.cordova@https://github.com/Countly/countly-sdk-js.git
If i remove the ly.count.cordova from package.json (in deps), delete package-lock.json, rerun npm install, then "npm ci" works.
Then, i delete platforms and plugin directories, and rerun the command:
cordova platform add ios
I got the error:
Using cordova-fetch for cordova-ios@^4.5.5
Adding countly-sdk-js project...
Unable to load PlatformApi from platform. Error: Cannot find module '/private/tmp/test/AppTest/node_modules/countly-sdk-js'
Unhandled "error" event. (The platform "countly-sdk-js" does not appear to be a valid cordova platform. It is missing API.js. countly-sdk-js not supported.)
My opinion:
You should republish a npm package with a unique name cordova-plugin-countly and the same for the plugin id.
Having two different names is a problem for strong industrialisation : ly.count.cordova and countly-sdk-js
Hello,
We are using Countly.setOptionalParametersForInitialization
function in both Android and iOS and passing latitude/longitude numbers like this:
{"countryCode":"DK","latitude":56,"longitude":10}
This works well on Android devices - however, it does not work on iOS devices - the coordinates are saved to Countly user, but they are not resolved to any country and city (both displayed Unknown in the Countly User Profile).
However, when we tried another approach of parsing the numbers to float strings with at least one decimal place, it started working including auto discovery of both country and city:
{"countryCode":"DK","latitude":"56.0000","longitude":"10.0000"}
Most probably there is some conversion issue in the iOS native plugin and/or in the server, which may not understand non-float values when trying to parse the coordinates.
Possible fixes - need to include this specific case in Documentation (remind users to pass float strings), or to fix the conversion issues inside plugin/Countly server.
Hi Countly
I am running the cordova countly SDK client. On receiving the message from the GCM the app is crashing with below error.
Can you please help?
Class not found when unmarshalling: ly.count.android.sdk.messaging.Message
E/Parcel ( 848): java.lang.ClassNotFoundException: ly.count.android.sdk.messaging.Message
E/Parcel ( 848): at java.lang.Class.classForName(Native Method)
E/Parcel ( 848): at java.lang.Class.forName(Class.java:251)
E/Parcel ( 848): at java.lang.Class.forName(Class.java:216)
E/Parcel ( 848): at android.os.Parcel.readParcelableCreator(Parcel.java:2133)
E/Parcel ( 848): at android.os.Parcel.readParcelable(Parcel.java:2097)
E/Parcel ( 848): at android.os.Parcel.readValue(Parcel.java:2013)
E/Parcel ( 848): at android.os.Parcel.readArrayMapInternal(Parcel.java:2314)
E/Parcel ( 848): at android.os.Bundle.unparcel(Bundle.java:249)
E/Parcel ( 848): at android.os.Bundle.getString(Bundle.java:1118)
E/Parcel ( 848): at android.content.Intent.getStringExtra(Intent.java:4991)
E/Parcel ( 848): at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1334)
E/Parcel ( 848): at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:966)
E/Parcel ( 848): at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:3890)
E/Parcel ( 848): at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:3793)
E/Parcel ( 848): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:159)
E/Parcel ( 848): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2532)
E/Parcel ( 848): at android.os.Binder.execTransact(Binder.java:404)
E/Parcel ( 848): at dalvik.system.NativeStart.run(Native Method)
E/Parcel ( 848): Caused by: java.lang.NoClassDefFoundError: ly/count/android/sdk/messaging/Message
E/Parcel ( 848): ... 18 more
E/Parcel ( 848): Caused by: java.lang.ClassNotFoundException: Didn't find class "ly.count.android.sdk.messaging.Message" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
E/Parcel ( 848): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
E/Parcel ( 848): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
E/Parcel ( 848): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
E/Parcel ( 848): ... 18 more
W/dalvikvm(30502): threadid=21: thread exiting with uncaught exception (group=0x41728da0)
E/AndroidRuntime(30502): FATAL EXCEPTION: IntentService[CountlyMessagingService]
E/AndroidRuntime(30502): Process: com.ionicframework.myapp119191, PID: 30502
E/AndroidRuntime(30502): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.ionicframework.myapp119191/ly.count.android.sdk.messaging.ProxyActivity}; have you declared this activity in your AndroidManifest.xml?
E/AndroidRuntime(30502): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1648)
E/AndroidRuntime(30502): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1442)
E/AndroidRuntime(30502): at android.app.ContextImpl.startActivity(ContextImpl.java:1371)
E/AndroidRuntime(30502): at android.app.ContextImpl.startActivity(ContextImpl.java:1353)
Thanks
Vinod
Hello,
it looks like the countly.js is not using any native code - everything is done in plain javascript. So why we need to use the native sdks? Also is the native OpenUDID never used.
Am I missing something or is the native code unnecessarily?
I am running on;
Cordova CLI: 6.1.1
Gulp version: CLI version 1.2.1
Gulp local: Local version 3.9.1
Ionic Version: 1.2.4-nightly-1917
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Window 10 Pro (64bit)
Node Version: v4.4.4
When I add countly plugin to my project Iget the following build error;
C:\projects\cfmtest>ionic run android
Running command: "C:\Program Files (x86)\Nodist\bin\node.exe" C:\projects\cfmtest\hooks\after_prepare\010_add_platform_class.js C:\projects\cfmtest
add to body class: platform-android
ANDROID_HOME=C:\Android\sdk\
JAVA_HOME=C:\Program Files\java\jdk1.7.0_80
No target specified, deploying to device 'd8f5941'.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:compileDebugAidl
:CordovaLib:generateDebugBuildConfig
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets
:CordovaLib:processDebugManifest
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:prepareAndroidCordovaLibUnspecifiedDebugLibrary
:preReleaseBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:compileReleaseAidl
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets
:CordovaLib:processReleaseManifest
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:compileReleaseJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportSupportV132330Library
:prepareComAndroidSupportSupportV42330Library
:prepareComGoogleAndroidGmsPlayServicesBase840Library
:prepareComGoogleAndroidGmsPlayServicesBasement840Library
:prepareComGoogleAndroidGmsPlayServicesGcm840Library
:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:compileDebugNdk UP-TO-DATE
:compileDebugSources
:transformClassesWithDexForDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
FAILED
com.android.dex.DexException: Multiple dex files define Landroid/support/v13/app/FragmentCompat$FragmentCompatImpl;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
BUILD FAILED
Total time: 54.799 secs
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_80\bin\java.exe'' finished with non-zero exit value 2
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: Error code 1 for command: cmd with args: /s,/c,"C:\projects\cfmtest\platforms\android\gradlew cdvBuildDebug -b C:\projects\cfmtest\platforms\android\build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
C:\projects\cfmtest>
After some research, phonegap-plugin-push DOCS say;
Then at least one other plugin you have installed is using an outdated way to declare dependencies such as
android-supportor
play-services-gcm.
D:\src_workspace\MyApp>cordova plugin add https://github.com/Countly/countly-sdk-js.git
Fetching plugin "https://github.com/Countly/countly-sdk-js.git" via git clone
Repository "https://github.com/Countly/countly-sdk-js.git" checked out to git ref "master".
shell.js: internal error
Error: EXDEV, cross-device link not permitted 'C:\Users\LANSIO~1\AppData\Local\Temp\git\1435130284828\Countly.js'
at Error (native)
at Object.fs.renameSync (fs.js:636:18)
at C:\Users\Lansion08\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\mv.js:77:8
at Array.forEach (native)
at Object._mv (C:\Users\Lansion08\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\mv.js:53:11)
at Object.mv (C:\Users\Lansion08\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\common.js:186:23)
at C:\Users\Lansion08\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\util\plugins.js:53:19
at _fulfilled (C:\Users\Lansion08\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\Lansion08\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\Lansion08\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749:13)
The documentation refers to manually adding crash log:
// Send a custom crash log
Countly.addCrashLog("My crash log from JavaScript");
This API does not appear to be implemented (yet?) in Countly.js.
Is the intent of the API for application managed non-fatal errors (e.g. gracefully caught 500 responses)?
From tracing through the Android code, its not clear if this should be exposed. I didn't spend a lot of time, but I couldn't find what sends the CrashDetails
generated in addCrashLog
Rather should logException be overloaded to take a string? That might make more sense to expose as addCrashLog
in Countly.js?
Referring to this issue.
https://community.count.ly/t/sorry-there-are-no-push-enabled-users-for-specified-options-ionic/662
Upgrade typescript work.
When adding a crash log, the string-length is limited to 1000 chars. Is there a reason for this limit?
const NSInteger kCountlyCustomCrashLogLengthLimit = 1000;
I'm just implementing this plugin and saw my iOS app hard-crash while calling Countly.sendEvent
Upon inspection, I think it is because I didn't have eventCount
properly defined on the parameter to sendEvent
. After setting eventCount
to 1 it stopped crashing.
Relevant lines:
https://github.com/Countly/countly-sdk-js/blob/master/Countly.js#L52
https://github.com/Countly/countly-sdk-js/blob/master/src/ios/CountlyCordova.m#L276
Since eventCount
is not defined, the whole array is shifted so the iOS routine crashes by assuming an index in the array that doesn't exist.
I think it's safe to just assume eventCount
to be 1
in Countly.js there if it is not defined.
Android devices are treated as production devices, even though marking them as “Countly.messagingMode.TEST” when initializing messaging inside app.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.