hansemannn / titanium-firebase-analytics

Use the Firebase Analytics SDK in Axway Titanium 🚀
Other
35 stars 18 forks source link

Error with Hyperloop 2.2.0 #2

Closed trkfabi closed 7 years ago

trkfabi commented 7 years ago

Hi @hansemannn, thank you for this module. I've downloaded your module today along with the new Hyperloop 2.2.0, so I didn't have the chance to test it before. I'm getting this error, very similar to the one I'm getting with ti.firebase too (which was working fine on Friday), so I guess it has to do with the new Hyperloop version.

[DEBUG] [Hyperloop] No CocoaPods Podfile found. Skipping ...
[TRACE] [Hyperloop] Generating includes for static framework FirebaseNanoPB (/Users/Fabi/Documents/Workspace/Titanium/xxx/modules/iphone/firebase.analytics/1.0.0/platform/FirebaseNanoPB.framework)
[TRACE] [Hyperloop] Static framework, parsing all header files
2017-10-23T20:05:09.422Z | ERROR  | An uncaught exception was thrown!
ENOENT: no such file or directory, scandir '/Users/Fabi/Documents/Workspace/Titanium/xxx/modules/iphone/firebase.analytics/1.0.0/platform/FirebaseNanoPB.framework/Headers'
2017-10-23T20:05:09.423Z | ERROR  | ENOENT: no such file or directory, scandir '/Users/Fabi/Documents/Workspace/Titanium/xxx/modules/iphone/firebase.analytics/1.0.0/platform/FirebaseNanoPB.framework/Headers'

Do you know what this means?

hansemannn commented 7 years ago

Hey there! Are you using this module together with Hyperloop? Because this one packages the firebase frameworks already, and if you have it in your podfile, it will be bundled twice. Let me investigate that tomorrow!

trkfabi commented 7 years ago

No, I'm using Hyperloop to load SpinKit module. I'm using your module the old way.

hansemannn commented 7 years ago

Alright, I will compare it.

hansemannn commented 7 years ago

I guess the new Hyperloop framework-parser tries to scan the modules/ directory and runs into problem. Should be fixable in 2.2.1, thanks again for the report!

trkfabi commented 7 years ago

Yes, those /Headers folders are not supposed to exist inside the .framework. Thank you!

hansemannn commented 7 years ago

Ok, so a few things:

Two proposed changes based on that:

  1. Hyperloop should not require the Headers/ directory to be present
  2. Hyperloop should not scan in the modules/ directory (= ignore it)
trkfabi commented 7 years ago

I wonder why Hyperloop started to scan modules that have nothing to do with Hyperloop. Would it be too difficult to create a Firebase Hyperloop module instead of a native one?

hansemannn commented 7 years ago

It does not. Actually it scans the build/ directory instead, where the module frameworks are copied as part of the native build process, so Hyperloop does not know they actually come from modules/. But that can easily be improved by mapping the frameworks in build/ with the ones in modules/* and blacklist them for metabase generation.

And you are correct, Hyperloop will easily allow you to build Firebase modules as well. I just decided to use native modules because I am pretty fast on Obj-C 😙.

hansemannn commented 7 years ago

I've filed a Hyperloop-ticket (TIMOB-25436) to fix this behavior. As a (really hacky) workaround, you could try to create an empty folder in the FirebaseNanoPB.framework.

Please note that Ti.Firebase Analytics was rearchitected last week and released today to be more flexible to work well with other Firebase features as well. You need the {{firebase-titanium-core}} for configuring Firebase and this one for the actual analytics :-).

Closing issue!

hansemannn commented 7 years ago

Quick update: We just discussed it in the team and will include the fix (ignore Headers/) in 2.2.1. For the modules/ directory, there are use-cases to still scan the frameworks, so that will still be done for now. And as it's only generating wrappers if you actually use classes from the framework, they will juts be skipped otherwise (default). I hope that helps. Thanks for reporting this!