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

Trouble using "use_frameworks!" option via CocoaPods v0.36.0 #159

Closed
wakinchan opened this issue Mar 9, 2015 · 28 comments
Closed

Trouble using "use_frameworks!" option via CocoaPods v0.36.0 #159

wakinchan opened this issue Mar 9, 2015 · 28 comments
Labels
feature-request Request a new feature

Comments

@wakinchan
Copy link

Using a Podfile like so:

platform :ios, "8.0"
use_frameworks!

pod 'AWSiOSSDKv2'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git', :branch => 'xcode6.3'

AWSiOSSDKv2 pod build does not complete successfully when use the "use_frameworks!" options.

In file included from /Users/USER/Documents/MasterTable/Pods/Headers/Private/AWSiOSSDKv2/AWSMobileAnalyticsDefaultContext.h:17:
/Users/USER/Documents/MasterTable/Pods/Headers/Private/AWSiOSSDKv2/AWSMobileAnalyticsContext.h:17:9: fatal error: 'configuration/AWSMobileAnalyticsConfiguring.h' file not found 

The following problem is I have noticed is that is the same: #145, #146
Do you have a plan that corresponds to "use_frameworks!" and CocoaPods v0.36.0 rc1?

@yosuke-matsuda
Copy link
Contributor

We are looking into it, and the support is coming. In the meanwhile, please use CocoaPods 0.35.0.

@yosuke-matsuda yosuke-matsuda added duplicate This issue or pull request already exists question General question bug Something isn't working and removed duplicate This issue or pull request already exists question General question labels Mar 9, 2015
@yosuke-matsuda
Copy link
Contributor

CocoaPods 0.36.0 has got out of the Beta/RC stages (a little earlier than we expected), so reopening the thread. We are actively working on adding support for use_frameworks! and evaluating the impact. We will update the thread when we release it. Thanks.

@yosuke-matsuda yosuke-matsuda changed the title Trouble using "use_frameworks!" option via CocoaPods v0.36.0 rc1 Trouble using "use_frameworks!" option via CocoaPods v0.36.0 Mar 12, 2015
@yosuke-matsuda yosuke-matsuda added feature-request Request a new feature and removed bug Something isn't working labels Mar 12, 2015
@lordkev
Copy link

lordkev commented Mar 12, 2015

Just a +1 -- causing issues here too. Want to use the library as part of a dynamic framework to share code between our main app and an extension so it pretty much needs to be included as a framework via CocoaPods and 0.35 isn't an option.

@kevinoneill
Copy link

+1 as well. I see similar issues if I try and use any of the subspecs (rather than just pulling the whole project in) with static libraries.

You may also be able to simply your own scritps for building frameworks using https://github.com/CocoaPods/cocoapods-packager.

@lordkev
Copy link

lordkev commented Mar 13, 2015

I have a feeling this might be a decent size task to get it building as a
framework due to the large number of 3rd party dependencies. This SDK isn't
going to build as a framework until all of the outside dependencies do as
well. I haven't really dug in to see which of them currently have problems
though.
On Thu, Mar 12, 2015 at 9:38 PM kevinoneill notifications@github.com
wrote:

+1 as well. I see similar issues if I try and use any of the subspecs
(rather than just pulling the whole project in) with static libraries.

You may also be able to simply your own scritps for building frameworks
using https://github.com/CocoaPods/cocoapods-packager.

Reply to this email directly or view it on GitHub
#159 (comment).

@kevinoneill
Copy link

Seems mostly to be to do with the "odd" way the headers are handled in the source code (lots of odd relative references) rather than the framework referenced which see to build just fine.

@lordkev
Copy link

lordkev commented Mar 13, 2015

Yeah, I think that is the main issue with the library itself. However this library also has no less than 8(!) external dependencies. If I understand correctly how CocoaPods is working, all of these other libraries will also need to build as frameworks also. I haven't gone through them all, but I'd suspect others may have problems too. Mantle comes to mind especially, as they don't even officially support using it via a CocoaPod.

Honestly, I was a bit taken aback at how many external dependencies this library has for something that's often used for simple communication with the AWS API. Perhaps separating out the dependencies to the subspecs that utilize them might help -- and would have the side benefit of allowing users to cut down on the number of pods they're bringing in depending on the parts they're using.

@ghost
Copy link

ghost commented Mar 13, 2015

This should be fairly trivial to fix. Any timeframe?

@lordkev
Copy link

lordkev commented Mar 14, 2015

@jakefleksy I'm sure they'd be happy to accept a PR if it's trivial. :)

I have a feeling it might not be though. All of the following dependencies will also need to build properly as frameworks via CocoaPods. I'd bet at least a couple of these don't currently.

Bolts
Mantle
TMCache
XMLDictionary
UICKeyChainStore
Reachability
GZIP
FMDB

@yosuke-matsuda
Copy link
Contributor

We've released the AWS Mobile SDK for iOS 2.1.0 with use_frameworks! support. Please let us know if you are having trouble using the new version of the SDK with CocoaPods. Thanks,

@wakinchan
Copy link
Author

Thank you for you correspondence!

@adamnbowen
Copy link

Just tried the 2.1.0 of both AWSiOSSDKv2 and AWSCognitoSync with Cocoapods 0.36.0, and I unfortunately still had header file not found errors.

@yosuke-matsuda
Copy link
Contributor

Can you share the error message and Podfile so that we can see if we can reproduce the issue?

@gutenyore
Copy link

I am now getting errors in my bridging header file, such as import "S3.h" is not found. My podfile looks like this

target 'myproject' do
pod "AWSiOSSDKv2"
pod "AWSCognitoSync"
pod 'Alamofire', '~> 1.1'
end

target 'projectTests' do

end

@gutenyore
Copy link

forgot to include use_frameworks! in the podfile

@gutenyore
Copy link

Hmm, I changed my bridging header to look like this

#import <AWSS3/AWSS3.h>
#import <AWSCore/AWSCore.h>
#import <AWSCore/AWSService.h>
#import <AWSDynamoDB/AWSDynamoDB.h>
#import <AWSSQS/AWSSQS.h>
#import <AWSSNS/AWSSNS.h>
#import <AWSCognito/AWSCognito.h>

and that resolved many issues, except now it can't find AWSS3TransferManager

@gutenyore
Copy link

#import <AWSS3/AWSS3.h>
#import <AWSCore/AWSCore.h>
#import <AWSCore/AWSService.h>
#import <AWSDynamoDB/AWSDynamoDB.h>
#import <AWSSQS/AWSSQS.h>
#import <AWSSNS/AWSSNS.h>
#import <AWSCognito/AWSCognito.h>

@gutenyore
Copy link

I can confirm that, without touching any other code, If i remove use_frameworks! I can find AWSS3TransferManager again

@adamnbowen
Copy link

I've setup a test Xcode project that's just a single page application with no implemented features. All I did was get was get the SDK installed. I have two branches—without-use-frameworks and with-use-frameworks. The project builds fine on the first branch, and does not build on the second.

The error is:

/Users/adambowen/src/TestAWS/TestAWS/ObjectiveC_Bridging_Header.h:12:9: error: 'AWSCore.h' file not found
#import "AWSCore.h"
        ^
<unknown>:0: error: failed to import bridging header '/Users/adambowen/src/TestAWS/TestAWS/ObjectiveC_Bridging_Header.h'

Here is the repo I was referencing: https://github.com/adamnbowen/TestAWS

Edit: here's the diff between those two branches:

https://github.com/adamnbowen/TestAWS/compare/with-use-frameworks

@ghost
Copy link

ghost commented Apr 11, 2015

@gutenyore
If you got "Use of unresolved identifier 'AWSS3TransferManager' " error, try put "import AWSS3" on top of that .swift file. It should work.

@ghost
Copy link

ghost commented Apr 11, 2015

@adamnbowen
try to use #import <AWSCore/AWSCore.h> instead of #import "AWSCore.h" since you are importing frameworks.
I tried your with-use-frameworks branch and successfully built the project after making this changes.

Also, If you got "Use of unresolved identifier 'xxxxxxx' " error, try to put "import AWSXXX" on top of the .swift file which uses that identifier.

@yosuke-matsuda
Copy link
Contributor

Assume the issue has been resolved. Please feel free to update the thread if you continue encountering the issue. Thanks.

@reygonzales
Copy link

This is still a problem for me

Podfile

platform :ios, '8.0'
use_frameworks!
pod 'AWSiOSSDKv2', '~> 2.0'

AWSS3TransferManager.h
#import <AWSCore/AWSService.h> // 'AWSCore/AWSService.h' file not found with include; use "quotes" instead

AWSS3Model.h
#import <AWSCore/AWSNetworking.h> // 'AWSCore/AWSNetworking.h` file not found with include; use "quotes" instead

@mikecole20
Copy link

I am also seeing this issue with AWSCore 2.3.5 and AWSS3 2.3.5. AWSS3.h gives an error on the line #import <AWSCore/AWSCore.h> which reads 'AWSCore/AWSCore.h' file not found.

@yosuke-matsuda
Copy link
Contributor

You should use service specific pods (e.g. AWSS3 instead of AWSiOSSDKv2).

@mikecole20
Copy link

We are only including AWSS3 and AWSCore.

@yosuke-matsuda
Copy link
Contributor

Then it's a different issue than the one mentioned above. You should describe your setups in details so that we can try reproducing the issue.

@zfisher323
Copy link

I get the Use of unresolved identifier 'AWSS3TransferManager' errors as soon as I add cocoapods to my app, even before I use it to install the AWS through the podfile. --- meaning, the app works great with AWS frameworks installed manually, create a podfile with the Use_Frameworks option, don't included ANY pods, run pod install, launch xcode workspace and those errors occur without making any other changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature
Projects
None yet
Development

No branches or pull requests

9 participants