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

refactor blockeq requests to use OkHttp #122

Closed
dabitdev opened this issue Nov 28, 2018 · 3 comments
Closed

refactor blockeq requests to use OkHttp #122

dabitdev opened this issue Nov 28, 2018 · 3 comments

Comments

@dabitdev
Copy link
Collaborator

This two request should use OkHttp instead of Volley and they should share the okHttClient instance with Horizon.
"https://api.blockeq.com/directory/assets"
"https://api.blockeq.com/directory/exchanges?asArray"

@Daniel-Wang
Copy link
Contributor

Addressed in part in PR #132

@dabitdev
Copy link
Collaborator Author

dabitdev commented Jan 22, 2019

Stellar sdk 0.3.3

1 - to use stellar sdk 0.3.3 retrofit has to be 2.4.0 because it was clashing with okhttp version 3.12 vs 3.11 (in library)
2 - Issue in Retrofit.Builder().baseUrl("url")), does not exist the method it requires to create base url like val httpUrl = HttpUrl.parse("https://api.blockeq.com/")
3 - Clash in publicsuffixes.gz'
Solution

packagingOptions {
        /* this is to avoid the clash between the shadowed okhttp form stellar sdk */
        exclude 'okhttp3/internal/publicsuffix/publicsuffixes.gz'
    }

4 - Clash with okhttp3 classes, solution exclude dependencies

 implementation("com.squareup.retrofit2:retrofit:$retrofit") {
        exclude group: 'com.squareup.okhttp3', module: 'okhttp'
    }

    implementation("com.squareup.retrofit2:converter-gson:$retrofit") {
        exclude group: 'com.squareup.retrofit2', module: 'retrofit'
        exclude group: 'com.google.code.gson', module: 'gson'
    }

4.1 - make sure to use retrofit = '2.4.0' to match okhttp version methods.
5 - [NOT SOLVED] gson from the library is version 2.4.0 and the com.squareup.retrofit2:converter-gson:2.4.0 is using 2.8.2. The old version does not have the method Gson$newJsonReader

java.lang.NoSuchMethodError: No virtual method newJsonReader(Ljava/io/Reader;)Lcom/google/gson/stream/JsonReader; in class Lcom/google/gson/Gson; or its super classes (declaration of 'com.google.gson.Gson' appears in /data/app/com.blockeq.stellarwallet-StDjOngbQTC8c-vHPahKLA==/split_lib_dependencies_apk.apk)

Stellar sdk 0.4.1

Everything gets shadowed under shadow.* package

@dabitdev
Copy link
Collaborator Author

done in latest version 2.0.7.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants