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

Illegal Argument Exception: Illegal URL #80

Open
CamposErik opened this issue Dec 21, 2018 · 0 comments
Open

Illegal Argument Exception: Illegal URL #80

CamposErik opened this issue Dec 21, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@CamposErik
Copy link

CamposErik commented Dec 21, 2018

Describe the bug
When I try to call the GLPI class it gives this error.
image

    void start(String url) {

        OkHttpClient okHttpClient = new OkHttpClient().newBuilder()
                .connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS)
                .readTimeout(READ_TIMEOUT, TimeUnit.SECONDS)
                .writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS)
                .build();

        retrofit = new Retrofit.Builder()
                .baseUrl(url)
                .client(okHttpClient)
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .build();

    }
}
2018-12-21 11:01:24.027 12537-12537/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.flyve.admin.dashboard, PID: 12537
    java.lang.RuntimeException: Unable to start activity ComponentInfo{org.flyve.admin.dashboard/org.flyve.admin.dashboard.login.LoginActivity}: java.lang.IllegalArgumentException: Illegal URL: 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3194)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3302)
        at android.app.ActivityThread.-wrap12(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891)
        at android.os.Handler.dispatchMessage(Handler.java:108)
        at android.os.Looper.loop(Looper.java:166)
        at android.app.ActivityThread.main(ActivityThread.java:7425)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
     Caused by: java.lang.IllegalArgumentException: Illegal URL: 
        at retrofit2.Retrofit$Builder.baseUrl(Retrofit.java:454)
        at org.glpi.api.ServiceGenerator.start(ServiceGenerator.java:58)
        at org.glpi.api.GLPI.<init>(GLPI.java:79)
        at org.flyve.admin.dashboard.login.LoginActivity.onCreate(LoginActivity.java:67)
        at android.app.Activity.performCreate(Activity.java:7372)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3147)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3302) 
        at android.app.ActivityThread.-wrap12(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891) 
        at android.os.Handler.dispatchMessage(Handler.java:108) 
        at android.os.Looper.loop(Looper.java:166) 
        at android.app.ActivityThread.main(ActivityThread.java:7425) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921) 
2018-12-21 11:01:24.054 751-2461/? E/iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
final GLPI glpi = new GLPI(MainActivity.this, BuildConfig.GLPI_URL);
@CamposErik CamposErik added the bug label Dec 21, 2018
@CamposErik CamposErik added this to the 1.0 milestone Dec 21, 2018
@CamposErik CamposErik self-assigned this Dec 21, 2018
@ajsb85 ajsb85 changed the title Error trying to call GLPI class IllegalArgumentException: Illegal URL: Dec 21, 2018
@ajsb85 ajsb85 changed the title IllegalArgumentException: Illegal URL: Illegal Argument Exception: Illegal URL Dec 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants