Hi,
i am making an android app connect and send variablevalues to ubidots. I am trying to make a simple example based on the Ubidots example android app.
Everyhting compiles without errors, but when i run the application and try to connect to Ubidots, the app crashes with this callstack:
10-15 17:53:04.303: E/AndroidRuntime(7867): FATAL EXCEPTION: AsyncTask #1
10-15 17:53:04.303: E/AndroidRuntime(7867): Process: com.example.unoPidGuiPrototype, PID: 7867
10-15 17:53:04.303: E/AndroidRuntime(7867): java.lang.RuntimeException: An error occured while executing doInBackground()
10-15 17:53:04.303: E/AndroidRuntime(7867): at android.os.AsyncTask$3.done(AsyncTask.java:304)
10-15 17:53:04.303: E/AndroidRuntime(7867): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
10-15 17:53:04.303: E/AndroidRuntime(7867): at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
10-15 17:53:04.303: E/AndroidRuntime(7867): at java.util.concurrent.FutureTask.run(FutureTask.java:242)
10-15 17:53:04.303: E/AndroidRuntime(7867): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
10-15 17:53:04.303: E/AndroidRuntime(7867): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
10-15 17:53:04.303: E/AndroidRuntime(7867): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
10-15 17:53:04.303: E/AndroidRuntime(7867): at java.lang.Thread.run(Thread.java:818)
10-15 17:53:04.303: E/AndroidRuntime(7867): Caused by: java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/message/BasicLineFormatter; in class Lorg/apache/http/message/BasicLineFormatter; or its superclasses (declaration of ‘org.apache.http.message.BasicLineFormatter’ appears in /system/framework/ext.jar)
10-15 17:53:04.303: E/AndroidRuntime(7867): at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.(DefaultHttpRequestWriterFactory.java:52)
10-15 17:53:04.303: E/AndroidRuntime(7867): at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.(DefaultHttpRequestWriterFactory.java:56)
10-15 17:53:04.303: E/AndroidRuntime(7867): at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.(DefaultHttpRequestWriterFactory.java:46)
10-15 17:53:04.303: E/AndroidRuntime(7867): at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.(ManagedHttpClientConnectionFactory.java:72)
10-15 17:53:04.303: E/AndroidRuntime(7867): at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.(ManagedHttpClientConnectionFactory.java:84)
10-15 17:53:04.303: E/AndroidRuntime(7867): at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.(ManagedHttpClientConnectionFactory.java:59)
10-15 17:53:04.303: E/AndroidRuntime(7867): at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.(PoolingHttpClientConnectionManager.java:487)
10-15 17:53:04.303: E/AndroidRuntime(7867): at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.(PoolingHttpClientConnectionManager.java:147)
10-15 17:53:04.303: E/AndroidRuntime(7867): at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.(PoolingHttpClientConnectionManager.java:136)
10-15 17:53:04.303: E/AndroidRuntime(7867): at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.(PoolingHttpClientConnectionManager.java:112)
10-15 17:53:04.303: E/AndroidRuntime(7867): at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:726)
10-15 17:53:04.303: E/AndroidRuntime(7867): at com.ubidots.ServerBridge.postWithApiKey(ServerBridge.java:82)
10-15 17:53:04.303: E/AndroidRuntime(7867): at com.ubidots.ServerBridge.recieveToken(ServerBridge.java:72)
10-15 17:53:04.303: E/AndroidRuntime(7867): at com.ubidots.ServerBridge.initialize(ServerBridge.java:67)
10-15 17:53:04.303: E/AndroidRuntime(7867): at com.ubidots.ServerBridge.(ServerBridge.java:54)
10-15 17:53:04.303: E/AndroidRuntime(7867): at com.ubidots.ServerBridge.(ServerBridge.java:43)
10-15 17:53:04.303: E/AndroidRuntime(7867): at com.ubidots.ApiClient.(ApiClient.java:16)
10-15 17:53:04.303: E/AndroidRuntime(7867): at com.example.unoPidGuiPrototype.HomeActivity$ApiUbidots.doInBackground(HomeActivity.java:156)
10-15 17:53:04.303: E/AndroidRuntime(7867): at com.example.unoPidGuiPrototype.HomeActivity$ApiUbidots.doInBackground(HomeActivity.java:146)
10-15 17:53:04.303: E/AndroidRuntime(7867): at android.os.AsyncTask$2.call(AsyncTask.java:292)
10-15 17:53:04.303: E/AndroidRuntime(7867): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
10-15 17:53:04.303: E/AndroidRuntime(7867): … 4 more
I think the problem is that the SDK version of package org.apache.http is used instead of the one that is provided with the ubidots library, but I cannot figure out how to configure the Intelij Idea project to fix this.
Any suggestion would be helpful, thanks