Jetpack Compose Remove `material-icons-extended` unused icon - android-jetpack-compose

As mentioned on this page, unreferenced icons can be deleted through R8/Proguard, how do I delete them?
https://developer.android.google.cn/reference/kotlin/androidx/compose/material/icons/package-summary

Related

Unused Bundle Resource, not found on disk, after deleting it?

I'm trying to delete all the unused assets, to decrease the app size (icons, launch screens, etc), I started with the iOS project, but now I'm getting errors like this:
Bundle Resource 'Icon-Small#3x.png' not found on disk (should be at
'D:\Work\MyProj\MyProj\MyProj\MyProj.iOS\Resources\Icon-Small#3x.png')
I deleted the specified file, but it's not used in the project, at least it's not visually used. Some of the missed files are the default Xamarin X icons.
I deleted the array items in CFBundleIconFiles key, which pointed to all the missing files, but still getting the same error.
I don't know well about xamarin. But in Xcode, the images files are removed from Xcode better than from Find file utilities.
The project has a directory, .xcodeproj. And a file project.pbxproj will describe how many files will be compiled, and how many images resources in this project.
If a image file was deleted from file system, but it is still in this project.pbxproj. Then the compiler will argue this problem about it failed to find the image resource file.
So, deleting a image file in Xcode, will remove the entry from project.pbxproj and remove it from file system.
In Xcode, it will mark red colors for those missed files, I think xamarin should has similar feature too.
In iOS , some icons are required . Items marked with "Required" must be included.Refer the following image.
As we can seen ,Icon-Small#3x.png is required.It used for seetings on device (such as iPhoneX and iPhoneXs Max).Such as the icon in the following image.
So ,though you have deleted the array items in CFBundleIconFiles key.You will still get the error .
The reason you are getting this error is chances are you deleted the source files, but Xamarin still keeps on referencing them.
So resolve this error go to each folder, Resources and Resources/Drawables on android and delete each image separately. This should fix your issue

Xcode: Remove reference to files not showing up as option

I meant to add one file to my project and I accidentally added the entire directory.
Yikes!
I realized it immediately and tried to hit cancel to no avail. The entire directory which contains lots of other Xcode projects got added to my xcode project.
I now want to remove all those files. Normally, you delete and it gives the option to remove reference or move to trash. In this case I don't want to move to trash as I don't want to delete the underlying files, only their presence in this project. However, it is not giving me the option to remove references. It is only giving the option to move to trash or cancel.
Can anyone suggest why I am not getting option to remove reference? Or alternatively, can you suggest how to remove all these files without moving them to trash.
Thanks in advance for any suggestions.
The project sub folder you might not be getting the remove reference option since there is no location for it in file inspector, try doing the delete operation on that root folder(of extra files added).
Still if you wont get option here are couple of options:
You can discard your local changes, if your repo is GIT and you are using SourceTree just reset your files or discard also you can do that from XCode > Source Control > Discard All changes
Select that folder in project and in the file inspector track the file path and take backup and then perform delete action with Move to trash option
Or if you don't have further option and not other way to fix, check out the code in new directory and trash the current one.

GoogleTagManager warning: No default container found. Container needs to be added to a container folder and added to the target

While trying to implement Google Tag Manager v5 in my Swift app, I faced the following warning, which caused me some troubles :
GoogleTagManager warning: No default container found. Container needs to be added to a container folder and added to the target.
It took me more time than it should have, and since the answer for my problem was pretty hard to find and was not on SO, I decided to create this Q&A, in case some people would be in the same situation as mine !
First, make sure you're using the correct GTM container type : it should be displayed as iOS, not as iOS (legacy) here : https://tagmanager.google.com/?hl=en#/home
Then, create a folder named container in your project, and download your actual container in it.
Now, you just have to import the folder you just created :
right click into Xcode file tree
"Add files to 'MyProject'"
click the container folder
then the options button
select create folder reference
select also copy items if needed
select your targets
click the add button.
Everything should work as expected now ! In order to be sure you made things right, the container folder should appear as a blue folder in your Xcode file tree, not as a yellow one.

Is there a way in Xcode to remove all references that cannot be located anymore?

I recently removed images that are not referenced any more from sources. Since these images are so many, I have deleted them outside the Xcode, with customized shell script.
Now for the remaining references - is there a way to instantly remove them in Xcode, other than repeatedly selecting them and pressing delete key?

Unable to see image files in xcode folder reference

I added a folder which contains some images in Xcode as "Create folder references for any added folders". It added the blue folder but it doesn't show the arrow to see its contents.
Is this an issue in Xcode or am I missing something ?
Screenshot :
Blue folder means you added folder reference ,not folder
Right click on the images folder you added and select show in finder...See if the images are there..if not.. you linked the wrong folder
Make sure the search bar at bottom of the file explorer is empty
You have added the folder in a wrong way. To create a reference folder select the checkbox
'Copy items into destination's group folder if needed'
and in folder options select the radio button
"Create folder references for any added folders".
This works.
If you use blue folder references for your resources these folders will also be created inside your application bundle, while resource files in groups will simply be copied to your mainBundle's root directory.
When folder structure is managed outside of XCode (for example, a cross-platform project which has project files for different versions of XCode, Visual Studio and other IDEs, all using mostly the same directory tree), you normally want folder references. Otherwise one would have to recreate every project file every time folder structure changes.
This is Your solution->
if you do want to auto-import newly added files from the file system's folder to this group in XCode, instead of using "Create groups for any added folders", change to "Create folder references to any added folders"

Resources