我有一个反应原生项目正在构建和运行完美。然后我决定将它移动到子目录中,我开始接收大量预编译的头错误:
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SIGN IN"
android:id="@+id/signInTV"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_weight="1"
android:background="#EB7B59"
android:textColor="#524656"
android:clickable="true"
android:onClick="signInButton"
android:focusableInTouchMode="false"/>
足够公平,但奇怪的是,如果我打开xcode项目并在那里清理/重建,一切正常!
然后当我关闭由xcode启动的服务器并尝试使用public void signInButton(View view) {
TextView signInTV = (TextView) findViewById(R.id.signInTV);
signInTV.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent showSignInActivity = new Intent(v.getContext(), SignInActivity.class);
startActivity(showSignInActivity);
}
});
}
启动它时,它继续抱怨PCH问题。
不确定我错过了什么......
答案 0 :(得分:112)
很抱歉回答我自己,但结果是在/path/to/project/ios/build
删除整个构建目录是安全的。在那之后它为我重建好了:)
答案 1 :(得分:11)
无需删除整个构建目录,但删除/path/to/project/ios/build/ModuleCache
处的react-native run-ios
文件夹,然后{{1}}为我工作。
答案 2 :(得分:1)
您必须删除派生数据文件夹。