Flutter build failed error..androidmanifest doesn't have application tag - flutter

C:\Users\devis\AndroidStudioProjects\vitality\android\app\src\debug\AndroidManifest.xml:7:9-33 Error:
Attribute application#label value=(vitality) from AndroidManifest.xml:7:9-33
is also present at [io.kommunicate.sdk:kommunicateui:2.1.6] AndroidManifest.xml:14:9-41 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:6:5-43:19 to override.
this was the error^^^^
this is my androidmanifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="devisuresh.vitality">
<!-- 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"/>
</manifest>
im confused where to add what since i dont have an application tag.

You need to find the AndroidManifest file at the following hierarchy
android/app/src/main
then you need to add tools:replace="android:label to between application tags
To elaborate :
<application
android:name="io.flutter.app.FlutterApplication"
android:requestLegacyExternalStorage="true"
android:label="xxxxx"
android:usesCleartextTraffic="true"
tools:replace="android:label" // here it goes
android:icon="#mipmap/ic_launcher">

Related

How to implement Facebook SDK Pixel on Xamarin.Forms to capture Login, Installs, Uninstalls

My company has a campaign which has an objective to increase te installations of its apps.
Our App was done in Xamarin.Forms 4.8.
I have read many many sites and searched for any tutorial about how to do that, but unfourtunatelly, I do not find anything. There are so many material about FB Login in Xamarin, was nothing about FB Pixel to get events in your xamarin.forms app.
I have read that there is a type of registration of those events in FB, called nocode, where the app sends some basic events to FB, without any code. You just need to install the nuget lib (Android and iOS) and configure AndroidManifest and info.plist files, with the pixel number, which is called FacebookAppId.
Below, is part of my AndroidManifest file:
...
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.AD_ID" />
<application android:label="#string/app_name" android:icon="#drawable/balao">
<uses-library android:name="org.apache.http.legacy" android:required="false" />
<provider android:name="android.support.v4.content.FileProvider" android:authorities="io.app.meusebrae.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="#xml/file_paths"></meta-data>
</provider>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id" />
<activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="#string/app_name" />
<activity android:name="com.facebook.CustomTabActivity" android:exported="true">
...
Below, part of my info.plist file:
...
<key>FacebookAppID</key>
<string>874......</string>
<key>FacebookDisplayName</key>
<string>Meu Sebrae</string>
...
I have the nuget libs Xamarin.Facebook.Android and Xamarin.Facebook.iOS installed.
According to some sites, it would be the only configuration needed to make it to run, but nothing is sent to FB dashboard, where I monitor the events captured.
So, please, I really need some tutorial or anybody to explain me, what I really need to do, and if I am doing anything wrong.
Thanks.
Marcelo.

Unresolved package 'flutter'

I download the flutter project from git hub start implementing in my android studio to learn but I get this problem in AndroidManifest.xml file only here and I also install all dependencies.
Please resolve my problem.
enter image description here
enter image description here
enter image description here
Change the android\app\src\main\AndroidManifest.xml file.
From :
<application
android:name="io.flutter.app.FlutterApplication"
To :
<application
android:name="${applicationName}"
or
<application
android:name="your_app_name"
add this three lines if does not exist :
<meta-data
android:name="flutterEmbedding"
android:value="2" />
You need to change the "android:name" in android\app\src\main\AndroidManifest.xml file.
Make sure it's value is:
"${applicationName}"

Bad state: Insecure HTTP is not allowed by platform: http://0.0.0.0:9090

I'm trying to connect to a Ros WebSocket service at ws://local host:9090 (runned with rosbridge) from my flutter application, but i'm getting the following error in Flutter:
Bad state: Insecure HTTP is not allowed by platform: http://local host:9090
Open the AndroidManifest.xml file in the android/app/src/main folder.
Then set usesCleartextTraffic to true.
<application
...
android:usesCleartextTraffic="true"
... >
Make sure of permission and set android:usesCleartextTraffic to true
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="receipt"
android:usesCleartextTraffic="true"
android:icon="#mipmap/ic_launcher">
As Aia Ashraf said you must add internet permission to your manifest file:
<uses-permission android:name="android.permission.INTERNET" />
Please add android:usesCleartextTraffic="true" to your both AndroidManifest.xml files in yourapp\android\app\src\debug\AndroidManifest.xml., and yourapp\android\app\src\main\AndroidManifest.xml. like below:
<application
...
android:usesCleartextTraffic="true"
... >
And the last thing is to be sure that your windows firewall is turned off.
Here is Flutter documentation about this question:
https://docs.flutter.dev/release/breaking-changes/network-policy-ios-android

Suggestion: add 'tools:replace="android:name"' to <application> element at AndroidManifest.xml to override

I got an error
Attribute application#theme value=(#style/Theme.AppCompat.NoActionBar) from [:flutter_barcode_scanner] AndroidManifest.xml:17:9-59
is also present at [:stripe_payment] AndroidManifest.xml:9:18-74 value=(#style/Theme.AppCompat.Light.NoActionBar).
Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:22:5-109:19 to override.
When i try to add the tools:replace="android:theme" to <application> but it didn’t fixed the error
I have fixed this error by the following steps
Select any dart file and then Go Tools > Flutter > Opening for editing Android Studio
Now wait to complete it all the process (Grande, indexing etc)
Select Android like below in image
Find flutter_barcode_scanner and open manifests/AndroidManifest.xml
add xmlns:tools="http://schemas.android.com/tools" to AndroidManifest.xml header
Add tools:replace="android:theme" to the <application ...
like below code
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<application
android:largeHeap="true"
android:theme="#style/Theme.AppCompat.NoActionBar">
<activity android:name="com.amolg.flutterbarcodescanner.BarcodeCaptureActivity" />
</application>
This all above steps repeat for stripe_payment.

Flutter - Local Notifications fail in release mode

I added the flutter_local_notifications plugin to schedule notifications. In the debug version everything works well for both emulators and real devices.
However, when I build the app
flutter build apk --split-per-abi
and install the package on a device and run the app, when it comes to the code part that marks the notification (I supposed...) , the app crashes
How do I find out what's wrong?
I followed the plugin developers instructions and changed the manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.explika">
<uses-permission android:name="android.permission.INTERNET" />
<!-- Tudo relacionado com as notificações -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE" />
<!-- Fim relacionado com notificações -->
<!-- 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="Explika"
android:icon="#mipmap/ic_launcher">
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<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>
</application>
</manifest>
I found out what is causing the application to crash:
[ERROR: flutter / shell / platform / android / platform_view_android_jni.cc (39)] java.lang.AssertionError: java.lang.NoSuchFieldException: Drawable
However, this only happened in the Release version. The solution consists of customizing the ProGuard configuration file and the build.gradle file following the instructions on the plugin page.
I didn't do these steps because until then the Release version worked without problems and because I thought ProGuard configuration file would only be necessary in case want to publish on the Play Store.