[TIMOB-14557] iOS: App stuck at startup when there is no access to the internet and using modules
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | In Review |
Resolution | Unresolved |
Affected Version/s | Release 3.1.1 |
Fix Version/s | n/a |
Components | iOS |
Labels | api.appcelerator.net, ios |
Reporter | Alberto Marcone |
Assignee | Unknown |
Created | 2013-07-15T12:49:38.000+0000 |
Updated | 2018-02-28T20:03:20.000+0000 |
since there's no possible workaround here, any possibility to have a deadline for this? so that I can give an answer to my customers demanding when this is going to be fixed. Thank you
Attempting to reproduce, will update.
Created a default template application with 3 modules attached using SDK 3.1.2 and Studio 3.1.2. Initially forgot to set analytics off. Connected to router with no actual network connection and launched on the following devices: iPhone 5 - iOS 7 beta 5 iPhone 5 - iOS 6 iPhone 4 - iOS 5 Remember, analytics was on. Results: iOS 7 device took 25 seconds to move off splash, other devices were around 4-5 seconds. Turned off analytics and retried. All devices were quick to load, and saw nothing in the console output. Will take this to the module team and see if they can shed any light on the situation. [~a.marcone] Is there any network usage in the modules you are using? I am trying to see what other variables are in play here.
[~a.marcone] Also note, this is not a factor in production builds. You should be able to build ad-hoc and install on device with no issue. We will continue to investigate.
I tested every possible scenario, and loading any kind of modules made the app freeze while contacting api.appcelerator.net (saw that from the logs of the sniffer on the router). I will prepare a test case easy to reproduce. Haven't tested SDK 3.1.2 though, as mentioned above, only 3.1.1.GA . The bug is consistent, a good number of customers complains about that. There are few of them having the app stuck for even 20 minutes since the router configuration doesn't drop the http connection. It's only weird that this time I'm the only one reporting this problem. My app isn't distributed from TiStudio, I compile it from Xcode and then distribute it from there. Something that I recently noticed: it seems like xcode doesn't seem to switch to production mode. For example, I had the Appcelerator red screen error appearing on the AppStore. Could that be the problem?
I can confirm this. It does happen only in development. If I distribute it through TiStudio it doesn't happen. So, how do I switch type of build in xcode? I still think this is a bug though, the fact that tries to connect to api.appcelerator.net without my consent shouldn't happen even during development.
[~a.marcone] - Hmmm.... That is an interesting question. There are a few things done by our build process prior to sending anything to Xcode. I will ask dev to comment on the possibilities for creating in Studio then running from Xcode. Can you give a little more detail about your workflow? Do you create the project in Studio? What do you use to develop? I can tell you a Studio project (the Xcode project) will look different at creation, after build for simulator, and after build for device.
If you build for the iOS Simulator or and iOS device, the deploy type will be set to "development" and "test" respectively. Adhoc and Appstore distribution builds will set the deploy type to "production" which will suppress errors. I recommend building your app for dist-adhoc or dist-appstore, then open the generated Xcode project. When you do the build, you pass in the --build-only flag to skip the actual packaging. Another way is to manually modify the build.manifest file in the
I understand this. I mainly use xcode for: - possible customizations of parameters in the project - having all my app stored to the archive for all of the app sent to testers or to the appstore. It's strange that I have to build and create an ad hoc ipa and then open the result xcode project and build it from there. Is this what you're suggesting? I thought that running the project from Run would automatically set it ready for production, while running it from Debug would consider it still development. I think I will consider to manually edit the manifest file every time. Isn't there any way to set it to production from xcode itself?
[~a.marcone] There's a lot of confusion around deploy types and build targets. Currently build targets (simulator, device, dist-adhoc, dist-appstore) dictate the deploy type. The deploy type then dictates several things such as JavaScript minification/encryption, analytics categorization (when analytics is enabled), module verification, whether error messages are displayed, and so on. I'm in the process of trying to decouple this, but it's a very slow process. In Titanium 3.X, device builds are pretty much identical to distribution builds except they are signed with a device cert. By running a dist-adhoc or dist-appstore build, it will properly create the build.manifest file in the build/iphone directory that is set up for production builds. You could hack a device build's build.manifest, but I don't recommend it. You should never tinker with the Xcode project from a simulator build because we symlink files and skip a bunch of stuff like copying fonts. There currently is no way to set it to production from Xcode. It will probably make sense to introduce that when we work on the "titanium export" command that will generate a self-standing (no Titanium required) Xcode project.
Alberto, when you create a dist-appstore build (package from studio, or pass in the dist-appstore from the CLI in terminal) the project is put into the archive. From there you can re-sign out as an adhoc build using "distribute" or you can submit to the app store. This does not account for your desire to change parameters in the project however. Just FYI.
Eric, that's pretty cool, didn't know that! Thank you. It's just that having a full archive with everything I compiled ad hoc resulted very handy, since sometimes we do installations on site and we keep track (through the archive) of what we installed where. Well, never mind, I'll stick to the way it is. I will remember to create an ad hoc project every time I need. Thank you everyone for your support and help. On a side note, going back to the original thread, IMHO I still think that one should be able to disable the module check at the boot even when in development.
Alberto, we will leave this open so we may continue to investigate solutions.
https://github.com/appcelerator/titanium_mobile/pull/4756
Hi Sabil, after I saw your code one question came to my mind: that means that I can use expired modules when I'm offline, right?