Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25564] Hyperloop: iOS - Build failed when using analytics pod

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-11-29T10:02:27.000+0000
Affected Version/sHyperloop 2.2.2
Fix Version/sHyperloop 3.0.1
ComponentsHyperloop, iOS
Labelsn/a
ReporterKristjan Brand
AssigneeJan Vennemann
Created2017-11-07T09:12:08.000+0000
Updated2018-08-06T17:49:26.000+0000

Description

Hey! I ran into an issue when using Analytics pod version higher than 3.3.0. Starting from 3.4.0 it does not build and gives an CompileC error when trying to build. Xcode version: 9.1 Titanium SDK: 6.3.0.GA My Podfile looks like this:

This is required for CocoaPods 1.x

install! 'cocoapods', :integrate_targets => false platform :ios, '8.0' target 'Testcase' do pod 'Analytics', '3.6.7' end
Error from studio:
[INFO] :   Invoking xcodebuild
[ERROR] :  ** BUILD FAILED **
[ERROR] :  The following build commands failed:
[ERROR] :  	CompileC build/Intermediates/Testcase.build/Debug-iphonesimulator/Testcase.build/Objects-normal/x86_64/analytics.o /Users/kristjan/Documents/Appcelerator_Studio_Workspace/Testcase/build/hyperloop/ios/js/analytics/analytics.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
[ERROR] :  	Ld build/Products/Debug-iphonesimulator/Testcase.app/Testcase normal x86_64
[ERROR] :  	GenerateDSYMFile build/Products/Debug-iphonesimulator/Testcase.app.dSYM build/Products/Debug-iphonesimulator/Testcase.app/Testcase
[ERROR] :  (3 failures)
Any idea what could cause this? Segment analytics is a really good tool for analytics and 3.3.0 version has some unfixed memory leaks. I would really appreciate if the latest version could be made to work. Let me know if there is any further information i could provide.

Comments

  1. Hans Knöchel 2017-11-07

    I just tried with Hyperloop 2.2.2 and SDK 6.3.0.GA and it works using the above Podfile and this code to test:
       var SEGAnalyticsConfiguration = require('Analytics/SEGAnalyticsConfiguration');
       var configuration = SEGAnalyticsConfiguration.configurationWithWriteKey('YOUR_WRITE_KEY');
       
    Ensure to have the latest Hyperloop-version and try again. If that does not work, please provide a full test-project and trace-logs.
  2. Kristjan Brand 2017-11-07

    Thanks for the reply! I guess SEGAnalyticsConfiguration works but the analytics itself doesn't.
       analytics = require('Analytics/SEGAnalytics');
       analyticsConf = require('Analytics/SEGAnalyticsConfiguration');
       var analyticsKey = '*****';
       
       var conf = analyticsConf.configurationWithWriteKey(analyticsKey);
       conf.recordScreenViews = false;
       conf.trackApplicationLifecycleEvents = true;
       conf.flushAt = 1;
       analytics.setupWithConfiguration(conf);
       
  3. Kristjan Brand 2017-11-10

    Is it possible to get this issue reopened? The problem is still there when using analytics = require('Analytics/SEGAnalytics'); So it is easily reproducible.
  4. Hans Knöchel 2017-11-28

    [~kbrand] You are right, it fails with that require-statement. The reason is that the framework (Analytics) and umbrella header (SEGAnalytics) are different, which is against the iOS best practices but still allowed. We probably do not handle that case so far. But we made many changes regarding more dynamic umbrella-header handling over the last weeks, so maybe [~jvennemann] knows if we may already fixed it as part of the recent changes?
  5. Kristjan Brand 2017-11-28

    But if you use a build 3.3 for the analytics pod then it wont fail. It starts failing from 3.4 version. In 3.3 it still uses the same umbrella header but for some reason it does not fail then.
  6. Hans Knöchel 2017-11-28

    I agree, it shouldn't matter after all. But looking at [their changelog](https://cocoapods.org/pods/Analytics#changelog), they didn't change any code structure, so I'm wondering what else could influence the error. We'll have to go through their commits first. *EDIT*: Looking at a [relevant commit](https://github.com/segmentio/analytics-ios/commit/2b021444d577942162c814e16e003d8741bf425d) between the versions, they added the SEGAnalyticsRequest class and replaced it with SEGHTTPClient and the GZIP extension for NSData with SEGGZIP, not really much more. Need to investigate this further. *EDIT*: They have a typedef in [this line](https://github.com/segmentio/analytics-ios/commit/2b021444d577942162c814e16e003d8741bf425d#diff-37b3080e62e213b7c3a3d0e5fcc352afR9) of the header, which my not be handled correctly. [~jvennemann] to confirm.
  7. Jan Vennemann 2017-11-28

    [~hknoechel], yeah you are right, the typedef is causing some issues. We generate a native helper class to handle the block that is defined there and that helper produces a wrong header import because they don't follow the umbrella header best practices. I'm working on a fix but unfortunately this will only work together with use_frameworks! in the Podfile. This allows us to grab the correct umbrella header from the module map.
  8. Jan Vennemann 2017-11-29

    PR: https://github.com/appcelerator/hyperloop.next/pull/265
  9. Hans Knöchel 2017-11-29

    [~kbrand] We just released Hyperloop 3.0.1 that contains this fix: https://github.com/appcelerator-modules/hyperloop-builds/releases/tag/v3.0.1
  10. Kristjan Brand 2017-11-29

    Can confirm that the build does not fail anymore with Hyperloop 3.0.1. Thanks a lot for fixing the issue!
  11. Kristjan Brand 2017-11-29

    [~hknoechel] there is another issue now though. Building for dist-adhoc fails now when i use my podfile with hyperloop 3.0.1 and SDK 7.0.0.v20171128203009 [ERROR] Failed to export archive to ipa [ERROR] The selected provisioning profile "Project xxx (adhoc) (***)" is most likely not a valid Ad Hoc provisioning profile. [ERROR] Please ensure you are using a valid Ad Hoc provisioning that is linked to the signing identity, then try again. Where *** is my actual provisioning profile UUID what is 100% correct. If i remove my podfile (Not using hyperloop) it packages correctly for adhoc without any issues. Any ideas what could cause it?
  12. Hans Knöchel 2017-11-29

    That's really weird! Didn't hear of that issue so far. Maybe cocoapods override some build-settings of the app. Let me open an own ticket for that and have it investigated! *EDIT*: Created TIMOB-25571 to follow-up.
  13. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source