Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forever loading on SplashScreen on OffDebug Variant #793

Closed
sachincool opened this issue Feb 17, 2018 · 9 comments
Closed

Forever loading on SplashScreen on OffDebug Variant #793

sachincool opened this issue Feb 17, 2018 · 9 comments
Assignees
Labels
bug Produces incorrect or unexpected result or behaviour. splash screen
Milestone

Comments

@sachincool
Copy link
Contributor

Summary:
The Splash Screen Keeps on Loading on OffDebug Variant

Steps to reproduce:
1 choose offDebug as your build variant
2 Build and run the variant on 7.1 Android
3 Splash Screen with LoadToast is showing indeterminately.

Add System logs:
There's no Error
Only a bunch of Database create calls.
Expected behavior:
The App should run fine on android 7.1

Observed behavior:
I checked further and got that it Leads to GetJson Asynktask to execute and get the json value.
Afterwards it runs the preexecute and Doinbackground Perfectly but gets stucked on PostExecute.
device-2018-02-18-045801
1
screenshot from 2018-02-18 04-59-17

Device and Android version:
Android 7.1
Yes, I would like to work on this issue

@sachincool
Copy link
Contributor Author

Yes i would like to Work on this issue.

@sachincool
Copy link
Contributor Author

It is caused inside that getAllergence call And inside that call it calls the Overridden method onFailure
Here is the proof:
1

@sachincool
Copy link
Contributor Author

on printing the stacktrace of the throwable t i got this

02-18 05:32:02.130 24333-24333/openfoodfacts.github.scrachx.openfood W/System.err: java.net.SocketException: Network is unreachable
02-18 05:32:02.131 24333-24333/openfoodfacts.github.scrachx.openfood W/System.err:     at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:334)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:196)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:356)
        at java.net.Socket.connect(Socket.java:586)
        at okhttp3.internal.platform.AndroidPlatform.connectSocket(AndroidPlatform.java:69)
        at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:238)
        at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:158)
        at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:256)
        at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:134)
        at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:113)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
02-18 05:32:02.132 24333-24333/openfoodfacts.github.scrachx.openfood W/System.err:     at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:760)

If anybody got a clue on why is it happening in getAllergance method. Don't keep it to yourself 😄

@Karljoones Karljoones added bug Produces incorrect or unexpected result or behaviour. Nougat labels Feb 18, 2018
@Karljoones Karljoones added this to the App Health milestone Feb 18, 2018
@sachincool sachincool mentioned this issue Feb 19, 2018
3 tasks
@ghost
Copy link

ghost commented Feb 21, 2018

Hi @sachincool, I've been able to reproduce the issue, just as you mention, using a 7.0 image. The java.net.PlainSocketImpl.socketConnect(Native Method) warning made my think something weird was going on. The URL getAllergens() is trying to retrieve (https://world.openfoodfacts.org/allergens.json) can be accessed without errors outside the app (using a browser with it own TLS certificate stack, independent from the system, like chrome). Moreover, you cannot sign in, or get any asset from the OFF server.

I captured the traffic with wireshark:

screen shot 2018-02-21 at 00 50 48

As you can see, the TLS connection is failing during the handshake; and this is the very reason OFF is failing in this version.

I found some articles mentioning the issue and how to solve it:

It requires a bit of work on the server side: nginx's config file (or the TLS terminator OFF is currently using) to allow prime256v1 elliptic curve as fallback to make Android 7.0 devices to finish the TLS handshake, hence being able to retrieve assets from OFF server.

EDIT: Added the URL getAllergents() is retrieving

@sachincool
Copy link
Contributor Author

Wow !! @policorn I never thought i would see Wireshark and Android in the same room 😮

I'll get on the links you provided Thankyou So much for the help. 😍

@itchix
Copy link
Contributor

itchix commented Feb 21, 2018

@ghost
Copy link

ghost commented Feb 21, 2018

Hi @itchix, could we only force this weak cipher suite for Android 7.0 so the other Android versions can negotiate a stronger one if they support them?

@itchix
Copy link
Contributor

itchix commented Feb 21, 2018

@ghost
Copy link

ghost commented Feb 21, 2018

Hi @sachincool, please implement the fix with @itchix's suggestions - Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Produces incorrect or unexpected result or behaviour. splash screen
Projects
None yet
Development

No branches or pull requests

4 participants