my flutter application does not send requests to my server in the real android emulator or simulator I don’t think there is a problem on the server side because it works normally on ios in the same way I can send requests with postman I tried the ways I saw on the internet but it didn’t get better my android manifest file is like this thanks for your help in advance
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:usesCleartextTraffic="true"
android:label="seederzone"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
2
Answers
**I solved the problem, maybe there will be those who experience the same error, I am writing the solution here, since my website, which I send requests with api, uses ssl, this cannot be verified on the android side and did not send requests to the server. To fix this, I added my ssl certificate to my assets and added the following to the main file of my application **
The codes you need to add are as I mentioned above
It should be enough, iOS doesn’t require that but Android does.
Make sure after you save the updated AndroidManifest.xml you perform a full reinstall on your device, by running these at your project folder:
ps:
You can also try this simple code to check if it really is a internet permission problem or if it is your requisition (add the http package and run on release mode):