Comments (18)
I filled an issue in the android-async-http repository: android-async-http/android-async-http#751
from loopback-sdk-android.
I don't understand one thing: how is it possible that our unit-tests do not experience this problem too?
from loopback-sdk-android.
have you tried like this ? They are saying to use AsyncHttp...
AsyncHttpClient client = new AsyncHttpClient();
client.get("http://www.google.com", new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
System.out.println(response);
}
@Override
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable
error)
{
error.printStackTrace(System.out);
}
});
from loopback-sdk-android.
@newaz could you please try the change yourself and submit it as a pull request if it fixes the problem for you?
from loopback-sdk-android.
Sorry I could not work on it later. So it seems you hvae found out the cause form the loopj discussion, right?
from loopback-sdk-android.
Well, I assume that replacing HttpClient
with AsyncHttpClient
should fix the problem. However, since I did not manage to reproduce it, it's hard for me to tell whether the change is a fix or a not.
from loopback-sdk-android.
I followed newaz instruction and now I also don't have the error.
from loopback-sdk-android.
Cool, can you submit a pull request with the fix please?
from loopback-sdk-android.
Hi bajtos,
Man you would laugh at my coding skills :) I'm really a newbie.
What I really did for the moment is that I'm using the com.loopj.android:android-async-http:1.4.4 dependency, and not the latest 1.4.6. That solved my issue.
I'll tell you what I'll do, I'm going to go again to the version 1.4.6 and simply change all the HttpClient uses in your library to use AsyncHttpClient, and test again... I will report if the issues are gone then.
If they are gone I'll learn how to make a pull request :)
from loopback-sdk-android.
What I really did for the moment is that I'm using the com.loopj.android:android-async-http:1.4.4 dependency, and not the latest 1.4.6. That solved my issue.
Good, I am glad you managed to find a way how to move forward.
I'll tell you what I'll do, I'm going to go again to the version 1.4.6 and simply change all the HttpClient uses in your library to use AsyncHttpClient, and test again... I will report if the issues are gone then.
Great!
I'll learn how to make a pull request
https://gist.github.com/bajtos/27e3d1545a053d22015b
I should really turn it into a blog post one day.
from loopback-sdk-android.
Miroslav,
I'm having a nightmare trying to compile the library, can you give me some direction? I tried following your DEVELOPING document in the source code, but I cannot make the project compile, gradle keeps throwing errors like:
Unable to find method 'org.gradle.api,internal.project.Projetinternal.getConfigurations()Lorg...../ConfigurationsContainerInternal'
This is what I've done:
I downloaded all the dependencies you mention regarding the android sdk
Gradle is forcing me to change the classpath for gradle from your 0.14.2 to 1.1.0
I also noticed that you use a library in the gradle named : org.apache.commons.io.FilenameUtils; where do you need me to put that? right now the use of that library causes errors in my gradle file under the task distProperties.
Gradle is also showing an error under the uploadArchive... MavenDeployment is not recognized.
Beyond that, you also mention that you need me to compile the test-server, but when I do node test-server I get asyn error
I've installed with npm: async, loopback, express, strong-remoting, morgan .. it asked for loopback-component-push and I decided to stop. What are all the dependencies? how can I get them?
I'm sure I'll do better once the sdk is compiled ;)
from loopback-sdk-android.
Gradle is forcing me to change the classpath for gradle from your 0.14.2 to 1.1.0
I think this may be the root of the problem. I haven't had time to updat the project to a newer Android SDK and Build Tools. IIRC there were incompatible changes made after 0.14, I suspect that's causing you problems.
I also noticed that you use a library in the gradle named : org.apache.commons.io.FilenameUtils; where do you need me to put that? right now the use of that library causes errors in my gradle file under the task distProperties.
Gradle should automatically download all dependencies from Maven or jCenter.
Beyond that, you also mention that you need me to compile the test-server, but when I do node test-server I get asyn error
I've installed with npm: async, loopback, express, strong-remoting, morgan .. it asked for loopback-component-push and I decided to stop. What are all the dependencies? how can I get them?
Run npm install
with no parameters in the project root directory. The file package.json should contain all dependencies needed by the test server. Could you please send a pull request to fix the instructions and describe this extra step?
Regarding unit-tests, the steps described in DEVELOPING.md won't work with recent Android Studio versions, because they require newer Gradle. However, it should be possible to run the tests from a command-line too. First start an emulator (e.g. from the Android Studio) and then run the unit-tests via ./gradlew connectedAndroidTest
.
from loopback-sdk-android.
I apologise for the outdated build infrastructure. I have filled a GH issue #67 to fix that, I'll try to get it prioritised for the next sprint.
from loopback-sdk-android.
@yoshuacas I have upgraded the build infrastructure for Android Studio 1.1 in #69 and updated the instructions in DEVELOPING.md. Could you please try again?
I took a look at the problem with AsyncHttpClient vs. HttpClient, it turns out we are using AsyncHttpClient. The confusion was created by a private HttpClient
class extending from AsyncHttpClient
. I have renamed the private class in #70 to make the matter more clear.
This brings me back to my original problem, that I don't know how to reproduce this issue and get IllegalArgumentException
on my machine. Any more clues?
from loopback-sdk-android.
Hi @newaz @yoshuacas @bajtos
Is this issue still relevant?
from loopback-sdk-android.
Closing due to inactivity. If you are still running into problems, feel free to leave a comment and I will reopen the issue.
from loopback-sdk-android.
@loay , Not working with android at the moment so can't reayy say if its resolved or not.
from loopback-sdk-android.
Hi All,
I have tried through com.loopj.asynchttpclient 1.4.4 and 1.4.6 .. works well on Emulator.. But does throws Connect Timeout error from device - HTC Android 4.4.2 API 19. Any help will be greatly appreciated. Thanks in advance.
org.apache.http.conn.ConnectTimeoutException: Connect to /192.164.1.18:8080 timed out
W/System.err: at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127)
W/System.err: at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:144)
W/System.err: at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
W/System.err: at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
W/System.err: at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:367)
W/System.err: at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
W/System.err: at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:519)
W/System.err: at com.loopj.android.http.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:147)
W/System.err: at com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries(AsyncHttpRequest.java:178)
W/System.err: at com.loopj.android.http.AsyncHttpRequest.run(AsyncHttpRequest.java:109)
W/System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/System.err: at java.lang.Thread.run(Thread.java:864)
from loopback-sdk-android.
Related Issues (20)
- null pointer from using RestAdapter HOT 1
- can't get current user id from MainActivity HOT 1
- Integrate Eslint to the repo HOT 1
- loginUser problem HOT 1
- loginUser problem java.lang.NoSuchMethodError: No virtual method post HOT 3
- Add to Model class another save method to return the response of the object being added HOT 1
- ModelRepository.createObject fails with null parameters
- Model.toMap should include superClass properties
- Call for maintainers HOT 4
- RestAdapter: HTTP request (string) failed: javax.net.ssl.SSLPeerUnverifiedException: No peer certificate coming in loopback
- 500 Internal Server Error on save HOT 1
- [What about support for Android Marshmallow - API 23]
- Best Practice to check server availability before calling any method
- User.save(email, password) returns successful even when no email was successfully sent
- Increasing the timeout to prevent socket timeout error HOT 1
- Getting java.lang.NoSuchMethodError exception when calling findAll
- how to cancel request from RestAdapter? HOT 1
- Where field value is null or empty
- Issue when running Proguard with the SDK (missing documentation) HOT 1
- Update test cases to be port independent HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loopback-sdk-android.