Skip to content
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

building iOS portion #6

Closed
bkbonner opened this issue Jan 21, 2019 · 26 comments
Closed

building iOS portion #6

bkbonner opened this issue Jan 21, 2019 · 26 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@bkbonner
Copy link

I was trying to run the iOS portion and I ran into the issue described here: ja2375/add_2_calendar#4

Were you able to work around this issue?

@jesusrp98
Copy link
Owner

Unfortunately, I have 0 experience with the iOS part of Flutter. I have had several problems with the add_2_calendar package in the past. It was an issue with Kotlin & some Android SDK tools, updating those tools solved my issue.

I work with @AppleEducate on some other projects, where he manage the iOS aspect.

Hope he could help you where I can't. I'm sorry :/

@rodydavis
Copy link

@bkboner I use the package in other apps. What are you trying to build for? Release mode?

@rodydavis
Copy link

Have you added #use_frameworks! To the podfile? It is required for swift plugins

@bkbonner
Copy link
Author

Hi sorry, I'm not super familiar with iOS stuff. this stackoverflow says use_frameworks! isn't needed for > iOS 9? I'll give it a shot though. I have xcode Version 10.1 (10B61) installed.

It sounds like I'm trying to get something to work that may have never been working to begin with. The readme led me to believe it was working with iOS:

allows me to deploy it to Android & iOS with ease

I'll give the #use_frameworks! a try.

@rodydavis
Copy link

It’s definitely needed. You will need to create the main project with swift and kotlin flags enabled. This project I believe was built with just objC on ios

@jesusrp98
Copy link
Owner

This project was created months ago, when I didn't know was I was doing. Is there a way I could add Swift and Kotlin support a posteriori?

@rodydavis
Copy link

Not sure. For me I have had the best luck creating a new project and porting the /lib folder

@jesusrp98
Copy link
Owner

I've been doing some refactor on the Android, iOS & packages side of this project. Basically, I've generated a new project, and comparing both project, checking for updated done on the last few months.

Hopefully it works now :)

@rodydavis
Copy link

rodydavis commented Jan 24, 2019 via email

@jesusrp98
Copy link
Owner

Does it work to you?
Before the update, it didn't work on CodeMagic, but since the last commit, it now generates the 'Runner.app' flawlessly :)

@rodydavis
Copy link

I haven’t tried it yet, I am about to try out code magic though 👌🏻

@jesusrp98
Copy link
Owner

@bkbonner Since I think this is now solved, I'm closing this issue. If you have further iOS issues, please let me know :)

@bkbonner
Copy link
Author

bkbonner commented Jan 30, 2019

Sorry for the delayed response. been buried with a production issue. I am testing it out tonight. Thank you for the assistance. My apologies, I'm usually more prompt than this.

@bkbonner
Copy link
Author

bkbonner commented Jan 31, 2019

I was able to get it to work by copying over the lib and assets directory from the old project to a flutter project created with -i swift.

I ran diff -rq spacex-go spacex-swift

where space-go is the orig project and spacex-swift is project created with -i swift and I've attached a list of files that were different. Too many to mention.

There were so many differences, it was easier to just move the lib and assets directory from the spacex-go directory to spacex-swift and it seemed to work ok.
differences.txt

I was able to get things added to the calendar, but only after I added a null safe check to:
description: model.launch.details??"", in tab_home.dart
and
description: _launch.details??"", in page_launch.dart

It was blowing up when I tried to add an event that didn't have a description coming back from the data.

@jesusrp98 jesusrp98 reopened this Jan 31, 2019
@jesusrp98
Copy link
Owner

Did you check if the changes made in d5f8ba3 solves this issue?
Please, run git pull and let me know if I have to make further updates to the iOS/ folder.

@bkbonner
Copy link
Author

bkbonner commented Jan 31, 2019 via email

@bkbonner
Copy link
Author

bkbonner commented Jan 31, 2019 via email

@jesusrp98
Copy link
Owner

In the commit I referenced in my last comment, I basically created a new Flutter project, and compared the new project with the old one, and included those changes. If there are significant and key changes between the master branch & your local copy, please consider posting a pull request.

Regarding Git, I want to take a deeper look into more complex systems, like git-flow. Since the v2.1 is mostly finished, I want to wait until I release it to the public in the coming weeks to start using new git branching models. I started using GitHub just a year a go, so if you have some knowledge you want to share with me, please send me an email.

Thank you very much!

@bkbonner
Copy link
Author

bkbonner commented Feb 2, 2019

@jesusrp98 I will have to get back to you re: the iOS portion.

There are a few things missing:

  1. in info.plist this is missing and required by add_2_calendar:

<key>NSCalendarsUsageDescription</key> <string>SpaceX-GO would like permission to add launches to your calendar</string>

When I tried to pull up your project, it would not start and threw many errors re: locale. I can compare them at a future date, but I won't have time to do it this weekend.

@jesusrp98
Copy link
Owner

That's unfortunate, since I don't know basically anything about iOS development.
I'm very grateful to you for taking some of your time to investigate & fix all issues in the iOS section of this project.

Since my other project with @AppleEducate will be uploaded to the App Store, and it shares most of the structure & packages from spacex-go, I think we will be able eventually to fix all issues in the coming weeks.

Once again, thank you very much.

@jesusrp98 jesusrp98 added bug Something isn't working help wanted Extra attention is needed labels Feb 2, 2019
@rodydavis
Copy link

Absolutely, once we finish the other one I can merge the iOS portion for this app.

@jesusrp98
Copy link
Owner

Hey @bkbonner, long time I don't take a look at this issue.

Recently, I had the opportunity to grab a Mac mini for other projects, and now I have the change to launch SpaceX GO! as a standalone app in the App Store.

I'm updating the ios folder in the dev-ios branch if you want to take a look. At first glance, all the features the app offers work on iOS. I want to take a deeper look before I publish it. Planning to do it hopefully next month, if all goes well :)

Thanks for the support!

@DrankoLQ
Copy link

DrankoLQ commented Dec 4, 2019

I've just cloned and run the app in iOS and works flawlessly! If you need to test something I'm pleased to help you folks 😊🚀

@vladyslav2
Copy link

@DrankoLQ hey, can you please tell me what I'm doing wrong?

I only can see loading screen and seems like an error with receiving data?

Running Xcode build...                                                  
                                                   
 ├─Assembling Flutter resources...                           5,4s
 └─Compiling, linking and signing...                         8,9s
Xcode build done.                                           18,0s
flutter: The system locale is en                                        
flutter: Error loading translation RangeError (index): Invalid value: Only valid value is 0: 1
flutter: JSON file loaded for en                                        
Syncing files to device iPhone 11 Pro Max...                            
[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: 'package:provider/src/provider.dart': Failed assertion: line 213 pos 7: 'context.owner.debugBuilding || listen == false || _debugIsInInheritedProviderUpdate': Tried to listen to a value exposed with provider, from outside of the widget tree.
                                                                                                                   
This is likely caused by an event handler (like a button's onPressed) that called                                  
Provider.of without passing `listen: false`.                                                                       
                                                                                                                   
To fix, write:                                                                                                     
Provider.of<AppModel>(context, listen: false);                                                                     
                                                                                                                   
It is unsupported because may pointlessly rebuild the widget associated to the                                     
event handler, when the widget tree doesn't care about the value.                                                  
                                                                                                                   
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:42:39)                                      
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:38:5)                                         
#2      Provider.of (package:provider/src/provider.dart:213:7)                                                     
#3      HomeModel._scheduleNotification (package:cherry/data/models/home.dart:102:20)                              
#4      HomeModel.initNotifications (package:cherry/data/models/home.dart:53:1<…>                                  
Syncing files to device iPhone 11 Pro Max...                    21 796ms (!)                                       

@vladyslav2
Copy link

Sorry guys
flutter/flutter#17831

flutter clean did the thing!

@jesusrp98 thank you for your app!

@jesusrp98
Copy link
Owner

@vladyslav2 Glad your issue was fixed! :)

I was planning to launch the iOS app in the App Store this year, but unfortunately due to time constrains, I'll instead release it in the coming months, in Q1 2020, hopefully February.

More testing should be performed, like notifications, issue posting via email (available inside the 'About' screen) and a general interface inspection to check if there's anything wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants