Dart/flutter: firebase issue when I hot reload - flutter

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?
`````

Related

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

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

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">

flutter audio_service not working, errors in AndroidManifest.xml

I am attempting to recreate the audio_service tutorial on GitHub and it is not working, no sound is playing when you click the play button. I have observed an error in the AndroidManifest.xml which seems to be related - the documentation of course requires you add lines to the AndriodManifest.xml file.
However I am getting errors on the lines and which I suspect could be causing the problem. The errors are "Class referenced in the manifest, _______ , was not found in the project or the libraries / Unresolved package '___' " for both.
I did include these dependencies in my pubspec.yaml:
audio_service: ^0.15.1
just_audio: ^0.5.2
Note that I am having the same problem on both my Windows 10 development environment and on my MacBookPro running Catalina. Does anyone know how I can resolve this? What am I missing?
Here is my complete AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tv.realhelp.new_audio_service_test">
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<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="new_audio_service_test"
android:icon="#mipmap/ic_launcher"
android:usesCleartextTraffic="true">
<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">
<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" />
<service android:name="com.ryanheise.audioservice.AudioService">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>
<receiver android:name="com.ryanheise.audioservice.MediaButtonReceiver" >
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
</application>
</manifest>

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>