Skip to content

Help, App runs in Xcode and CLI but not on test flight #2302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
victorhugom-zz opened this issue Dec 2, 2016 · 23 comments
Closed

Help, App runs in Xcode and CLI but not on test flight #2302

victorhugom-zz opened this issue Dec 2, 2016 · 23 comments
Assignees
Milestone

Comments

@victorhugom-zz
Copy link

I have an app running in nativescript for a few months, I deployed a free versions to the app store, but since the last xcode update I can't make it run on test flight anymore.

The app runs fine on the emulator and the device when I deploying via CLI or via Xcode, but the TestFlight submitted version it opens and close without any reason. I already remove some key dependencies requests of the app main screen (Facebook and Location) to see if anything changes, but the error continues.

Sorry to ask for help here, but it's been a week since I'm trying to figure out this error and I have no clue what it is.

@bradmartin
Copy link

Oh my. This is happening to me too. I've spent 5 days trying to find out why :( glad I'm not alone anymore.

@bradmartin
Copy link

I have a prod app with 2.3 uploaded on November 14, I updated my mac on the 16th and then last week updated the app to NS 2.4 and made just a few js changes so I can't figure out what's wrong. I've tried going through the crash logs in xcode but I have no clue how to do that really :) I've published to iTunes with symbols and then tried downloading the dYms (not sure what that abbreviation is right now) but I can't see any actual errors in xcode just threads on the left side and nothing meaningful elsewhere

@bradmartin
Copy link

My situation is exactly the way described in the issue. I can run in xcode and in simulator with the CLI commands. I successfully uploaded an archive to iTunes for TestFlight testing and the app will launch and crash. It doesn't seem to even start the app and enter the uncaughexception event (I have logs for that and not getting any logs). I have uninstalled xcode and reinstalled, made sure I have the latest xcode command line tools installed. I've played around in xcode so much I am depressed :) any help with this would be awesome. I'm glad I'm not the only one encountering this exact issue now. I'll gladly provide the exported app or anything else that can help someone figure it out.

@bradmartin
Copy link

My system is a MacBook pro 2011 running the latest Mac OS (not at comp now but maybe 10.12), whichever gave us Siri :) and latest xcode and latest NS everything. Just for some system details

@valentinstoychev
Copy link

We are using TestFlight for our public apps with 2.4, so there should be something specific here. @bradmartin can you share the app maybe?

@bradmartin
Copy link

When the day starts here Im going to try downgrading xcode and see what happens. If that fails then I'll email you an export of the archive or I can send a zip of the application. Whatever works best to investigate. It's really strange, I thought it was just my app or my mac was screwed up but the original user who reported it has the same issue down to the final detail so something funny is going on for sure.

@tsonevn tsonevn added this to the 2.5.0 milestone Dec 5, 2016
@bradmartin
Copy link

Downgrading xcode to 7.3.1 has no change. I can run the app on connected device in xcode and via CLI to simulator 😢 I'm going to try and downgrade the NS bits to 2.3 and see if this changes anything so we have an idea where to go next. I'll report back with any news. After this last step I really have no clue what to possibly try so I'll be in touch @valentinstoychev with an exported archive and possibly a .zip of the application for you all to take a look on your side. Just FYI - I've exported the archive and opened it up to few the contents and everything looks okay from what I know (which isn't a whole lot on iOS unfortunately 😄 ) so maybe you all will see something.

@bradmartin
Copy link

@victorhugom downgrade everything to 2.3 and it works fine. So 2.4 has something odd happening and not for everyone unfortunately. I'm going to provide the team with an archive that works and one that doesn't, only difference being the NS modules/runtimes

@bradmartin
Copy link

I have a successful archive, upload and run on testflight with NS 2.3
snip20161205_3 and built with xcode Version 7.3.1 (7D1014). I'm about to update xcode and try again with 2.3 to confirm it still works. Then I'm going to compare the archives to see if anything is obvious and then send them over to the team.

@bradmartin
Copy link

@tsonevn I've sent the archives to @valentinstoychev via slack. If you all prefer a different way let me know. The folder labeled NASTC2-4 is with NS 2.4 and the other 2.3. Building with 2.3 and uploading the archive to itunes and running on testflight works every time. Everything I've tried with 2.4 doesn't work. Here is how I've been trying with 2.4 (a few issues encountered).

First, I delete the lib, node_modules, and platforms folder, then run tns emulate ios to get the app built and launched on the simulator. At this point I move to Xcode to try and upload to itunes for testing.

  • Build the app via CLI
  • Open in Xcode
  • Build
    -- ERROR The publish ios command fails #2158 (comment)
  • Fix that by setting PODS_ROOT = {SRCROOT}/Pods in the Build Settings for the project.
  • Now Archive in Xcode
  • Upload to Itunes (if you notice here the app icon will be missing in the upload dialog)
  • The upload will fail due to missing icons
  • Fix the missing icons with this approach iOS 2.4 - AppIcon isn't working with an Archive #2319
  • Now with the new archive
  • Upload to Itunes
  • TestFlight updates
  • Update the app
  • App launches, you see splash screen, and then crashes.

@vchimev
Copy link

vchimev commented Dec 6, 2016

@victorhugom, @bradmartin, are there any logs from the crashes? What are your Xcode versions?

@bradmartin
Copy link

I've tried with 8.1 and 7.3 xcode with same result. I do have crash logs but I'm not sure how to get any valuable information from them in xcode :( I open the log in xcode and on the left menu I see just threads that can be expanded and I select them and nothing shows anywhere else in xcode to see what caused the crash. I tried downloading the dYMs (whatever that acronym is in the organizer) to see if that helps (been reading and saw to download it) but it doesn't let me download anything. I publish with the symbols option enabled which i read is important for inspecting crashes also.

@bradmartin
Copy link

It's the same result regardless of xcode version for me between the two versions I've tried.

@bradmartin
Copy link

I can make a video of my workflow to show the issue and add someone to my TestFlight users if that helps any. Willing to do anything at this point to get past it. I wish I had some exceptions so I could actually fix myself just not sure where to find them in those crash logs in xcode

@vchimev
Copy link

vchimev commented Dec 6, 2016

@bradmartin,

could you please send us the app in order to try to publish it from our side, reproduce and examine this problem? A video of your workflow would help as well as if you add me ([email protected]) to your TestFlight users.

@victorhugom-zz
Copy link
Author

After reading this forum thread https://forums.developer.apple.com/message/52955 I`ve tried a few solutions described in it, and what worked for me was rename the project root project folder.

I don't know why but it just worked, I used to name my folder with [ProjectName].[SubProject], something like, Project.Api, Project.Admin and Project.App. I think the problem was the .App in the folder name, one of the issues with xcode is that you can't have a '+' sign in your project name, I thought that maybe the same problem was occurring with the '.' in the project name, I remove it and the app started to work.

@bradmartin
Copy link

For me unfortunately, my project is just one word so I don't know if that will help me :(

@vchimev vchimev self-assigned this Dec 6, 2016
@bradmartin
Copy link

All good - the process I used with 2.3 wasn't the correct process (still worked but not right). Running the correct command tns build ios --release fixes all of the issues with a release build and publishing that I've encountered.

@bradmartin
Copy link

Thanks @vchimev @valentinstoychev

@vchimev
Copy link

vchimev commented Dec 7, 2016

The NativeScript CLI has a tns publish ios command; it is the suggested (and the easiest) way to publish an iOS application to iTunes Connect. We use it internally in the {N} team: as part of our CI builds, as well as to publish our sample apps.

Basically, if the DEVELOPMENT_TEAM value is specified in /App_Resources/iOS/build.xcconfig, the only think that left is to execute tns publish ios <username> <password> at the root of the project. The value of DEVELOPMENT_TEAM could also be passed to the --team-id option of the command.

A link to its documentation could be found here.

However, if you want to perform additional manipulations over the native project (not suggested), the best option is to use tns build ios --release command before going to Xcode.

The reason that tns emulate ios used to produce a "good" project for upload to iTunes with 2.3 is that it prepared the native project for both debug and release, no matter which flag has been passed. This has been fixed in 2.4 as part of a major performance refactoring of the tns prepare command. Therefore the respective flag --debug of --release should be passed to the commands prepare, build, emulate, run, etc.

UPDATE: the --debug option is by default and assumed when no flag specified.

@vchimev
Copy link

vchimev commented Dec 7, 2016

I'm closing this issue as all mentioned problems were resolved.

@vchimev vchimev closed this as completed Dec 7, 2016
@NathanaelA

This comment was marked as abuse.

@vchimev
Copy link

vchimev commented Dec 7, 2016

Thanks, @NathanaelA, this is correct.

The --debug option is by default and assumed when no flag specified. I updated my commend above.

@pkoleva pkoleva added the bug label Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants