我很难使用最新的谷歌分析文章,以及米格尔在这里提供的MonoTouch绑定:https://github.com/migueldeicaza/monotouch-libs/tree/master/GoogleAnalytics
我猜接口已经以不兼容的方式发生了一些变化,但我不确定如何诊断。在运行时,我得到这个错误: System.InvalidCastException:无法从源类型转换为目标类型。at GoogleAnalytics.GANTracker.get_SharedTracker () 0x00000 in :0
似乎只添加了两个方法,所以我尝试将这两个方法添加到"api.cs“中-但得到了一系列编译器错误,似乎与这种情况无关。
[Export ("setCustomVariableAtIndex:index:name:value:scope:error"),Internal]
bool _SetCustomVariableAtIndex(int index, string name, string value, int scope, IntPtr nsErrorPtr);
[Export ("setCustomVariableAtIndex:index:name:value:error"),Internal]
bool _SetCustomVariableAtIndex(int index, string name, string value, IntPtr nsErrorPtr); 有没有其他人克服了这个问题,并成功地在MonoTouch上使用了谷歌分析的NoThumb版本?
发布于 2011-03-17 23:56:21
我也有同样的问题,但我最终还是让它起作用了。
我不得不在最新版本的Google Analytics for iOS上使用btouch工具。这将重新创建GANTracker.dll。
我还将此代码添加到我的项目文件中的iPhone Build->Additional mtouch Args下:
-v -v -v -gcc_flags "-L${ProjectDir}/Google -lGoogleAnalytics -lsqlite3.0 -force_load ${ProjectDir}/Google/libGoogleAnalytics.a"我的项目中有一个包含以下文件的Google子文件夹:
对不起,我没有关于btouch的更具体的说明,它已经有一段时间了。
https://stackoverflow.com/questions/5341505
复制相似问题