DevDmitryHub / cordova-plugin-appsflyer

AppsFlyer plugin for Cordova (Phonegap)
3 stars 2 forks source link

Build error on iOS #2

Closed AbraXus closed 8 years ago

AbraXus commented 8 years ago

I get the following errors when building the app for iOS:

AppsFlyerPlugin.m:8:38: error: no visible @interface for 'CDVPlugin' declares the selector 'initWithWebView:'
    self = (AppsFlyerPlugin *)[super initWithWebView:theWebView];

and

AppsFlyerPlugin.m:80:26: error: no visible @interface for 'UIView' declares the selector 'stringByEvaluatingJavaScriptFromString:'
        [[super webView] stringByEvaluatingJavaScriptFromString: [NSString stringWithFormat:@"javascript:window.plugins.appsFlyer.onInstallConversionDataLoaded(%@)", JSONString]];

I tried both plugin versions v.3.3.3 and v.3.3.1 but same effect. I am using Cordova v6 with cordova-ios 4.0.1.

Any help would be much appreciated.

DevDmitryHub commented 8 years ago

Hi @AbraXus,

The issue related to changes in API for Cordova v6. You should try to update plugin to the new version v.4.0.1. There are some changes https://github.com/DevDmitryHub/cordova-plugin-appsflyer/commit/310b91c30c643168e1144ea7dd0153a790b476b3 which have to resolve this issue.

AbraXus commented 8 years ago

Hi @DevDmitryHub

Thanks for the fast help. The issue above was resolved with v.4.0.1. However, I run into another error when starting the app.

The error occurrs on the following line:

[[super webViewEngine] evaluateJavaScript:[NSString stringWithFormat:@"javascript:window.plugins.appsFlyer.onInstallConversionDataLoaded(%@)", JSONString] completionHandler:nil];

Xcode debug output:

2016-03-30 12:37:24.483 DEV[329:41137] AppsFlyer: __37-[AppsFlyerTracker getConversionData]_block_invoke170 conversion response from server:{"af_status": "Organic", "af_message": "organic install"}  [...]
2016-03-30 12:37:24.491 DEV[329:41137] AppsFlyer: __37-[AppsFlyerTracker getConversionData]_block_invoke170 Caching conversion data.
2016-03-30 12:37:24.491 DEV[329:41137] bool _WebTryThreadLock(bool), 0x1463755e0: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...
1   0x1858fcf8c WebThreadLock
2   0x1870046b0 <redacted>
3   0x10014af10 -[CDVUIWebViewEngine evaluateJavaScript:completionHandler:]
4   0x1000f7b08 -[AppsFlyerPlugin onConversionDataReceived:]
5   0x1001546a8 __37-[AppsFlyerTracker getConversionData]_block_invoke170
6   0x18201f53c <redacted>
7   0x1820320bc <redacted>
8   0x1823ec510 <redacted>
9   0x18233e900 <redacted>
10  0x18232eed8 <redacted>
11  0x1823ee904 <redacted>
12  0x1006f9a3c _dispatch_client_callout
13  0x100706554 _dispatch_queue_drain
14  0x1006fd72c _dispatch_queue_invoke
15  0x10070866c _dispatch_root_queue_drain
16  0x100708364 _dispatch_worker_thread3
17  0x181695470 _pthread_wqthread
18  0x181695020 start_wqthread
(lldb) 

Any idea what is going wrong this time?