My app not working with the phone emulator but is working with the browser - flutter

My app work normal when i use the chrome emulator but when i use a real phone or phone emulator not working and i get this error
**FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction Android resource linking failed**
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.birthday">
<application
android:label="birthday"
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|gender|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>

Its hard to say what is the error without XML file, but I had a similar problem where I changed compileSdkVersion and targetSdkVersion in build.gradle to some other versions and it resolved the problem.
If this doesen't help share your XML file

Related

Dart/flutter: firebase issue when I hot reload

I am running into a weird error on the terminal, but the app works fine...
If I completely sign-out of the app, then login, everything works fine.
Once I login and I do a hot reload, that's when I run into the following issue::
D/EGL_emulation(12080): app_time_stats: avg=357.28ms min=13.08ms max=12953.00ms count=39
W/DynamiteModule(12080): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
I/DynamiteModule(12080): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
W/ProviderInstaller(12080): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
D/TrafficStats(12080): tagSocket(120) with statsTag=0xffffffff, statsUid=-1
I added the following line to 'AndroidManifest.xml':
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
here is the whole 'AndroidManifest.xml' file::
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="na.mynotes">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:label="mynotes"
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>
Any ideas what I am doing wrong?
I should I delete the line i added?
`````

Caused by: java.io.FileNotFoundException at ImageResizerTest.java:50

i'm trying to develop an app, but every time i run .gradlew build it fails giving the error: image_picker_android:testDebugUnitTest FAILED and Caused by: java.io.FileNotFoundException at ImageResizerTest.java:50.
my manifest.xml is:
"http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.my_firstapp">
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:label="food_track"
android:icon="#drawable/launch_background">
<activity
android:name="com.example.my_firstapp.MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="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.aptreesoftware.barcodescan.BarcodeScannerActivity"/>
<!-- 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>
i'm not understanding what does it mean

Flutter AndroidManifest.xml "Manifest merger failed" error

I am trying to add dependencies for Paypal inside my Android Manifest file but i got this weird error:
Error
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : Attribute application#label value=(welpie) from AndroidManifest.xml:6:9-31
is also present at [org.jfrog.cardinalcommerce.gradle:cardinalmobilesdk:2.2.4-1] AndroidManifest.xml:15:9-41 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:5:5-52:19 to override.
Here is my android manifest file
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.welpie">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />
<application
android:label="welpie"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:exported="true"
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.braintreepayments.api.BraintreeBrowserSwitchActivity"
android:launchMode="singleTask">
<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="${applicationId}.braintree" />
</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>
I checked the codes in file but I don't understand why there is an error.
How can I solve it?
It seems one of your dependency (cardinalmobilesdk) includes android app name designation. It may be not what you want.
Just follow the instruction like the following (though I can't try)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.welpie">
...
<application
tools:replace="android:label"
android:label="welpie"
android:icon="#mipmap/ic_launcher">

error after updating minsdkversion in flutter 2.8

I am a beginner in flutter. I have update minSdkVersion from 19 to 21 and getting the following error. Please Please help. any kind of help is much appreciated. Thank you in advance.
Manifest merger failed : Attribute application#label value=(Car_Wash_App) from AndroidManifest.xml:11:9-37
is also present at [org.jfrog.cardinalcommerce.gradle:cardinalmobilesdk:2.2.4-1] AndroidManifest.xml:15:9-41 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:9:5-48:19 to override.
here is the manifest file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.Car_Wash_App">
<!-- 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="Car_Wash_App"
android:icon="#mipmap/ic_launcher"
tools:replace="android:label">
<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>
Buddy you just need to migrate your project to androidX
open android directory of your project in android studio
wait for gradle to finish its task
then go to tools -> migrate to androidX
click migrate
click do refactor
or you can simply follow steps from following answer https://stackoverflow.com/a/54857699/16793736
You have to change your android manifest file like below
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example">
<application
android:allowBackup="true"
android:label="#string/app_name"
android:supportsRtl="true">
</application>
</manifest>
To
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.name"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:label="App Name"
android:supportsRtl="true"
tools:replace="android:label">
</application>
</manifest>
And now the android:label is replaced by the label from the parent application.

API not working/http error SocketException: Failed host lookup in Release Build(working in debug mode) For Flutter

Getting Some Of Notes Regarding path_provider-1.5.1 and API not working which I integrated through http/dio in Release Build(working in debug mode) For Flutter.
Note:
/home/webelightpc/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.5.1/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java
uses or overrides a deprecated API. Note: Recompile with
-Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note:
Recompile with -Xlint:deprecation for details.
According to https://github.com/flutter/flutter/issues/27883
It's strange that without adding permission in AndroidManifest.xml it'll work in debug but in release modeany API request will not work, solutions is as simple as below...
just add permission like this
<uses-permission android:name="android.permission.INTERNET" />
in your app's android/app/src/main/AndroidManifest.xml
For those people who are new in flutter,here is the full demo. you have to add permission above "Application" tag
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.reprecinct.app.reprecinct">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="your app label"
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>