Reputation: 435
I am a flutter beginer, while installing the android license by command "flutter --android-licenses", I have gotten the exception as follows:
Failed to create settings
Exception in thread "main" java.lang.IllegalArgumentException: port out of range:-1
at java.base/java.net.InetSocketAddress.checkPort(InetSocketAddress.java:153)
at java.base/java.net.InetSocketAddress.<init>(InetSocketAddress.java:198)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createAddress(SdkManagerCliSettings.java:177)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:485)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:58)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:49)
I try to search solution a lot of, but I have no result. So could everyone help me? Many thanks!
Upvotes: 1
Views: 306
Reputation: 208
Had the same problem and the suggested fixes/workarounds didn't help. So I scannt the source code of SdkManagerCliSettings and found the problem is related to the handling of proxy settings.
My solution was to add the correct proxy settings via an environment variable.
export HTTPS_PROXY=proxy.sample.com:3128
Upvotes: 0
Reputation: 14865
Try my answer here hope its help to you
Or Try below steps:
Upvotes: 1