-
Notifications
You must be signed in to change notification settings - Fork 7
run example error #1
Comments
Can you send your AndroidManifest.xml ? And check the path and name of your AndroidManifest.xml |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dynamic_icon">
<!-- 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="dynamic_icon"
android:icon="@mipmap/ic_launcher">
<activity
android:enabled="true"
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">
</activity>
<activity-alias
android:label="Default"
android:icon="@mipmap/ic_launcher"
android:name=".DEFAULT"
android:enabled="true"
android:targetActivity=".MainActivity">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<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-alias>
<activity-alias
android:label="Blue"
android:icon="@mipmap/ic_launcher1"
android:name=".BLUE"
android:enabled="false"
android:targetActivity=".MainActivity">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<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-alias>
<activity-alias
android:label="Yellow"
android:icon="@mipmap/ic_launcher2"
android:name=".YELLOW"
android:enabled="false"
android:targetActivity=".MainActivity">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<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-alias>
<!-- 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 try to run |
When I get back home, I'll check. |
Thanks!
|
This is my project, you can try to run it |
Ok so, it's strange. -- edit |
I published a new update. But you can only use one other icon. In the next days I'll fix this |
The new version can be used, but it has defects. We look forward to the next version to fix it. thank |
Hello there. How is the progress of adapting to Android, because I can't wait to use it. Thanks 😜 |
Hi, I'm the only one that is working on this project, and I have to work on other projects too. I don't know when I'll have the time to work on this. Today I have a little bit of time to work on this. |
This version(^0.0.2) can already switch multiple icons, but there is a problem with returning to the default icon apiAndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dynamic_icon">
<!-- 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="dynamic_icon"
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">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<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-alias
android:label="dynamic_icon"
android:icon="@mipmap/ic_launcher"
android:name=".DEFAULT"
android:enabled="true"
android:targetActivity=".MainActivity">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<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-alias>
<!-- FOR NOW USE "ALT" AS ALTERNATIVE ICON NAME, FOLLOW https://github.com/GioPan04/flutter_icon_switcher/issues/1 FOR MORE INFO -->
<activity-alias
android:label="Blue"
android:icon="@mipmap/ic_launcher1"
android:name=".BLUE"
android:enabled="false"
android:targetActivity=".MainActivity">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<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-alias>
<!-- FOR NOW USE "ALT" AS ALTERNATIVE ICON NAME, FOLLOW https://github.com/GioPan04/flutter_icon_switcher/issues/1 FOR MORE INFO -->
<activity-alias
android:label="Yellow"
android:icon="@mipmap/ic_launcher2"
android:name=".YELLOW"
android:enabled="false"
android:targetActivity=".MainActivity">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<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-alias>
<!-- 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> main.dart ListTile(
leading: Image.asset('assets/ic_launcher.png'),
title: Text('Default'),
onTap: () async {
// success
await FlutterIconSwitcher.updateIcon('DEFAULT');
// error
try {
await FlutterIconSwitcher.resetIcon();
} catch (e) {
print(e);
}
},
),
ListTile(
leading: Image.asset('assets/ic_launcher1.png'),
title: Text('Blue'),
onTap: () async {
// success
await FlutterIconSwitcher.updateIcon('BLUE');
},
),
ListTile(
leading: Image.asset('assets/ic_launcher2.png'),
title: Text('Yellow'),
onTap: () async {
// success
await FlutterIconSwitcher.updateIcon('YELLOW');
},
), |
Well yes that it can. I said that you can use only one alternative icon because in 0.0.2 I hard coded that it disable the alias-activity named "ALT". This because, for some reason, when I check what alias-activity is enabled it returns always "MainActivity" |
Hope the next version can add the following functions by the way, thank you /// Fetches the current iconName
/// Returns null if the current icon is the default icon
Future<String> getIconName() |
I see that there have been no more commits ... has the project been abandoned? |
@robman70 I'm making a pr into flutter_dynamic_icon. I'm busy right now, so it's not finished yet. |
Hi, @GioPan04! Thanks for the package. What do you think about adding functionality to set more than 1 one icon as an alternative? |
Launching lib/main.dart on GM1910 in debug mode...
lib/main.dart:1
package identifier or launch activity not found.
Please check /Users/mac/Desktop/flutter_icon_switcher/example/android/app/src/main/AndroidManifest.xml for errors.
No application found for TargetPlatform.android_arm64.
Is your project missing an android/app/src/main/AndroidManifest.xml?
Consider running "flutter create ." to create one.
Exited (sigterm)
The text was updated successfully, but these errors were encountered: