Android Pie: WebView showing error for plain HTTP on some sites, even with usesClearTextTraffic=“true”
We have a WebView in our android app that end users can browse to whatever site they want. Android Pie disabled plain HTTP by default, so we added usesClearTextTraffic="true" to our manifest.
This works for some sites, but not for others, like google.com! On the sites that don't work, we still get net::ERR_CLEARTEXT_NOT_PERMITTED as if we hadn't set the manifest setting.
I thought it might be related to HSTS, but in that case I would just expect the WebView to redirect to HTTPS immediately.
So the question is, why is Android WebView still unable to browse some sites by plain HTTP, even when usesClearTextTraffic is turned on in manifest?
(PS We do not have a network security config)
We are testing on Google Pixel 1XL.
plain http not working:
- http://google.com
- http://umajin.com
- http://targetprocess.com
plain http working:
- http://facebook.com
- http://twitter.com
- http://gmail.com
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.umajin.umajinviewer">
<permission android:name="com.umajin.umajinviewer.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.umajin.umajinviewer.permission.C2D_MESSAGE" />
<application android:label="Umajin Preview"
android:icon="@mipmap/ic_launcher"
android:theme="@android:style/Theme.NoTitleBar">
<activity android:name="Umajin"
android:label="Umajin Preview"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="fullSensor"
android:icon="@mipmap/ic_launcher"
android:largeHeap="true"
android:windowSoftInputMode="stateHidden|adjustPan"
android:launchMode="singleTask"
android:usesCleartextTraffic="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
<action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />
</intent-filter>
</activity>
<receiver
android:name=".GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter
android:priority="1">
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.umajin.umajinviewer" />
</intent-filter>
</receiver>
<service android:name=".MyIntentService" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="<redacted>"/>
<!-- Specify which class to instantiate for the alarm messages -->
<receiver android:name="com.umajin.app.AlarmReceiver" >
</receiver>
<!-- Use this receiver if you to excute something at boot -->
<!-- Required if you want alarms to survive a device restart -->
<receiver
android:name="com.umajin.umajinviewer.BootReceiver"
android:enabled="true"
android:exported="true"
android:label="BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<!-- end boot receiver -->
<!-- Add this to play private video files in fullscreen externally through intents. -->
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.umajin.umajinviewer.files"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
<!-- Android Pie specific fix for crash on Google Maps. Throws a ClassNotFoundException when it fails to
find "org.apache.http.ProtocolVersion".
See https://stackoverflow.com/questions/50782806/android-google-maps-java-lang-noclassdeffounderror-failed-resolution-of-lorg-a -->
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<!-- WRITE no longer implies READ. By agreement, we always ask
for both at a time as the user prompts are identical and it can appear to
a user that they have been asked for the same thing twice even though the
underlying permission asked for may be different. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- FINE and COARSE permissions result in the same prompt being displayed to the
user. It can appear to the user that they have been asked for the same thing
twice. By agreement, we always ask for both in one request
to the user to avoid confusing the user. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.NFC" />
<!-- Used for Samsung fingerprint scanner. -->
<uses-permission android:name= "com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY"/>
<!-- Required for Bluetooth LE -->
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<!-- Use this permission if you want your applications to launch on startup -->
<!-- Required if you want alarms to survive a device restart -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- Required for WIFI scanning -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
</manifest>
android http webview
add a comment |
We have a WebView in our android app that end users can browse to whatever site they want. Android Pie disabled plain HTTP by default, so we added usesClearTextTraffic="true" to our manifest.
This works for some sites, but not for others, like google.com! On the sites that don't work, we still get net::ERR_CLEARTEXT_NOT_PERMITTED as if we hadn't set the manifest setting.
I thought it might be related to HSTS, but in that case I would just expect the WebView to redirect to HTTPS immediately.
So the question is, why is Android WebView still unable to browse some sites by plain HTTP, even when usesClearTextTraffic is turned on in manifest?
(PS We do not have a network security config)
We are testing on Google Pixel 1XL.
plain http not working:
- http://google.com
- http://umajin.com
- http://targetprocess.com
plain http working:
- http://facebook.com
- http://twitter.com
- http://gmail.com
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.umajin.umajinviewer">
<permission android:name="com.umajin.umajinviewer.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.umajin.umajinviewer.permission.C2D_MESSAGE" />
<application android:label="Umajin Preview"
android:icon="@mipmap/ic_launcher"
android:theme="@android:style/Theme.NoTitleBar">
<activity android:name="Umajin"
android:label="Umajin Preview"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="fullSensor"
android:icon="@mipmap/ic_launcher"
android:largeHeap="true"
android:windowSoftInputMode="stateHidden|adjustPan"
android:launchMode="singleTask"
android:usesCleartextTraffic="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
<action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />
</intent-filter>
</activity>
<receiver
android:name=".GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter
android:priority="1">
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.umajin.umajinviewer" />
</intent-filter>
</receiver>
<service android:name=".MyIntentService" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="<redacted>"/>
<!-- Specify which class to instantiate for the alarm messages -->
<receiver android:name="com.umajin.app.AlarmReceiver" >
</receiver>
<!-- Use this receiver if you to excute something at boot -->
<!-- Required if you want alarms to survive a device restart -->
<receiver
android:name="com.umajin.umajinviewer.BootReceiver"
android:enabled="true"
android:exported="true"
android:label="BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<!-- end boot receiver -->
<!-- Add this to play private video files in fullscreen externally through intents. -->
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.umajin.umajinviewer.files"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
<!-- Android Pie specific fix for crash on Google Maps. Throws a ClassNotFoundException when it fails to
find "org.apache.http.ProtocolVersion".
See https://stackoverflow.com/questions/50782806/android-google-maps-java-lang-noclassdeffounderror-failed-resolution-of-lorg-a -->
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<!-- WRITE no longer implies READ. By agreement, we always ask
for both at a time as the user prompts are identical and it can appear to
a user that they have been asked for the same thing twice even though the
underlying permission asked for may be different. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- FINE and COARSE permissions result in the same prompt being displayed to the
user. It can appear to the user that they have been asked for the same thing
twice. By agreement, we always ask for both in one request
to the user to avoid confusing the user. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.NFC" />
<!-- Used for Samsung fingerprint scanner. -->
<uses-permission android:name= "com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY"/>
<!-- Required for Bluetooth LE -->
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<!-- Use this permission if you want your applications to launch on startup -->
<!-- Required if you want alarms to survive a device restart -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- Required for WIFI scanning -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
</manifest>
android http webview
Could you please post your Manifest?
– Ümañg ßürmån
Nov 16 '18 at 6:34
Sure, I have added the Manifest. Thanks
– O'Rooney
Nov 20 '18 at 2:23
1
Please check out the solution
– Ümañg ßürmån
Nov 20 '18 at 6:17
add a comment |
We have a WebView in our android app that end users can browse to whatever site they want. Android Pie disabled plain HTTP by default, so we added usesClearTextTraffic="true" to our manifest.
This works for some sites, but not for others, like google.com! On the sites that don't work, we still get net::ERR_CLEARTEXT_NOT_PERMITTED as if we hadn't set the manifest setting.
I thought it might be related to HSTS, but in that case I would just expect the WebView to redirect to HTTPS immediately.
So the question is, why is Android WebView still unable to browse some sites by plain HTTP, even when usesClearTextTraffic is turned on in manifest?
(PS We do not have a network security config)
We are testing on Google Pixel 1XL.
plain http not working:
- http://google.com
- http://umajin.com
- http://targetprocess.com
plain http working:
- http://facebook.com
- http://twitter.com
- http://gmail.com
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.umajin.umajinviewer">
<permission android:name="com.umajin.umajinviewer.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.umajin.umajinviewer.permission.C2D_MESSAGE" />
<application android:label="Umajin Preview"
android:icon="@mipmap/ic_launcher"
android:theme="@android:style/Theme.NoTitleBar">
<activity android:name="Umajin"
android:label="Umajin Preview"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="fullSensor"
android:icon="@mipmap/ic_launcher"
android:largeHeap="true"
android:windowSoftInputMode="stateHidden|adjustPan"
android:launchMode="singleTask"
android:usesCleartextTraffic="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
<action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />
</intent-filter>
</activity>
<receiver
android:name=".GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter
android:priority="1">
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.umajin.umajinviewer" />
</intent-filter>
</receiver>
<service android:name=".MyIntentService" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="<redacted>"/>
<!-- Specify which class to instantiate for the alarm messages -->
<receiver android:name="com.umajin.app.AlarmReceiver" >
</receiver>
<!-- Use this receiver if you to excute something at boot -->
<!-- Required if you want alarms to survive a device restart -->
<receiver
android:name="com.umajin.umajinviewer.BootReceiver"
android:enabled="true"
android:exported="true"
android:label="BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<!-- end boot receiver -->
<!-- Add this to play private video files in fullscreen externally through intents. -->
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.umajin.umajinviewer.files"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
<!-- Android Pie specific fix for crash on Google Maps. Throws a ClassNotFoundException when it fails to
find "org.apache.http.ProtocolVersion".
See https://stackoverflow.com/questions/50782806/android-google-maps-java-lang-noclassdeffounderror-failed-resolution-of-lorg-a -->
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<!-- WRITE no longer implies READ. By agreement, we always ask
for both at a time as the user prompts are identical and it can appear to
a user that they have been asked for the same thing twice even though the
underlying permission asked for may be different. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- FINE and COARSE permissions result in the same prompt being displayed to the
user. It can appear to the user that they have been asked for the same thing
twice. By agreement, we always ask for both in one request
to the user to avoid confusing the user. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.NFC" />
<!-- Used for Samsung fingerprint scanner. -->
<uses-permission android:name= "com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY"/>
<!-- Required for Bluetooth LE -->
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<!-- Use this permission if you want your applications to launch on startup -->
<!-- Required if you want alarms to survive a device restart -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- Required for WIFI scanning -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
</manifest>
android http webview
We have a WebView in our android app that end users can browse to whatever site they want. Android Pie disabled plain HTTP by default, so we added usesClearTextTraffic="true" to our manifest.
This works for some sites, but not for others, like google.com! On the sites that don't work, we still get net::ERR_CLEARTEXT_NOT_PERMITTED as if we hadn't set the manifest setting.
I thought it might be related to HSTS, but in that case I would just expect the WebView to redirect to HTTPS immediately.
So the question is, why is Android WebView still unable to browse some sites by plain HTTP, even when usesClearTextTraffic is turned on in manifest?
(PS We do not have a network security config)
We are testing on Google Pixel 1XL.
plain http not working:
- http://google.com
- http://umajin.com
- http://targetprocess.com
plain http working:
- http://facebook.com
- http://twitter.com
- http://gmail.com
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.umajin.umajinviewer">
<permission android:name="com.umajin.umajinviewer.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.umajin.umajinviewer.permission.C2D_MESSAGE" />
<application android:label="Umajin Preview"
android:icon="@mipmap/ic_launcher"
android:theme="@android:style/Theme.NoTitleBar">
<activity android:name="Umajin"
android:label="Umajin Preview"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="fullSensor"
android:icon="@mipmap/ic_launcher"
android:largeHeap="true"
android:windowSoftInputMode="stateHidden|adjustPan"
android:launchMode="singleTask"
android:usesCleartextTraffic="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
<action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />
</intent-filter>
</activity>
<receiver
android:name=".GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter
android:priority="1">
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.umajin.umajinviewer" />
</intent-filter>
</receiver>
<service android:name=".MyIntentService" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="<redacted>"/>
<!-- Specify which class to instantiate for the alarm messages -->
<receiver android:name="com.umajin.app.AlarmReceiver" >
</receiver>
<!-- Use this receiver if you to excute something at boot -->
<!-- Required if you want alarms to survive a device restart -->
<receiver
android:name="com.umajin.umajinviewer.BootReceiver"
android:enabled="true"
android:exported="true"
android:label="BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<!-- end boot receiver -->
<!-- Add this to play private video files in fullscreen externally through intents. -->
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.umajin.umajinviewer.files"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
<!-- Android Pie specific fix for crash on Google Maps. Throws a ClassNotFoundException when it fails to
find "org.apache.http.ProtocolVersion".
See https://stackoverflow.com/questions/50782806/android-google-maps-java-lang-noclassdeffounderror-failed-resolution-of-lorg-a -->
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<!-- WRITE no longer implies READ. By agreement, we always ask
for both at a time as the user prompts are identical and it can appear to
a user that they have been asked for the same thing twice even though the
underlying permission asked for may be different. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- FINE and COARSE permissions result in the same prompt being displayed to the
user. It can appear to the user that they have been asked for the same thing
twice. By agreement, we always ask for both in one request
to the user to avoid confusing the user. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.NFC" />
<!-- Used for Samsung fingerprint scanner. -->
<uses-permission android:name= "com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY"/>
<!-- Required for Bluetooth LE -->
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<!-- Use this permission if you want your applications to launch on startup -->
<!-- Required if you want alarms to survive a device restart -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- Required for WIFI scanning -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
</manifest>
android http webview
android http webview
edited Nov 20 '18 at 2:33
O'Rooney
asked Nov 13 '18 at 21:22
O'RooneyO'Rooney
8921129
8921129
Could you please post your Manifest?
– Ümañg ßürmån
Nov 16 '18 at 6:34
Sure, I have added the Manifest. Thanks
– O'Rooney
Nov 20 '18 at 2:23
1
Please check out the solution
– Ümañg ßürmån
Nov 20 '18 at 6:17
add a comment |
Could you please post your Manifest?
– Ümañg ßürmån
Nov 16 '18 at 6:34
Sure, I have added the Manifest. Thanks
– O'Rooney
Nov 20 '18 at 2:23
1
Please check out the solution
– Ümañg ßürmån
Nov 20 '18 at 6:17
Could you please post your Manifest?
– Ümañg ßürmån
Nov 16 '18 at 6:34
Could you please post your Manifest?
– Ümañg ßürmån
Nov 16 '18 at 6:34
Sure, I have added the Manifest. Thanks
– O'Rooney
Nov 20 '18 at 2:23
Sure, I have added the Manifest. Thanks
– O'Rooney
Nov 20 '18 at 2:23
1
1
Please check out the solution
– Ümañg ßürmån
Nov 20 '18 at 6:17
Please check out the solution
– Ümañg ßürmån
Nov 20 '18 at 6:17
add a comment |
1 Answer
1
active
oldest
votes
Solution:
As I've observed the Manifest.xml
of yours, you have used the android:usesCleartextTraffic="true"
in the <activity>
tag.
As you can see in the Documentation of the activity tag, it does not offer any functionality as such in the syntax provided in the docs.
As you can see in the screenshot below, the description of the cleartexttraffic is quite straight forward.
Also, if you look at the Documentation of the application tag, you will notice that android:usesCleartextTraffic
is one of the attributes of the Application Tag
.
So the only fix required here is to remove the attribute in from the activity tag and use it in the application tag and there is no activity tag support for android:usesCleartextTraffic
.
Starting with Android 9 (Pie) Clear Text Traffic is disabled by default.
Hence, the solution would be:
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
</manifest>
Try it, Please comment if you have any issues related to this.
Aha, thanks. I made a stupid mistake.
– O'Rooney
Nov 21 '18 at 4:47
The only mystery is why some sites were apparently working without it. Perhaps they are in HSTS lists and therefore redirect to HTTPS within the webview.
– O'Rooney
Nov 21 '18 at 4:48
@O'Rooney Yeah, Anyway I'm glad the answer helped. :)
– Ümañg ßürmån
Nov 21 '18 at 5:26
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53289679%2fandroid-pie-webview-showing-error-for-plain-http-on-some-sites-even-with-usesc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Solution:
As I've observed the Manifest.xml
of yours, you have used the android:usesCleartextTraffic="true"
in the <activity>
tag.
As you can see in the Documentation of the activity tag, it does not offer any functionality as such in the syntax provided in the docs.
As you can see in the screenshot below, the description of the cleartexttraffic is quite straight forward.
Also, if you look at the Documentation of the application tag, you will notice that android:usesCleartextTraffic
is one of the attributes of the Application Tag
.
So the only fix required here is to remove the attribute in from the activity tag and use it in the application tag and there is no activity tag support for android:usesCleartextTraffic
.
Starting with Android 9 (Pie) Clear Text Traffic is disabled by default.
Hence, the solution would be:
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
</manifest>
Try it, Please comment if you have any issues related to this.
Aha, thanks. I made a stupid mistake.
– O'Rooney
Nov 21 '18 at 4:47
The only mystery is why some sites were apparently working without it. Perhaps they are in HSTS lists and therefore redirect to HTTPS within the webview.
– O'Rooney
Nov 21 '18 at 4:48
@O'Rooney Yeah, Anyway I'm glad the answer helped. :)
– Ümañg ßürmån
Nov 21 '18 at 5:26
add a comment |
Solution:
As I've observed the Manifest.xml
of yours, you have used the android:usesCleartextTraffic="true"
in the <activity>
tag.
As you can see in the Documentation of the activity tag, it does not offer any functionality as such in the syntax provided in the docs.
As you can see in the screenshot below, the description of the cleartexttraffic is quite straight forward.
Also, if you look at the Documentation of the application tag, you will notice that android:usesCleartextTraffic
is one of the attributes of the Application Tag
.
So the only fix required here is to remove the attribute in from the activity tag and use it in the application tag and there is no activity tag support for android:usesCleartextTraffic
.
Starting with Android 9 (Pie) Clear Text Traffic is disabled by default.
Hence, the solution would be:
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
</manifest>
Try it, Please comment if you have any issues related to this.
Aha, thanks. I made a stupid mistake.
– O'Rooney
Nov 21 '18 at 4:47
The only mystery is why some sites were apparently working without it. Perhaps they are in HSTS lists and therefore redirect to HTTPS within the webview.
– O'Rooney
Nov 21 '18 at 4:48
@O'Rooney Yeah, Anyway I'm glad the answer helped. :)
– Ümañg ßürmån
Nov 21 '18 at 5:26
add a comment |
Solution:
As I've observed the Manifest.xml
of yours, you have used the android:usesCleartextTraffic="true"
in the <activity>
tag.
As you can see in the Documentation of the activity tag, it does not offer any functionality as such in the syntax provided in the docs.
As you can see in the screenshot below, the description of the cleartexttraffic is quite straight forward.
Also, if you look at the Documentation of the application tag, you will notice that android:usesCleartextTraffic
is one of the attributes of the Application Tag
.
So the only fix required here is to remove the attribute in from the activity tag and use it in the application tag and there is no activity tag support for android:usesCleartextTraffic
.
Starting with Android 9 (Pie) Clear Text Traffic is disabled by default.
Hence, the solution would be:
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
</manifest>
Try it, Please comment if you have any issues related to this.
Solution:
As I've observed the Manifest.xml
of yours, you have used the android:usesCleartextTraffic="true"
in the <activity>
tag.
As you can see in the Documentation of the activity tag, it does not offer any functionality as such in the syntax provided in the docs.
As you can see in the screenshot below, the description of the cleartexttraffic is quite straight forward.
Also, if you look at the Documentation of the application tag, you will notice that android:usesCleartextTraffic
is one of the attributes of the Application Tag
.
So the only fix required here is to remove the attribute in from the activity tag and use it in the application tag and there is no activity tag support for android:usesCleartextTraffic
.
Starting with Android 9 (Pie) Clear Text Traffic is disabled by default.
Hence, the solution would be:
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
</manifest>
Try it, Please comment if you have any issues related to this.
answered Nov 20 '18 at 5:54
Ümañg ßürmånÜmañg ßürmån
3,1283930
3,1283930
Aha, thanks. I made a stupid mistake.
– O'Rooney
Nov 21 '18 at 4:47
The only mystery is why some sites were apparently working without it. Perhaps they are in HSTS lists and therefore redirect to HTTPS within the webview.
– O'Rooney
Nov 21 '18 at 4:48
@O'Rooney Yeah, Anyway I'm glad the answer helped. :)
– Ümañg ßürmån
Nov 21 '18 at 5:26
add a comment |
Aha, thanks. I made a stupid mistake.
– O'Rooney
Nov 21 '18 at 4:47
The only mystery is why some sites were apparently working without it. Perhaps they are in HSTS lists and therefore redirect to HTTPS within the webview.
– O'Rooney
Nov 21 '18 at 4:48
@O'Rooney Yeah, Anyway I'm glad the answer helped. :)
– Ümañg ßürmån
Nov 21 '18 at 5:26
Aha, thanks. I made a stupid mistake.
– O'Rooney
Nov 21 '18 at 4:47
Aha, thanks. I made a stupid mistake.
– O'Rooney
Nov 21 '18 at 4:47
The only mystery is why some sites were apparently working without it. Perhaps they are in HSTS lists and therefore redirect to HTTPS within the webview.
– O'Rooney
Nov 21 '18 at 4:48
The only mystery is why some sites were apparently working without it. Perhaps they are in HSTS lists and therefore redirect to HTTPS within the webview.
– O'Rooney
Nov 21 '18 at 4:48
@O'Rooney Yeah, Anyway I'm glad the answer helped. :)
– Ümañg ßürmån
Nov 21 '18 at 5:26
@O'Rooney Yeah, Anyway I'm glad the answer helped. :)
– Ümañg ßürmån
Nov 21 '18 at 5:26
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53289679%2fandroid-pie-webview-showing-error-for-plain-http-on-some-sites-even-with-usesc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Could you please post your Manifest?
– Ümañg ßürmån
Nov 16 '18 at 6:34
Sure, I have added the Manifest. Thanks
– O'Rooney
Nov 20 '18 at 2:23
1
Please check out the solution
– Ümañg ßürmån
Nov 20 '18 at 6:17