Android sdk integration


#1

Hi,
I've done all the steps in android but it does not countly appear on screen.
Android manifest----




    <receiver android:name="ly.count.android.sdk.ReferrerReceiver" android:exported="true">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>

MainActivity
Countly.sharedInstance().init(this, "https://analytics.......", "42583ded90b8d35dd4a0bc1be934d***********", null, DeviceId.Type.OPEN_UDID);

Countly.sharedInstance().setViewTracking(true);
Countly.sharedInstance().enableCrashReporting();
@Override
public void onStart()
{
super.onStart();
Countly.sharedInstance().onStart(this);

}
@Override
public void onStop()
{
    Countly.sharedInstance().onStop();
    super.onStop();
}

compile 'ly.count.android:sdk:17.05'

maven { url "http://dl.bintray.com/countly/maven" }

jcenter()
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'http://dl.bintray.com/countly/maven' }

I saw OPENUDID in log events.
But does not appear on the countly dashboard screen


#2

Hi,
Have you added OpenUDID service? I see ReferrerReciever one, but not OpenUDID.


#3

yes I added but it does not countly appear on screen.


#4

What do you mean by "Countly appear on screen"? In your app Countly should not appear.


#5

Try enabling logging by calling Countly.sharedInstance().setLoggingEnabled(true); prior to any initialisation and check logcat for errors.


#6

thanks How to solve this error.
Got exception while trying to submit event data: app_key=42583ded90b8d35dd4a0bc1be934da42ac643****&timestamp=1503057716224&hour=15&dow=5&tz=180&sdk_version=17.05&sdk_name=java-native-android&begin_session=1&metrics=%7B%22_device%22%3A%22SM-N910C%22%2C%22_os%22%3A%22Android%22%2C%22_os_version%22%3A%226.0.1%22%2C%22_carrier%22%3A%22VODAFONE+TR%22%2C%22_resolution%22%3A%221440x2560%22%2C%22_density%22%3A%22XXXHDPI%22%2C%22_locale%22%3A%22tr_TR%22%2C%22_app_version%22%3A%221.0%22%7D&device_id=79d360e7619dc4***
javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:357)
at com.android.okhttp.internal.http.SocketConnector.connectTls(SocketConnector.java:212)
at com.android.okhttp.Connection.connect(Connection.java:1322)
at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:1410)
at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128)
at com.android.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:466)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:447)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:353)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:476)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:118)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:89)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:25)
at ly.count.android.sdk.ConnectionProcessor.run(ConnectionProcessor.java:209)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:324)
at com.android.org.conscrypt.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:225)
at com.android.org.conscrypt.Platform.checkServerTrusted(Platform.java:115)
at com.android.org.conscrypt.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:643)
at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:353)
at com.android.okhttp.internal.http.SocketConnector.connectTls(SocketConnector.java:212)
at com.android.okhttp.Connection.connect(Connection.java:1322)
at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:1410)
at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128)
at com.android.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:466)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:447)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:353)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:476)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:118)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:89)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:25)
at ly.count.android.sdk.ConnectionProcessor.run(ConnectionProcessor.java:209)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.


#7

Let me google that for you :slight_smile: https://stackoverflow.com/questions/6825226/trust-anchor-not-found-for-android-ssl-connection

I guess you SSL certificate somehow misconfigured. Either on Android side or on server side. Try using HTTP or turn off certificate / public key pinning in SDK if any.