错误:
public class CBAdapter extends RecyclerView.Adapter<CBAdapter.ViewHolder> {
List<AdapterData> mItems;
public CBAdapter() {
super();
mItems = new ArrayList<>();
AdapterData data = new AdapterData();
data.setTextOne("Many Bows");
mItems.add(data);
data = new AdapterData();
data.setTextOne("Pardon");
mItems.add(data);
data = new AdapterData();
data.setTextOne("Fall To Knees & Beg");
mItems.add(data);
data = new AdapterData();
data.setTextOne("Backflips");
mItems.add(data);
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View v = LayoutInflater.from(viewGroup.getContext())
.inflate(R.layout.test3, viewGroup, false);
return new ViewHolder(v);
}
@Override
public void onBindViewHolder(ViewHolder viewHolder, int i) {
AdapterData data = mItems.get(i);
viewHolder.textOne.setText(data.getTextOne());
}
@Override
public int getItemCount() {
return mItems.size();
}
class ViewHolder extends RecyclerView.ViewHolder{
public TextView textOne;
private Context context;
public ViewHolder(View itemView) {
super(itemView);
textOne = (TextView)itemView.findViewById(R.id.textView1);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Dialog dialog = new Dialog(context);
dialog.setContentView(R.layout.custom_dialog);
dialog.setTitle("Title");
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("hello world");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.ic_launcher);
Button dialogButton = (Button) dialog.findViewById(R.id.dialogButtonOK);
dialogButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
});
}
}
}
什么是构建配置,架构。我在用 可可豆荚,XCode 7.1,目标iOS版本是8.4。如何解决此构建错误?
Podfile
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_TyphoonAssembly", referenced from:
_OBJC_CLASS_$_AppAssembly in AppAssembly.o
"_OBJC_CLASS_$_TyphoonBlockComponentFactory", referenced from:
objc-class-ref in AppAssembly.o
"_OBJC_CLASS_$_TyphoonComponentFactory", referenced from:
objc-class-ref in AppDelegate.o
objc-class-ref in UIViewController+PropertyInjector.o
objc-class-ref in ReminderViewController.o
objc-class-ref in AppAssembly+AddReminder.o
objc-class-ref in DashboardViewController.o
objc-class-ref in AppAssembly+Dashboard.o
"_OBJC_CLASS_$_TyphoonDefinition", referenced from:
objc-class-ref in AppAssembly.o
objc-class-ref in AppAssembly+ViewControllers.o
objc-class-ref in AppAssembly+Actions.o
...
"_OBJC_METACLASS_$_TyphoonAssembly", referenced from:
_OBJC_METACLASS_$_AppAssembly in AppAssembly.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Podfile安装输出
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
xcodeproj 'Proj'
pod 'KGModal'
pod 'JSONKit'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'TTTAttributedLabel'
target :Proj, :exclusive => true do
# pod 'Typhoon', :head
end
target :ProjTest, :exclusive => true do
pod 'Kiwi'
end
这是pod更新输出,终端中没有其他错误,我将$(继承)添加到链接器搜索路径
答案 0 :(得分:1)
这是一个基本错误,因为您的Xcode无法通过pod搜索您想要的库。在安装cocoapods之前,请尝试以下步骤:
最后,如果您已完成所有这些步骤并仍然显示此错误。检查您导入的库是通过pod还是手动导入的。改变他们
#import <AFNetworking/AFNetworking.h>
种类。
如果评论发布后仍有错误。