Android Studio Launcher Icon - Icon Name Must Be Set - android

I am developing a Flutter app right now and trying to change the Android app's icon to a .png image. On Android Studio, I get this error when I do File -> New -> Image Asset:
Any help with this?

In you pubspec.yaml file add this,
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.6.1"
flutter_icons:
android: true
ios: "Example-Icon"
image_path: "assets/icon/icon.png"
image_path_android: "assets/icon/icon_android.png"
image_path_ios: "assets/icon/icon_ios.png"
adaptive_icon_background: "#FFFAFAFA"
adaptive_icon_foreground: "assets/icon/icon-foreground.png"
More information can be found here

Related

Flutter launcher_icon and native_splash android problem

I am beginner in flutter, and I started learning from the very beginning of creating the application and immediately encountered a problem that I cannot solve only on android. When i create packages launcher_icon and native_splash, on ios everything works as it should, but on android at the splash screen all the time it gives me only the application icon and not default splash screen as in ios.
how could i fix it to work on android?
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter_launcher_icons: ^0.10.0
flutter_native_splash: ^2.2.7
flutter_icons:
android: true
ios: true
image_path: "assets/icon_anny.png"
min_sdk_android: 21
flutter_native_splash:
color: "#fafafa"
image: assets/splash_screen.png
color_dark: "#000000"
image_dark: assets/splash_screen_dark.png
android: true
ios: true
android_gravity: fill
ios_content_mode: scaleAspectFill
I managed to solve the problem, Android 12 has a different way of showing the splash screen. It is also necessary to open a new one flutter_native_splash.yaml and there are all the instructions and it works perfectly.
You should run a command line after adding parameters to pubspec.yaml:
flutter pub run flutter_native_splash:create
I just fixed this problem today go in your project and create a flutter_native_splash.yaml and follow the instructions on https://pub.dev/packages/flutter_native_splash.

Dart Socket ERROR: ../../third_party/dart/runtime/bin/socket_android.cc:147: `reusePort` not supported for Android

I'm new to flutter development. I'm building a remote app for android and iOS that will let users to control their legacy TV via infrared, and smart tv via WIFI. This exception only appears for android. On iOS app is working fine. I' using the following package to discover devices in my app.
upnp2: ^0.3.2
Here is all the dependencies used in my project.
cupertino_icons: ^1.0.2
rxdart: ^0.27.3
sqflite: ^2.0.2
shared_preferences: ^2.0.12
ir_sensor_plugin: ^0.2.0
introduction_screen: ^2.1.0
network_info_plus: ^2.1.2
ping_discover_network_forked: ^0.0.1
web_socket_channel: ^2.1.0
http: ^0.13.4
upnp2: ^3.0.6
multicast_dns: ^0.3.2
There is no other exception appeared in tracing. I don't know why its happening only for android while its working fine for iOS. Please help me!
the new version of upnp2 (3.0.10) should have fixed this issue, sorry for the late response. Please try out again and let me know the results.

How to change app icon in flutter using VS Code?

How to change the app icon in Flutter using VS Code?
I am trying it again and again but it's not working. I've seen different methods online with no positive outcome.
You can make use of the flutter_launcher_icons: ^0.9.2 package
Create new folder named assets and a subfolder inside that named icon then make changes in your pubspec.yaml file like following:
dev_dependencies:
flutter_launcher_icons: "^0.9.2"
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
Here the icon image should be icon.png and it will be stored in the path : assets/icon
now in terminal run
flutter pub get
for further info check this as reference. And this video might be helpful.
With the help of flutter plugin you may change flutter icon package:
flutter_launcher_icons: ^0.9.2
Step 1:
dev_dependencies:
flutter_launcher_icons: "^0.9.2"
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
Step 2:
flutter pub get
Use current method Flutter Launcher Icons.
Edit pubspec.yaml file:
dev_dependencies:
flutter_launcher_icons: "^0.10.0"
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
min_sdk_android: 21 # android min sdk min:16, default 21
web:
generate: true
image_path: "path/to/image.png"
background_color: "#hexcode"
theme_color: "#hexcode"
windows:
generate: true
image_path: "path/to/image.png"
icon_size: 48 # min:48, max:256, default: 48
Go to Terminal:
flutter pub get
flutter pub run flutter_launcher_icons:main
Have a nice day...
Source: [https://pub.dev/packages/flutter_launcher_icons][1]

Why my iOS app's size created with Flutter is 475MB?

I created my first app. Not so big, news app. My dependencies:
provider: ^4.3.2+2
url_launcher: ^5.5.2
share: ^0.6.5+4
shared_preferences: ^0.5.10
flutter_html: ^1.0.2
cached_network_image: ^2.3.3
flutter_spinkit: "^4.1.2"
pull_to_refresh: ^1.6.3
sqflite: ^1.3.2+1
path_provider: ^1.6.24
connectivity: ^2.0.2
yoyo_player:
shimmer: ^1.1.2
firebase_messaging: ^7.0.3
dio_http_cache: ^0.2.11
dio: ^3.0.10
hive: ^1.4.4+1
hive_flutter: ^0.3.1
scrollable_positioned_list: ^0.1.8
I will list app sizes in different cases:
flutter build apk => size around 25MB.
flutter build apk --split-per-abi => size around 10MB.
flutter build ios => size of Runner.app is 475MB (I'm not joking).
Ok I can compress it => size 203MB - This is
Ok, flutter I'll create a blank app
flutter build ios => size of Runner.app is 65MB and after compress 23 (this seems affordable).
I hope this will you
flutter clean
flutter build ios --analyze-size
After I Archived app with XCode and deployed to the App Store app size was only 45MB (shown on Console) and after download to actual device size was only 29 MB.
From 475 to 29MB. That was amazing!
I think this can be helpful to someone else, so don't worry about size...

flutter: got error when I add http dependency

I'm studying flutter networking in flutter docs. I totally follow the guidance but when I add http dependency then click Packages get then I get an error. What's wrong? Thanks for any advice.
dependencies:
flutter:
sdk: flutter
qrscan: ^0.2.17
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
http: ^0.12.2 // http dependency I added
the error info is below
Running "flutter pub get" in myProject...
Unexpected character (at character 1)
<html>
^
dart:convert jsonDecode
package:pub/src/source/hosted.dart 190:17 BoundHostedSource._fetchVersions
===== asynchronous gap ===========================
dart:async _CustomZone.runUnary
package:pub/src/rate_limited_scheduler.dart 82:30 RateLimitedScheduler._processNextTask.runJob
package:pub/src/rate_limited_scheduler.dart 85:30 RateLimitedScheduler._processNextTask
dart:async new Future.sync
package:pool/pool.dart 126:18 Pool.withResource.<fn>
This is an unexpected error. Please run
pub --trace '--verbosity=warning' get --no-precompile
and include the logs in an issue on https://github.com/dart-lang/pub/issues/new
pub get failed (65; and include the logs in an issue on https://github.com/dart-lang/pub/issues/new)
Process finished with exit code 65
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
http: ^0.12.2 // http dependency I added
qrscan: ^0.2.17
please write code in this sequence

Categories

Resources