Flutter internet conneciton not working real device - android

Hello I have App in Play Store. I updated the app and flutter 2.0 but when ı download the app in playstore internet connection not working. I builded release mode and send the normal phone internet connection working but if someone want the download the app in playstore connection is not working ı don't understand where is the problem.
This is my main Androidmanifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.agronet_seracilik">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Agronet Seracılık A.Ş"
android:icon="#mipmap/ic_launcher">``
<activity
android:name=".MainActivity"
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"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<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>

You need to give permission to application in manifest
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Agronet Seracılık A.Ş"
android:icon="#mipmap/ic_launcher"
android:usesCleartextTraffic="true"> --> Add this line to send http request after flutter 2.0

Related

Edit android manifest correctly

I'm trying to use the flutter_foreground_plugin for my project but I'm having difficulty understanding how to edit the android manifest file.
these are the required edits:
These are my interpretations of said edits:
What am I doing wrong? I get the error
error: FlutterForegroundPlugin() has private access in FlutterForegroundPlugin
flutterEngine.getPlugins().add(new changjoopark.com.flutter_foreground_plugin.FlutterForegroundPlugin());
Open FlutterForegroundPlugin.java
change from private FlutterForegroundPlugin() {} to public FlutterForegroundPlugin() {}
This AndroidManifest.xml can help you how to configure your project.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="changjoopark.com.flutter_foreground_plugin_example"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Flutter ForegroundService Example"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<service android:name="changjoopark.com.flutter_foreground_plugin.FlutterForegroundService"/>
</application>
<uses-sdk
android:minSdkVersion="23"
tools:overrideLibrary="changjoopark.com.flutter_foreground_plugin" />
</manifest>
You can also try to download this example and try to run it on your machine so you can clear your doubts.
Thank you.

the app didn't appear in my phone flutter

I have flutter app,
I made some edit on the android side, and I added the native java code, and made some edit on manifest after the edit, flutter app didn't appear in my phone,
but the app appears in settings in apps
what is the problem ??
this is my Arduino manifest:
<application
android:name="io.flutter.app.FlutterApplication"
android:label="flutter app"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
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"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<data android:scheme="com.jopoint" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- <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" />
<service
android:name="com.oppwa.mobile.connect.service.ConnectService"
android:exported="false"/>
<activity
tools:replace="android:theme,android:windowSoftInputMode"
android:name="com.oppwa.mobile.connect.checkout.dialog.CheckoutActivity"
android:theme="#style/Theme.Checkout.Light"
android:windowSoftInputMode="adjustPan"
android:exported="false"
android:launchMode="singleTop"/>
</application>
</manifest>
what is the problem?
You commented out android.intent.action.MAIN action of your intent filter (docs).

cannot access my storage in flutter in a real android device after installing the apk

I access to my internal storage and camera in release mode with intellij idea. But when I generate the apk and deploy in a real android device it does not work.
Can you help me please?
This is my android manifest. When I want to access to the camera or the storage or googlemaplocation. It does nothing.
Thanks
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lesvoisins.app.simo.rafik.lesvoisins_flutterV2">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:name="io.flutter.app.FlutterApplication"
android:label="lesvoisins_flutterV2"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
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"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"/>
<!-- 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" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
</application>

Flutter: Schedule notification not working

I am developing a app using Flutter.
To show notification I an using flutter_local_notifications package.
I am getting notification, but schedule notification is not working.
Similar question was asked here How do I schedule a notification in Flutter?, but my receiver is already inside the application tag.
Here is my manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.folk.gayatrimonitor">
<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="gayatri_monitor"
android:icon="#mipmap/ic_launcher">
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
</intent-filter>
</receiver>
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
adding this inside application of your manifest might solve your problem
<service android:name="com.folk.localnotifications.services.LocalNotificationsService"
android:exported="false" />
Remember: com.folk is used for this project only. For different project, go to your manifest, see package name and edit accordingly.
I had the same problem but couldn't find the solution online, however, later I did figure out running flutter clean then flutter run seems to do the trick for me.
You have to essentially clean your build and rebuild it again. Hope that helps.
I had the same issue, I solved it by creating a separate notification channel for each android notification I was issuing, even if they share the same priority.
In my case, I just added the following inside initState()
var initializationSettingsAndroid =
AndroidInitializationSettings('#mipmap/ic_launcher');
var initializationSettingsIOS = IOSInitializationSettings();
var initializationSettings = InitializationSettings(
android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
flutterLocalNotificationsPlugin.initialize(
initializationSettings,
);

Launching app from HomeScreen (shortcut) and from App drawer, is not the same

I've encountered a weird behaviour. Maybe someone could clarify it.
When I download my app from GooglePlay, there are 2 icons that are added. One goes to the Home Screen as a shortcut and another goes to the App Drawer (the screen with all the different installed apps I got on my device).
Now here is the flow of events:
I install the app from GooglePlay
I launch the app once installation is complete, also from GooglePlay (There's an open button) --> This launches the app, shows a splash screen and goes to my main screen
I navigate around in my app to a different screen
I click the home button to go to the Home Screen.
Now the interesting part:
I press the Home Screen shortcut icon GooglePlay has created for me to get back to my app --> This takes me to the exact same screen I was in.
I click the home button again to go to the Home Screen.
This time, I press the App Drawer shortcut icon to get back to my app --> This shows the splash screen again and takes me to my main screen.
This happens constantly. Each shortcut launches to a different state (or screen).
Notice that there is only one app in the Recent list.
On a the other hand. If I create the Home Screen shortcut myself, I get the same results when I launch the app from both icons.
Something is different with the shortcut GooglePlay is creating for me.
Any ideas?
EDIT
Here is the AndroidManifest.xml
Some names where changed. Some information (that is not related to intent-filters) had to be removed..
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.xxxx.xxxxjh"
android:installLocation="internalOnly">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
tools:node="replace"
android:name=".xxxxgggApplication"
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:largeHeap="true"
android:hardwareAccelerated="true"
android:theme="#style/AppTheme" >
<activity
android:name=".view.activities.StartupActivity"
android:theme="#style/AppThemeNoBar"
android:windojhoftInputMode="adjustResize|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".view.activities.WelcomeActivity"
android:theme="#style/WelcomeActivityStyle"/>
<activity
android:name=".view.activities.AccountActivity"
android:theme="#style/AppThemeNoBar"
android:windojhoftInputMode="adjustResize|stateHidden"/>
<activity
android:name=".view.activities.UrlSchemeHandlerActivity"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="xxxx" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="xxxx5.4" />
</intent-filter>
</activity>
<activity
android:name=".view.activities.FileManagerActivity"
android:label="#string/app_name"
android:launchMode="singleTask"
android:logo="#drawable/fm_drawer"
android:theme="#style/AppThemeBar"
android:windojhoftInputMode="adjustPan|stateHidden"/>
<activity
android:name=".view.activities.ViewerActivity"
android:label="#string/launcher_activity_label"
android:theme="#style/AppThemeNoBar"
android:windojhoftInputMode="adjustResize|stateHidden"
android:parentActivityName=".view.activities.FileManagerActivity" >
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".view.activities.FileManagerActivity" />
</activity>
<activity
android:name=".view.activities.DemoActivity"
android:label="#string/launcher_activity_label"
android:theme="#style/WelcomeActivityStyle"
android:windojhoftInputMode="adjustResize|stateHidden" />
<activity
android:name=".view.activities.ApplicationSettingsActivity"
android:logo="#drawable/fm_drawer"
android:label="#string/AG_Settings"
android:windojhoftInputMode="adjustResize|stateHidden">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xxxx.xxxxjh.view.activities.FileManagerActivity" />
</activity>
<activity
android:name=".view.activities.WebViewActivity"
android:logo="#drawable/fm_drawer"
android:theme="#style/AppThemeBar" />
<service android:name="com.xxxx.sdk.controller.service.account.AccountService" >
<!-- Actions and meta data goes here... -->
</service>
<service android:name="com.xxxx.sdk.controller.service.storage.StorageService">
<!-- Actions and meta data goes here... -->
</service>
<service android:name="com.xxxx.sdk.controller.service.designFeed.DesignFeedService">
<!-- Actions and meta data goes here... -->
</service>
<service android:name="com.xxxx.sdk.controller.service.ConfigService">
<!-- Actions and meta data goes here... -->
</service>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
I am sorry to tell you that this is not a bug in your project but an android default behaviour. I did some research ending up in the following threads. Maybe you can filter out some useful information and test these approaches in your project.
App completely restarting when launched by icon press in launcher
Android application restarts when opened by clicking the application icon
Greetz.

Categories

Resources