Flutter Cleartext HTTP traffic not permitted - flutter

I have gone through the usual answers. I have edited the info.plist on iOS and added the network_config.xml in Android. This works perfectly when running the project from XCode, but when trying to run the debug from Android Studio, I get the
Cleartext HTTP traffic to 192.168.1.54 not permitted
Seems like Flutter is ignoring my iOS and Android configurations regarding this matter, but only when running it directly from Android Studio.

Please add below code in your manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
</manifest>
You can read details here https://medium.com/#imstudio/android-8-cleartext-http-traffic-not-permitted-73c1c9e3b803

Related

google_maps_flutter does not work correctly on Android 11

I am using the google_maps_flutter package and whenever I click the button to launch the google map I encounter this error:
google maps is not installed or is disabled
But such a thing was not true :(((
This error is happened to me in Android 11.
please help me to solve this.
To fix this, you will need to add the Google Maps package "com.google.android.apps.maps" as an entry in your AndroidManifest.xml entry:
<manifest package="com.your.package">
<queries>
<package android:name="com.google.android.apps.maps" />
</queries>
...
</manifest>

Google maps is not installed or disabled

I have an app that user google navigation but as I am trying to use it it says:
"google maps is not installed or disabled". I have read in the internet that this is an Android 11 issue. Any thoughts how to fix this?
To fix this, you will need to add the Google Maps package "com.google.android.apps.maps" as an entry in your AndroidManifest.xml entry:
<manifest package="com.your.package">
<queries>
<package android:name="com.google.android.apps.maps" />
</queries>
...
</manifest>

Insecure HTTP is not allowed by platform

I am facing following issue :
I/flutter (31349): Bad state: Insecure HTTP is not allowed by platform: http://max-image-caption-generator-test.2886795296-80-host19nc.environments.katacoda.com/model/predict
I added following lines in android/app/src/main/AndroidManifest.xml file
<uses-permission android:name="android.permission.INTERNET" />
<application
android:usesCleartextTraffic="true"
</application>
But still I am facing the error
HTTP connections are not allowed anymore since Flutter 2.0 on Android and iOS.
There are two solutions: You can use only HTTPS connections or you can activate unsecure connections (e.g. for debugging). The following article describes how to do this: https://flutter.dev/docs/release/breaking-changes/network-policy-ios-android or Flutter Insecure http is not allowed by platform
You need to take permission to use http
For Android -> android:usesCleartextTraffic="true" in application in AndroidManifest.xml file
<application
...
android:usesCleartextTraffic="true">
For IOS -> add below lines in Info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

ionic base64togallery plugin not working in android-targetSdkVersion 29

I'm using base64-to-gallery to save images for android devices in my ionic app.
Previously it was working fine but now after added <preference name="android-targetSdkVersion" value="29" />to config.xml file, under android platform, it's not working.
Please kindly help me with it.
Finally solved the issue. To anyone who is struggling, I will explain as below.
As mentioned in the git, https://github.com/Nexxa/cordova-base64-to-gallery , ionic Cordova base64togallery plugin has been discontinued.
And also when trying to submit the ionic mobile app for Android production, it's saying that the target SDK version should be more than 29.
But as usual, if we add <preference name="android-targetSdkVersion" value="29" /> to the config.xml file under the Android platform, it will not work the base64togallery plugin (not saving images to your device)
So you have to do like below,
In your ionic project, go to build.gradle file (platforms\android\build.gradle) and change defaultTargetSdkVersion and defaultCompileSdkVersion to 29. (as below)
defaultTargetSdkVersion=29
defaultCompileSdkVersion=29
And then go to AndroidManifest.xml file
(platforms\android\app\src\main\AndroidManifest.xml) and add android:requestLegacyExternalStorage="true" to the application tag, as showing below.
<application android:hardwareAccelerated="true" android:icon="#mipmap/ic_launcher" android:label="#string/app_name" android:networkSecurityConfig="#xml/network_security_config" android:requestLegacyExternalStorage="true" android:supportsRtl="true">
Then try to build your app for debug or release versions.

unable to deploy Android APK on a blackberry device

I have been trying to figure this out for a couple of days now,
I created some apps, I followed the steps to get a signed APK (https://www.udacity.com/wiki/ud853/course_resources/creating-a-signed-apk) .
The APK installs fine on android devices, but when I try to deploy on BB device, I get a "unable to install" message. An APK (downloaded from google play to my PC, then saved to the BB device) installs fine on the BB device, but non of my apps can be installed.
I think I am missing something I should do before or after creating the signed APK. Is there a way to diagnose or find the reason the installation is failing??
Here is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.asamater.myapplication" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Solved:
minimum supported API must be 18 or under.