how do I inherit launcher icons from a library project in android? - android

I have several apps dependent on a library project. I wish them all to use the same launcher icons. Unfortunately this doesn't seem to be getting inherited?
I'm getting the generic icon for android...

I had the same problem: my App does not select the launcher icon on the library project but uses the default Android icon.
As suggested in comments, I inserted a line in the manifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mylib="schemas.android.com/apk/res/mylib.libpackage.libbase
package="myapp.apppackage.appbase"
android:versionCode="100"
android:versionName="2.1.0" >
The line is:
xmlns:base="schemas.android.com/apk/res/mylib.libpackage.libbase
the name space mylib.libpackage.libbase is the package name defined in the library manifes.xml.
to reference the launcher icon use
android:icon="#mylib:drawable/ic_launcher"
But.. this not works for me!
Simply I found I need to use the standard approach:
android:icon="#drawable/ic_launcher"
and deleted the ic_launcher resource form all libraries used in my project (except for the library used as icon resource).

Related

How to add app icon properly in android react-native

Hi I added icons to android/app/src/main/res/..., the app icon showing perfectly in home screen like first image, but when minimize the app it showing default app icon like second image. how can change that icon also.
I cleaned build folder, gradlew and reinstalled the app but no changes.
Please help me on this
put this on AndroidManifest.xml and try
<application
...
android:icon="#drawable/ic_launcher"
...
</application>
also hope you update the icons properly. please refer this
https://code.tutsplus.com/tutorials/how-to-update-the-launcher-icon-for-your-android-app--cms-30624
I'm not sure if this comes after you setup androidManifest.xml but you will need icons in these two folders:
android/app/src/main/res/mipmap.
ios//Images.xcassets/AppIcon.appiconset
I've used the resize-reactnative-launcher-icon shell scrip to generate my icons. It takes a png image and creates the 25 variations you need by size and resolution.
bash resize.sh my-cool-new-app-logo.png

Strange App Icon behaviour

I have replaced the standard android studio app icon (ic_launcher) with my own(one for each dimension in the mipmap folders) and deleted the ic_launcher round icons since i won't be using round icons on my app. The problem is that although the icons show up correctly in the res->mipmap->ic_launcher folder, when i install the app on my phone the app's icon is the default one and not the one i chose. Also, if you go into tje phone's app info, the app's icon shows up correctly. I have no clue on why this is happening. Any idea?
Go to manifest and look for roundicon and dont forget to change there.
Go to manifest and replace default icon name with yours here:
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"

Resource is override in Android

I have library project and main project. In library project, I have an icon with R.id.ic_generic_error and in main project, I have the alternative icon with the same id. In runtime, my app always display main project version of icon although I use package name like that com.libraryname.R.id.ic_generic_error.
Now I wanna use the icon of library. is it possible?
Give a different resource name to the library icon. Library resources are always overridden by project resources with the same name.
If you need the ic_generic_error icon to exist in the library project (because, for instance, it is referenced in a layout or in code), you can create an alias to the renamed library icon. See Creating alias resources for info on how to do this.

Android application's ic_launcher is not working

i have a application can't show ic_launcher. before asking question,i do like those:
1. In my AndroidManifest.xml like this
<application android:icon="#drawable/ic_launcher" ...>
...
</application>
there's a pic called ic_launcher in folder drawable.
but in launcher application's icon always can't show ic_launcher.
my android device can show xxhdpi source. so i remove ic_launcher to folder xxhdpi, it can work fine. i want to know why.
please help,thank you .
First Clean and build again your project. If you still facing same issue and if you are using Eclipse IDE then press "ctrl+space" after you typed android:icon="#drawable/ . All available image resource should come as a list. Then you choose appropriate icon for your application and re-run your application.

Bad XML block, Error: No resource found that matches the given name (at 'icon' with value '#android:drawable

Background: I am using Eclipse to develop an Android app. I have an xml file that contains a menu that contains three items. Each of the items contains an android:icon declaration. Only the first android:icon declaration is referenced in my program. NOTE: The second two android:icon declarations are NOT referenced ANYWHERE in my program or in any of the project files.
The Problem: I tried in vain to add a fourth menu item and discovered something very baffling to me. Not only cannot I not add an item to my menu, I cannot alter the existing last two android:icon declarations or I get the errors described in the title. For example I cannot change the following android:icon declaration from:
android:icon="#android:drawable/ic_menu_preferences"
To:
android:icon="#android:drawable/ic_menu_preference"
I find this very baffling because the android:icon is declared but not referenced anywhere in my program or in any of the project files. And none of the "solutions" I found on the internet fix my problem. And as I write this Stackoverflow is telling me my question has been asked and answered, but it hasn't!
Any ideas anyone?
NOTE: The second two android:icon declarations are NOT referenced ANYWHERE in my program or in any of the project files
They are in your menu. Otherwise, the android:icon attributes would not exist. Hence, the icons are referenced by the menu itself.
For example I cannot change the following android:icon declaration
That is because there is no icon in the OS with that name.
Also, unless every icon you use in your menu will come from the OS, you are better served by copying them from your SDK into your project. Some OEMs replace the standard icons with their own versions. If you will be mixing OS icons with your own icons, even if you design your icons to match those on, say, the emulator, they will not match on other devices. By copying the icons from the SDK into your project, you ensure consistency within your menu -- if the icons look right on the emulator, they will look the same on other devices.
I find this very baffling because the android:icon is declared but not referenced anywhere in my program or in any of the project files.
The icon is part of the menu. Otherwise, the android:icon attribute would not exist. Hence, the non-existent icon is referenced by the menu itself.
The line #android:drawable/ic_menu_preferences is actually a reference itself. It is referencing a standard Android image that is displayed on your menu item. Here is some documentation to help you with drawables.
i think , you have added a png file which is corrupted
follow this link , probably it will help you

Categories

Resources