Uli Niggemann
05/22/2023, 2:27 PMCan't read color textColor from bundle NSBundle ....bundle> (not yet loaded), please check moko-resources gradle configuration
The module is static due to compose-multiplatform and I have added the Build-Phase for cocoapods-usage…
So what could possibly go wrong? 😉
Do you have any ideas what I am missing?alex009
05/22/2023, 3:10 PM.app
file it contains .bundle
with your resources class packageframework
in gradle build directory contains itUli Niggemann
05/22/2023, 3:15 PM(not yet loaded)
alex009
05/22/2023, 3:16 PMUli Niggemann
05/22/2023, 3:16 PM*my_lib.bundle> (not yet loaded), please check moko-resources gradle configuration*
alex009
05/22/2023, 3:22 PMnil
. i think it's not related to bundle
- we already found bundle
but get of color not workUli Niggemann
05/22/2023, 3:30 PMalex009
05/22/2023, 3:32 PMUli Niggemann
05/22/2023, 3:39 PMalex009
05/22/2023, 3:43 PMUli Niggemann
05/23/2023, 9:10 AMalex009
05/23/2023, 9:11 AMUli Niggemann
05/23/2023, 9:11 AMalex009
05/23/2023, 9:11 AMUli Niggemann
05/23/2023, 9:13 AMalex009
05/23/2023, 9:15 AMUli Niggemann
05/23/2023, 9:16 AMalex009
05/23/2023, 9:19 AMUli Niggemann
05/23/2023, 9:19 AMalex009
05/23/2023, 9:21 AMUli Niggemann
05/23/2023, 9:21 AMBundle.allBundles
at runtime?alex009
05/23/2023, 9:22 AMUli Niggemann
05/23/2023, 9:22 AMprint(Bundle.allBundles)
will doalex009
05/23/2023, 9:23 AMUli Niggemann
05/23/2023, 9:26 AMalex009
05/23/2023, 9:27 AMprint(Bundle.allBundles)
let colors = MR.colors.shared
print(colors.nsBundle)
print(colors.textColor.bundle)
print(Bundle.allBundles)
let color = UIColor(
named: colors.textColor.name,
in: colors.textColor.bundle,
compatibleWith: nil
)
print("color: \(color)")
Uli Niggemann
05/23/2023, 9:27 AMalex009
05/23/2023, 9:27 AMUli Niggemann
05/23/2023, 9:28 AM[NSBundle </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/BoundingPathData.bundle> (not yet loaded), NSBundle </Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/F70B4CDA-2D4A-43E2-A6CE-2D1D68923616/My application.app> (loaded)]
NSBundle </Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/F70B4CDA-2D4A-43E2-A6CE-2D1D68923616/My application.app/MyApplication:shared.bundle> (not yet loaded)
NSBundle </Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/F70B4CDA-2D4A-43E2-A6CE-2D1D68923616/My application.app/MyApplication:shared.bundle> (not yet loaded)
[NSBundle </Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/F70B4CDA-2D4A-43E2-A6CE-2D1D68923616/My application.app/MyApplication:shared.bundle> (not yet loaded), NSBundle </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/BoundingPathData.bundle> (not yet loaded), NSBundle </Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/F70B4CDA-2D4A-43E2-A6CE-2D1D68923616/My application.app> (loaded)]
color: nil
alex009
05/23/2023, 9:28 AMcompatibleWith
parameter...Uli Niggemann
05/23/2023, 9:30 AMalex009
05/23/2023, 9:30 AMlet color = UIColor(
named: colors.textColor.name,
in: colors.textColor.bundle,
compatibleWith: UITraitCollection.current
)
check this?print("traits: \(UITraitCollection.current)")
and thisUli Niggemann
05/23/2023, 9:34 AMalex009
05/23/2023, 9:35 AMtraits: <UITraitCollection: 0x600003e5f500; UserInterfaceIdiom = Phone, DisplayScale = 3, DisplayGamut = P3, HorizontalSizeClass = Compact, VerticalSizeClass = Regular, UserInterfaceStyle = Light, UserInterfaceLayoutDirection = LTR, ForceTouchCapability = Unavailable, PreferredContentSizeCategory = L, AccessibilityContrast = Normal, UserInterfaceLevel = Base>
Uli Niggemann
05/23/2023, 9:35 AM[NSBundle </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/BoundingPathData.bundle> (not yet loaded), NSBundle </Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/D54E186D-D3A7-4882-A965-36ED410F0579/My application.app> (loaded)]
NSBundle </Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/D54E186D-D3A7-4882-A965-36ED410F0579/My application.app/MyApplication:shared.bundle> (not yet loaded)
NSBundle </Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/D54E186D-D3A7-4882-A965-36ED410F0579/My application.app/MyApplication:shared.bundle> (not yet loaded)
[NSBundle </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/BoundingPathData.bundle> (not yet loaded), NSBundle </Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/D54E186D-D3A7-4882-A965-36ED410F0579/My application.app> (loaded), NSBundle </Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/D54E186D-D3A7-4882-A965-36ED410F0579/My application.app/MyApplication:shared.bundle> (not yet loaded)]
color: nil
The bundle is there, but not loadedalex009
05/23/2023, 9:36 AMUli Niggemann
05/23/2023, 9:37 AMalex009
05/23/2023, 9:38 AMNSBundle </Users/amikhailov/Library/Developer/CoreSimulator/Devices/5C91DD9B-AE1A-4BB5-A58B-ED2D322D691D/data/Containers/Bundle/Application/3D530DCE-1D31-4BF9-A871-E19E2FD8E856/My application.app/My application:shared.bundle> (not yet loaded)
it's bundle that resources found and there contains colorUli Niggemann
05/23/2023, 9:39 AMtraits: <UITraitCollection: 0x600001677000; UserInterfaceIdiom = Phone, DisplayScale = 3, DisplayGamut = P3, HorizontalSizeClass = Compact, VerticalSizeClass = Regular, UserInterfaceStyle = Light, UserInterfaceLayoutDirection = LTR, ForceTouchCapability = Unavailable, PreferredContentSizeCategory = L, AccessibilityContrast = Normal, UserInterfaceLevel = Base>
alex009
05/23/2023, 9:40 AMlet files = colors.textColor.bundle
.paths(forResourcesOfType: nil, inDirectory: nil)
.forEach { print($0) }
Uli Niggemann
05/23/2023, 9:43 AMalex009
05/23/2023, 9:44 AMMy <http://application.app/My|application.app/My> application:shared.bundle/Contents/Resources/en.lproj
My <http://application.app/My|application.app/My> application:shared.bundle/Contents/Resources/Base.lproj
My <http://application.app/My|application.app/My> application:shared.bundle/Contents/Resources/Assets.car
My <http://application.app/My|application.app/My> application:shared.bundle/Contents/Resources/cormorant-italic.otf
My <http://application.app/My|application.app/My> application:shared.bundle/Contents/Resources/ru.lproj
My <http://application.app/My|application.app/My> application:shared.bundle/Contents/Resources/files
My <http://application.app/My|application.app/My> application:shared.bundle/Contents/Resources/some_asset.txt
My <http://application.app/My|application.app/My> application:shared.bundle/Contents/Resources/en.lproj/Localizable.strings
My <http://application.app/My|application.app/My> application:shared.bundle/Contents/Resources/en.lproj/Localizable.stringsdict
here mu outputUli Niggemann
05/23/2023, 9:44 AMcolor: nil
/Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/DFA331F4-F81B-4EDD-AD64-8388F0C8108D/My <http://application.app/MyApplication:shared.bundle/Contents/Resources/en.lproj|application.app/MyApplication:shared.bundle/Contents/Resources/en.lproj>
/Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/DFA331F4-F81B-4EDD-AD64-8388F0C8108D/My <http://application.app/MyApplication:shared.bundle/Contents/Resources/Assets.xcassets|application.app/MyApplication:shared.bundle/Contents/Resources/Assets.xcassets>
/Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/DFA331F4-F81B-4EDD-AD64-8388F0C8108D/My <http://application.app/MyApplication:shared.bundle/Contents/Resources/Base.lproj|application.app/MyApplication:shared.bundle/Contents/Resources/Base.lproj>
/Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/DFA331F4-F81B-4EDD-AD64-8388F0C8108D/My <http://application.app/MyApplication:shared.bundle/Contents/Resources/cormorant-italic.otf|application.app/MyApplication:shared.bundle/Contents/Resources/cormorant-italic.otf>
/Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/DFA331F4-F81B-4EDD-AD64-8388F0C8108D/My <http://application.app/MyApplication:shared.bundle/Contents/Resources/ru.lproj|application.app/MyApplication:shared.bundle/Contents/Resources/ru.lproj>
/Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/DFA331F4-F81B-4EDD-AD64-8388F0C8108D/My <http://application.app/MyApplication:shared.bundle/Contents/Resources/files|application.app/MyApplication:shared.bundle/Contents/Resources/files>
/Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/DFA331F4-F81B-4EDD-AD64-8388F0C8108D/My <http://application.app/MyApplication:shared.bundle/Contents/Resources/some_asset.txt|application.app/MyApplication:shared.bundle/Contents/Resources/some_asset.txt>
/Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/DFA331F4-F81B-4EDD-AD64-8388F0C8108D/My <http://application.app/MyApplication:shared.bundle/Contents/Resources/en.lproj/Localizable.strings|application.app/MyApplication:shared.bundle/Contents/Resources/en.lproj/Localizable.strings>
/Users/niggeulimann/Library/Developer/CoreSimulator/Devices/67421313-8A0F-45F4-94C2-ED5DCE7BFD74/data/Containers/Bundle/Application/DFA331F4-F81B-4EDD-AD64-8388F0C8108D/My <http://application.app/MyApplication:shared.bundle/Contents/Resources/en.lproj/Localizable.stringsdict|application.app/MyApplication:shared.bundle/Contents/Resources/en.lproj/Localizable.stringsdict>
alex009
05/23/2023, 9:45 AMUli Niggemann
05/23/2023, 9:47 AMalex009
05/23/2023, 9:47 AMUli Niggemann
05/23/2023, 9:54 AMalex009
05/23/2023, 9:54 AMcar
Uli Niggemann
05/23/2023, 9:54 AMcopyFrameworkResourcesToApp
and the bundle could not be loaded because of this?alex009
05/23/2023, 10:02 AMUli Niggemann
05/23/2023, 1:28 PMalex009
05/23/2023, 1:28 PMUli Niggemann
05/23/2023, 1:31 PM