Facebook-iOS-SDK:如何更正构建框架并将其添加到项目中? [英] Facebook-iOS-SDK: How to correct build framework and add it to project?

查看:150
本文介绍了Facebook-iOS-SDK:如何更正构建框架并将其添加到项目中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为iPad开发了一个应用.

I develop an app for iPad.

现在,我在 iPad-5.1 Simulator 上测试应用程序.

At now, i test application on iPad-5.1 Simulator.

出于我的不满,申请失败了.

And for my unhappiness, application falls down.

1)我使用 FacebookSDK 3.0
2)将 FacebookSDK 编译为框架 FBiOSSDK
3)将框架 FBiOSSDK 添加到项目
4)查看链接器
的日志 5)体系结构i386的未定义符号: "_sqlite3_open_v2"和许多"_sqlite3_ *"符号.

1) I use FacebookSDK 3.0
2) Compile FacebookSDK into Framework FBiOSSDK
3) Add Framework FBiOSSDK to project
4) See log of Linker
5) Undefined symbols for architecture i386: "_sqlite3_open_v2" and many-many "_sqlite3_*" symbols.

在将其构建到框架时,也许我为facebook-sdk项目设置了错误的选项吗?

Maybe i set wrong options to facebook-sdk project when build it to framework?

有人可以帮忙吗?

搜索后,我找到了解决方法:

After search, i find a solution:

添加到项目libsqlite3.0.dylib"

"Add to project libsqlite3.0.dylib"

但是链接器说: 忽略文件/path/libsqlite3.dylib,文件中缺少必需的体系结构i386"

But Linker said: "ignoring file /path/libsqlite3.dylib, missing required architecture i386 in file"

-主要问题-

一个小时后,我发现我以错误的方式链接了框架.

After an hour, i've found out, that i link framework in wrong way.

脚本在本地目录中创建(不在 System/Library/Frameworks Library/Frameworks 中).

Script create it in local directory (not in System/Library/Frameworks or Library/Frameworks).

添加后,Framework Search Paths更改为非默认值.

After adding it, Framework Search Paths changes to not default value.

如何以正确的方式构建框架?

How to build framework in right way?

谢谢!

推荐答案

因此,很长一段时间后,我做了一些事情使此 FacebookSDK 工作:

So, after a long time i make such things to make this FacebookSDK work:

1)首先,我删除 FacebookSDK框架( rm -rf )的构建并运行用于构建框架的脚本( build_framework.sh )

1)First, I delete build of FacebookSDK framework (rm -rf) and run script for building framework (build_framework.sh)

2)之后,我将添加到项目中( project -> 构建阶段-> 与库的链接二进制文件) FacebookSDK .framework (来自 local 目录,使用按钮 添加其他 )和 libsqlite3. 0dylib libsqlite3.dylib (只需在搜索字段中搜索!)

2)After that, i add to project (project -> build phases -> link binary with libraries ) FacebookSDK.framework (from local directory, with button add other) and libsqlite3.0dylib and libsqlite3.dylib (just search it in search-field!)

0)或3)然后,我做得到:找到目录〜/Library/Developer/Xcode/DerivedData 并删除 一切 由此. (使用命令 rm -rf dir_name/* )

0) or 3)And After that i make this: find directory ~/Library/Developer/Xcode/DerivedData and delete EVERYTHING from this. (use command rm -rf dir_name/*)

您可以从步骤3)开始,我也将其命名为步骤0).

You can do it from step 3) that i also named step 0).

在这里,我提供了一个脚本,可以为您提供帮助

Here i provide a script, which can help you

#!/usr/bin/perl
my $pathToCacheDirectory = qq(~/Library/Developer/Xcode/DerivedData/);

sub TaskToDo{
    my ($refToArgv)=@_;
    die "can't work with too much parameters" unless(scalar(@$refToArgv)==1);
    my $what = shift @$refToArgv;
    my $time = 30; #wait 30 seconds in each iteration
    my $workRef = sub{
        print "i will delete: ";
        print qx(ls $pathToCacheDirectory);
    qx(rm -rf $pathToCacheDirectory);
    };
    #view help
    if ($what eq 'help'){
        print qx(perldoc -t $0);
    }
    #list directory 
    if ($what eq 'watch'){
    print qx(ls $pathToCacheDirectory);
    }
    #kill files instantly
    if ($what eq 'now'){
    print 'kill now'.qq(\n);
    $workRef->();
    print 'see result'.qq(\n);
    print qx(ls $pathToCacheDirectory);
    }
    #switch on watcher
    if ($what eq 'work'){
    for(;;){
        #in INF loop
        for my $s(0..4){
        #print "this is <<$_>>\n";
        print "time remaining: ".(5-$s)*$time." sec \n";
        sleep($time);
        }
        $workRef->();    
        sleep(10);
    }
    }
} 

TaskToDo(\@ARGV);



__END__

=head1 DESCRIPTION

This script clear directory with cache from Xcode

    -- 'help'  will show this log

    -- 'work'  will run script as observer and killer

    -- 'watch' will show info about directory with cache

    -- 'now'   will kill all instantly

    Example: perl scriptName.pl help

=cut

这篇关于Facebook-iOS-SDK:如何更正构建框架并将其添加到项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆