SDK version: SDK 7.1.1
Reason for this question is that I receive the Illegal Access (out Of Bounds) error in the simulator in some cases and when fixing it in the simulator, I get those errors in real devices. Therefore, I would like to know what the intended way is of accessing Rez.Strings as defined within the barrel vs within the app, with and without background scope.
The four ways to define strings:
- Inside the Barrel, without any scope, i.e. Foreground scoped
- Inside the Barrel, with scope="background", i.e. Foreground and Background scoped
- In the App Resources, without any scope, i.e. Foreground scoped
- In the App Resources, with scope="background", i.e. Foreground and Background scoped
Then, there are four ways to access the defined strings
- Inside the Barrel, in Foreground
- Inside the Barrel, from (:background) annotated code, i.e. Background
- In the App (outside the Barrel) in Foreground
- In the App (outside the Barrel) in Background service
Below the table of how I would expect it to work
Access |
Access Barrel scope="background" |
Access App no-scope |
Access App scope="background" |
|
From Barrel | Barrel.Rez.Strings | Barrel.Rez.Strings | Rez.Strings | Rez.Strings |
From Barrel Background | X | Barrel.Rez.Strings (1) | X | Rez.Strings (2) |
From App |
Barrel.Rez.Strings | Barrel.Rez.Strings | Rez.Strings | Rez.Strings |
From App Background | X | Barrel.Rez.Strings | X | Rez.Strings |
(1) However, when using Barrel.Rez.Strings from Barrel Background, the simulator shows an Illegal Access (out Of Bounds) error, even though the string is properly scoped as background.
(2) Then I removed the Barrel Strings and moved them to the App Strings, again with proper scope="background". Again, this Rez.String is used from Barrel Background code. The simulator is happy, but now I receive these Illegal Access (out Of Bounds) errors on real devices instead.
- Is the above table a correct assumption or are there additional undocumented limitations?
- What is the proper way to access both Barrel strings and App strings from the barrel code?
- What is the proper way to access both Barrel strings and App strings from the App code?
- The above two questions repeated with 'in background' appended
Very curious to learn what the idea is and how to properly define access those resources!