Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] android – Retrofit Okhttp duplicated slash in some of the URLs

Posted on November 11, 2022 By

Solution 1 :

I found my mistake. I passed empty string. This wasn’t duplicated slash.

Problem :

After I uploaded new version of my app to Google Play, users who updated to the latest version in some of the request URLs have duplicated slash. If remove app from phone and install again from Play Market everything is OK. I tested in my two latest version. First I installed version 1.0 and under version 1.0 I installed version 1.1. After this some requests in URL have duplicated slash. But when installed only latest version everything works OK.
Duplicated slash: https:www.newsasa.com/subs//dash
I need: https:www.newsasa.com/subs/dash

final RETROFIT_VERSION = '2.7.1'
implementation "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
implementation "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
implementation "com.squareup.retrofit2:adapter-rxjava2:$RETROFIT_VERSION"
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.16'
implementation 'com.squareup.okhttp3:okhttp:4.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.4.0'

    Retrofit provideRetrofit(OkHttpClient okHttpClient, GsonConverterFactory gsonConverterFactory) {
        return new Retrofit.Builder()
                .baseUrl(https://mydomainname.com)
                .client(okHttpClient)
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .addConverterFactory(gsonConverterFactory)
                .build();
    }

    @GET("/subscriptions/{account}/offers/{lang}")
    Observable<List<Offer>> getOffers(@Path("account") String account, @Path("lang") String lang);

Comments

Comment posted by shmakova

Show your retrofit api class

Comment posted by Divyanshu

Show api client and api interface

Comment posted by TikTak

I updated question

Comment posted by TikTak

after I cleared data everthing works OK. What could be the problem?

Comment posted by github.com/square/retrofit/issues/3323

This my question in github

READ  [FIXED] java - Change "Month" text color in CalendarView
Powered by Inline Related Posts
Android Tags:android, okhttp, retrofit

Post navigation

Previous Post: Can a beginner learn Moonlight Sonata 1st Movement?
Next Post: [FIXED] java – App keeps crashing when ListView item is clicked on

Related Posts

[FIXED] android – Set RecyclerView start position when installing the app first time Android
[FIXED] java – Exoplayer throws player is accessed on the wrong thread Exception Android
[FIXED] dialog – How to set gravity of WindowFeature supported Activity android Android
[FIXED] How can I show a notification to user from a background running service in android? Android
[FIXED] android – Which ThemeData property changes component background color? Android
[FIXED] android – I am confused when to use instrumentation test and when to use unit test Android

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • What is a good substitute for condensed milk?
  • ¿Como el cuerpo te avisa cuando te va a dar un infarto?
  • What is the luxury brand of Jaguar?
  • Who is Big poppa baseball player?
  • What material are foam runners?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme