parse-community / Parse-SDK-iOS-OSX

The Apple SDK for Parse Platform (iOS, macOS, watchOS, tvOS)
https://parseplatform.org
Other
2.81k stars 872 forks source link

import ParseTwitterUtils not working (Module doesn't exist) #407

Closed rinyfo4 closed 9 years ago

rinyfo4 commented 9 years ago

[Xcode V.7.0 Beta 6, OSX El Capitan, iOS9]

This is a similar question to #330 except that I can't import the 'ParseTwitterModule' into my AppDelegate.swift nor the ViewController.swift

I'm having a similar issue. I downloaded both files that @3bodar posted and in my ParseStarterProject I added the 'import ParseTwitterUtils' in both the AppDelegate.swift and the ViewController.swift.

I added the libraries mentiond by @3bodar. Now there's an error that says: "No such module 'ParseTwitterUtils' in both the AppDelegate and ViewController.

I have also tried to adding a bridging header by importing `#import <ParseTwitterUtils/PFTwitterUtils.h>

import <ParseTwitterUtils/PF_Twitter.h>` For the bridging header, the error that appears is: 'ParseTwitterUtils/PFTwitterUtils.h not found'

The other error that appears is this:

`CompileSwift normal x86_64 /Users/luka/Downloads/parse-starter-project-1/ParseStarterProject-       Swift/ParseStarterProject/ViewController.swift
cd /Users/luka/Downloads/parse-starter-project-1/ParseStarterProject-Swift
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift      -frontend -c -primary-file /Users/luka/Downloads/parse-starter-project-1/ParseStarterProject-     Swift/ParseStarterProject/ViewController.swift /Users/luka/Downloads/parse-starter-project-    1/ParseStarterProject-Swift/ParseStarterProject/AppDelegate.swift -target x86_64-apple-ios7.0 -enable-    objc-interop -sdk /Applications/Xcode-      beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.s     dk -I /Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift-     gfncswdkcddmjuakcgurnhowymud/Build/Products/Debug-iphonesimulator -F   /Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift-  gfncswdkcddmjuakcgurnhowymud/Build/Products/Debug-iphonesimulator -F  /Users/luka/Downloads/parse-starter-project-1/ParseStarterProject-Swift -g -import-objc-header  /Users/luka/Downloads/parse-starter-project-1/ParseStarterProject- Swift/ParseStarterProject/ParseStarterProject-Swift-Bridging-Header.h -module-cache-path  /Users/luka/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc - I/Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug- iphonesimulator/ParseStarterProject-Swift.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug- iphonesimulator/ParseStarterProject-Swift.build/ParseStarterProject-Swift-generated-files.hmap -Xcc - I/Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug- iphonesimulator/ParseStarterProject-Swift.build/ParseStarterProject-Swift-own-target-headers.hmap -Xcc  -I/Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug- iphonesimulator/ParseStarterProject-Swift.build/ParseStarterProject-Swift-all-target-headers.hmap -Xcc - iquote -Xcc /Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug- iphonesimulator/ParseStarterProject-Swift.build/ParseStarterProject-Swift-project-headers.hmap -Xcc - I/Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Products/Debug-iphonesimulator/include -Xcc - I/Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug- iphonesimulator/ParseStarterProject-Swift.build/DerivedSources/x86_64 -Xcc - I/Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug- iphonesimulator/ParseStarterProject-Swift.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working- directory/Users/luka/Downloads/parse-starter-project-1/ParseStarterProject-Swift -emit-module-doc-path  /Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug- iphonesimulator/ParseStarterProject-Swift.build/Objects-normal/x86_64/ViewController~partial.swiftdoc - Onone -module-name ParseStarterProject_Swift -emit-module-path  /Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug-  iphonesimulator/ParseStarterProject-Swift.build/Objects- normal/x86_64/ViewController~partial.swiftmodule -serialize-diagnostics-path    /Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug- iphonesimulator/ParseStarterProject-Swift.build/Objects-normal/x86_64/ViewController.dia -emit- dependencies-path /Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug- iphonesimulator/ParseStarterProject-Swift.build/Objects-normal/x86_64/ViewController.d -emit-reference- dependencies-path /Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug- iphonesimulator/ParseStarterProject-Swift.build/Objects-normal/x86_64/ViewController.swiftdeps -o  /Users/luka/Library/Developer/Xcode/DerivedData/ParseStarterProject-Swift- gfncswdkcddmjuakcgurnhowymud/Build/Intermediates/ParseStarterProject-Swift.build/Debug-  iphonesimulator/ParseStarterProject-Swift.build/Objects-normal/x86_64/ViewController.o

    /Users/luka/Downloads/parse-starter-project-1/ParseStarterProject-     Swift/ParseStarterProject/ParseStarterProject-Swift-Bridging-Header.h:5:9: error:       'ParseTwitterUtils/PFTwitterUtils.h' file not found
#import <ParseTwitterUtils/PFTwitterUtils.h>
       ^
  <unknown>:0: error: failed to import bridging header '/Users/luka/Downloads/parse-starter-project-      1/ParseStarterProject-Swift/ParseStarterProject/ParseStarterProject-Swift-Bridging-Header.h'`

Thanks in advance.

nlutsenko commented 9 years ago

Hmm... This sounds super strange, as latest version of ParseTwitterUtils definitely has a module inside of it. One thing that I recommend checking is Framework Search Paths build setting in your project - it should contain a folder where ParseTwitterUtils.framework lives. Another recommended solution - use Cocoapods, since it does the dependency management and settings for you.

If it still doesn't help - can we get a repro project for this, so we can double check your specific configuration?

parse-github-bot commented 9 years ago

Thank you for your feedback. We prioritize issues that have clear and concise repro steps. Please see our Bug Reporting Guidelines about what information should be added to this issue.

Please try the latest SDK. Our release notes have details about what issues were fixed in each release.

In addition, you might find the following resources helpful:

rinyfo4 commented 9 years ago

I built the project adding the frameworks in this link: https://www.parse.com/apps/quickstart?app_id=discounts--6#parse_data/mobile/ios/swift/existing

When I checked the Framework Search Paths, I found the path to where the ParseTwitterUtils lives. But it still gives me an error saying that it can't find it.

I've also tried building this with the quick start blank project in this link: https://www.parse.com/apps/quickstart?app_id=discounts--6#parse_data/mobile/ios/swift/new

I'm going to rebuild this using a blank project and I'll get back to you. Strangely enough, my first attempt at building it from a blank project on the 2nd link I sent, immediately gave me an error that says that "ParseTwitterUtils.framwork does not exist" as well as that the bridging header doesn't exist:

failed to import bridging header '/Users/luka/Downloads/parse-starter-project-1/ParseStarterProject-Swift/ParseStarterProject-Swift-Bridging-Header.h'

Why is that? I'm going to rebuild this and get back to you in the next 24 hours. I'll try Cocoapods as well. Thanks a lot!

Here is the error and the Framework Search Path:

screen shot 2015-10-14 at 12 14 07 am screen shot 2015-10-14 at 12 13 54 am

Without the bridging header that adds the framework, I get this error:

screen shot 2015-10-14 at 12 16 20 am

Very confused... This is just to give you more information on what going on...

I will rebuild all this, again, and get back to you as mentioned.

rinyfo4 commented 9 years ago

So, I've made a Parse-Starter project and I followed the parse docs. PFTwitterUtils now works. Problem is, I get an error that says:

2015-10-14 12:19:25.347 ParseStarterProject[3005:321258] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You must call PFTwitterUtils initializeWithConsumerKey:consumerSecret: to use PFTwitterUtils.' *** First throw call stack: ( 0 CoreFoundation 0x00000001095429b5 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010b4e5deb objc_exception_throw + 48 2 CoreFoundation 0x00000001095428ed +[NSException raise:format:] + 205 3 ParseStarterProject 0x000000010899bd7e +[PFTwitterUtils logInInBackground] + 31 4 ParseStarterProject 0x000000010899be30 +[PFTwitterUtils logInWithBlock:] + 48 5 ParseStarterProject 0x00000001089896b1 _TFC19ParseStarterProject14ViewController11viewDidLoadfS0_FT_T_ + 417 6 ParseStarterProject 0x00000001089898c2 _TToFC19ParseStarterProject14ViewController11viewDidLoadfS0_FT_T_ + 34 7 UIKit 0x000000010a289d05 -[UIViewController loadViewIfRequired] + 877 8 UIKit 0x000000010a28a054 -[UIViewController view] + 27 9 UIKit 0x000000010a16977c -[UIWindow addRootViewControllerViewIfPossible] + 61 10 UIKit 0x000000010a169e79 -[UIWindow _setHidden:forced:] + 302 11 UIKit 0x000000010a17b6dc -[UIWindow makeKeyAndVisible] + 43 12 UIKit 0x000000010a0fbd13 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4003 13 UIKit 0x000000010a10213d -[UIApplication _runWithMainScene:transitionContext:completion:] + 1755 14 UIKit 0x000000010a0ff390 -[UIApplication workspaceDidEndTransaction:] + 188 15 FrontBoardServices 0x0000000112f737ac -[FBSSerialQueue _performNext] + 192 16 FrontBoardServices 0x0000000112f73b1a -[FBSSerialQueue _performNextFromRunLoopSource] + 45 17 CoreFoundation 0x000000010946eb21 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 18 CoreFoundation 0x0000000109464a4c __CFRunLoopDoSources0 + 556 19 CoreFoundation 0x0000000109463f03 __CFRunLoopRun + 867 20 CoreFoundation 0x0000000109463918 CFRunLoopRunSpecific + 488 21 UIKit 0x000000010a0fed2d -[UIApplication _run] + 402 22 UIKit 0x000000010a10399e UIApplicationMain + 171 23 ParseStarterProject 0x000000010898be6d main + 109 24 libdyld.dylib 0x00000001107ab92d start + 1 25 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Apparently the problem is: "You must call PFTwitterUtils initializeWithConsumerKey:consumerSecret: to use PFTwitterUtils" Strange... I'm assuming this is calling the module ParseTwitterUtils.framework?

I tried that, once I import it i get a linker error...

Could it be that i'm missing the Framework Search Path? When i add the Framework Search Path where the frameworks live, it doesn't change anything...

Here's the link to the respiratory. https://github.com/rinyfo4/ParseStarterProject-2/tree/c512acb4360d45927f0cc5b34505d3caacae728c

Any help means a lot. Thank you in advance.

nlutsenko commented 9 years ago

Sure, let me describe few things that happens here:

Hope this helps.

rinyfo4 commented 9 years ago

Thanks for the reply. I still don't understand what to do. I initialized the PFTwitterUtils.initializeWithConsumerKey:consumerSecret: in the AppDelegate as you may have seen in the repository I posted.

What do i need to do to get this working?

Thank you for your patience.

nlutsenko commented 9 years ago

Sure, no problem... Change your AppDelegate to this flow:

Parse.enableLocalDatastore()
Parse.setApplicationId("yRKcTHBju39OcqqqHfiOK2lHTuimnsztOUZmcAUu",
            clientKey: "Fj6inkNbJOAHebLQ5dBmBc5IHSPalEReWDvKMw9Q")

PFTwitterUtils.initializeWithConsumerKey("k2e9FocQHsreZ79ZjHBiXKhEj", consumerSecret:"rI1FCuvMPqdTNCOGAt8dI5gK3OT2TulDJUYl8PLzkDUm0AuoLP")

Aka Twitter/FB initialization should happen after Parse is initialized.

Let me know how it goes.

rinyfo4 commented 9 years ago

THANK YOU SO MUCH! You made my day... Thank you.

On Thu, Oct 15, 2015 at 10:02 PM, Nikita Lutsenko notifications@github.com wrote:

Sure, no problem... Change your AppDelegate to this flow:

Parse.enableLocalDatastore() Parse.setApplicationId("yRKcTHBju39OcqqqHfiOK2lHTuimnsztOUZmcAUu", clientKey: "Fj6inkNbJOAHebLQ5dBmBc5IHSPalEReWDvKMw9Q")

PFTwitterUtils.initializeWithConsumerKey("k2e9FocQHsreZ79ZjHBiXKhEj", consumerSecret:"rI1FCuvMPqdTNCOGAt8dI5gK3OT2TulDJUYl8PLzkDUm0AuoLP")

Aka Twitter/FB initialization should happen after Parse is initialized.

— Reply to this email directly or view it on GitHub https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/407#issuecomment-148505430 .

nlutsenko commented 9 years ago

Glad it helped!