How do I prevent forge.launchimage assets from being duplicated in my app? - trigger.io

The forge.launchimage module requires that image assets live under the src/ directory of my app.
Unfortunately this results in the final build of my iOS app containing two copies of each of the image assets.
One copy in the package root renamed as Default--.png as well as the original image under src/.
With iOS requiring multiple resolutions of each asset the duplication starts to add up quickly.
Thank you!

Yep - even more painful with the new iOS 7 sizes!
If you don't re-use the launchimage files elsewhere in your app, you could use a postbuild hook to clean up those assets before we create the app. Something like this:
import glob
import shutil
import sys
def main(platform):
if platform == "ios":
for launch_dir in glob.glob("ios/*/assets/src/launch"):
shutil.rmtree(launch_dir)
if __name__ == "__main__":
main(sys.argv[1])

Related

xcassets import a folder of images by creating folder references and not actual copy

I'm trying to import a folder which contains hundred of images to xcassets.
By importing it normally, the problem is that all the actual images are copied (Contents.json file is also generated for each one of them).
I would like them to not be copied but be referenced, similarly to the way we can do so in the project folder by pressing "Add files to ProjectName" and checking the "Create folder references" option.
Is there any way to achieve that?
(In fact I want to use a common assets folder for android and ios in a react-native project, that's why I need this. For android, I did found how to link it to the drawable folder through build.gradle, but for ios not yet)

I cant import React BridgeModule on header file

I am working on a node module that integrates with a native react app. I need to implement in the iOS project the functionalities of the node module written in "swift" and make it available in react. It turns out that when I try to import "RCTBridgeModule", it doesn't exist. I tried various "solutions" with no results.
I clarify that I have changed the name of the xcodeproj (the node module's iOS project) since it collides with the name of a framework that I plan to add.
Honestly, this problem gives me a headache and I don't have much experience with iOS development environments.
Xcode: Version 12.0.1 (12A7300).
Attached screenshots of some files and settings:
Thanks in advance!

Flutter Hot Reload not reloading/refreshing assets

When I add an Image asset to my project and later change the image file in the asset directory without changing its filename, it doesn't update in the app. I've tried hot reload, full restart, uninstalling and reinstalling app, flutter clean, gradle clean. All not working, even invalidate and restart android studio, still not working.
I understand you are updating asset files without changing image name and you are wondering how to tell flutter to reread your asset.
I had the same problem, making small changes to json file included as an asset.
flutter clean
flutter packages get
flutter run
Works for me
No need to delete the directory, flutter clean etc. All you need is this:
import 'package:flutter/widgets.dart';
...
imageCache.clear();
Flutter caches images behind the scene, so if you change the image, you either need to rename it, or use this to clear the cache.
After much tinkering, I deleted the entire directory and recreated it, but this time I made sure that only assets used and related to the project was added to the directory. Hopefully this helps anyone with similar issues.
simply call this
flutter clean &&
flutter packages get &&
flutter run

Why does xcode ignore a symbolically linked app icon in the asset catalog source?

I have the following structure in my iOS Project source folder:
resources:
ios/ mac/
resources/ios:
Images.xcassets/ Info.plist LaunchScreen.storyboard
resources/ios/Images.xcassets:
Contents.json LaunchImage.launchimage/ AppIcon.appiconset/
Everything works fine. If I replace the directory AppIcon.appiconset with a symbolic link to a directory with the exact same content, then when I open Images.xcassets in Xcode it shows only LaunchImage and I get a build error that no icon named AppIcon could be found.
This appears to be an Xcode issue. Is it a bug or by design? If the latter, is there a way around it? I really don't want to have multiple copies of these images in the sources for multiple apps.
I can't use hard links because the code is in a git repo so anything other than the original repo would end up with multiple copies on checkout.
If Xcode refuses to copy resources from symbolic, there is probably no way to do this. However, if you want to strictly keep the icons synchronized, you can use a custom shell script phase in your project, which copies the image assets from the macOS folder to the iOS folder.
Just another, even simpler solution could separation the images into special and common icons, and sharing the complete 'common' asset catalog in both targets.
You can create AppIcon.appiconset as a regular directory and put symlinks inside to each of the shared Contents.json and png files. This requires more symlinks but does centralize the image storage.

Git submodules, shared code and XCode

I have a question regarding shared code and XCode using git submodules.
So, I have Consumer app, having it's own repo. I also have a MyLib app, which has its own repo . The MyLib app contains some shared code.
This is what my MyLib looks like:
The LibComponents group is what contains all the shared code. The MyLib group contains the AppDelegate and other files for the "demo/example app".
This is what the directory structure looks like:
Now, I have a Consumer app, in which I wish to use all files from within the "LibComponents" folder. I've added the MyLib as a submodule to my Consumer's git repo.
This is what my consumer app's project looks like:
Also, this is what my Consumer app's directory structure look like:
Now, regardless of whether I update the files under LibComponent from MyLib or Consumer, and push it to git, it reflects in both places. I'm the owner of both the repositories. This is perfect, as I would like to be able to make minimal changes to the MyLib (shared code) repo when I'm working on my main project (Consumer).
However, I run into a problem with new files. If I add a new file to the MyLib project, push it to git, and pull the changes in my Consumer app, although the local app has the new files, the Consumer app's Xcode project structure does not show the new file. I know that some file in Xcode needs to be told that there is a new file. My question being, what's the best way to go about this?
Thanks in advance for the help!
Cheers!

Resources