'Host name may not be empty
After upgrading my Android Studio, I got this error whenever I wanted to generate a signed Apk (without any detail of where the problem is). There was no problem when I just built Apk.
The Host name may not be empty
Solution 1:[1]
Check your Gradle scripts root. If there is this file: gradle.properties (Global Properties), check that values are correct.
In my case, I removed all these properties and my problem solved
systemProp.http.proxyHost=
systemProp.http.proxyPort=80
systemProp.https.proxyHost=
systemProp.https.proxyPort=80
Solution 2:[2]
It may be problem with uploadMappingFile
Set the firebaseCrashlytics.enableMappingFileUpload
Gradle extension property to true in your app-level build.gradle file.
// To enable Crashlytics mapping file upload for specific product flavors:
flavorDimensions "environment"
productFlavors {
staging {
dimension "environment"
...
firebaseCrashlytics {
mappingFileUploadEnabled false
}
}
prod {
dimension "environment"
...
firebaseCrashlytics {
mappingFileUploadEnabled true
}
}
}
for more details visit here
Solution 3:[3]
Yep, problem started at AS 4.0 up.. Here are the clearer fixes... (Cos Some may think the "gradle.properties" file being talked about here is what is in the AS project instead of the global one.
Delete the following lines from the "gradle.propeties" file on your PC gradle installation location
systemProp.http.proxyHost= systemProp.https.proxyHost= systemProp.https.proxyPort=80 systemProp.http.proxyPort=80
as seen in n my picture below here is a typical file location of this gradle.propeties file
Now click rebuild in your project and VIOLA... Problem solved
Solution 4:[4]
I got the same issue, I fixed that issue by applying Proguard rules,
https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=android
In project proguard-rules.pro
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
Gradle
firebaseCrashlytics { mappingFileUploadEnabled true }
Solution 5:[5]
This issue is caused due to empty xml file in your res directory. Open the res directory in explorer/finder sort all the xml according to their size. Find the xml with 0kb / empty xml and delete it. Now you can create your signed bundled apk.
Solution 6:[6]
When I removed all the http.proxyPort then it works.
Solution 7:[7]
For me, the issue was WebDriver requiring a fully qualified url. Switching from localhost:9000
to http://localhost:9000/
did the trick for me (hopefully helps others too).
This is because the WebDriver method void get(String url);
was being called and giving the error:
The Host name may not be empty
The java doc for the param states:
Params: url – The URL to load. Must be a fully qualified URL
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Pratik Butani |
Solution 2 | Mansukh Ahir |
Solution 3 | |
Solution 4 | Amir Jehangir |
Solution 5 | shrikarkorwar |
Solution 6 | imsjkumar |
Solution 7 | CodeMonkey123 |