Giter Site home page Giter Site logo

Comments (18)

bajtos avatar bajtos commented on September 27, 2024

I filled an issue in the android-async-http repository: android-async-http/android-async-http#751

from loopback-sdk-android.

bajtos avatar bajtos commented on September 27, 2024

I don't understand one thing: how is it possible that our unit-tests do not experience this problem too?

from loopback-sdk-android.

newaz avatar newaz commented on September 27, 2024

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.

bajtos avatar bajtos commented on September 27, 2024

@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.

newaz avatar newaz commented on September 27, 2024

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.

bajtos avatar bajtos commented on September 27, 2024

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.

yoshuacas avatar yoshuacas commented on September 27, 2024

I followed newaz instruction and now I also don't have the error.

from loopback-sdk-android.

bajtos avatar bajtos commented on September 27, 2024

Cool, can you submit a pull request with the fix please?

from loopback-sdk-android.

yoshuacas avatar yoshuacas commented on September 27, 2024

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.

bajtos avatar bajtos commented on September 27, 2024

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.

yoshuacas avatar yoshuacas commented on September 27, 2024

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.

bajtos avatar bajtos commented on September 27, 2024

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.

bajtos avatar bajtos commented on September 27, 2024

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.

bajtos avatar bajtos commented on September 27, 2024

@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.

loay avatar loay commented on September 27, 2024

Hi @newaz @yoshuacas @bajtos
Is this issue still relevant?

from loopback-sdk-android.

superkhau avatar superkhau commented on September 27, 2024

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.

shahriar-git avatar shahriar-git commented on September 27, 2024

@loay , Not working with android at the moment so can't reayy say if its resolved or not.

from loopback-sdk-android.

Akshitha789 avatar Akshitha789 commented on September 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.