我尝试在iOS上使用推送通知构建一个Ionic 3应用程序。
回复此帖: Ionic 3 - xcode error with cocoapods
我有树错误:
diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null
if [ $? != 0 ] ; then
# print error to STDERR
echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2
exit 1
fi
我试图解决它在我的[CP] Check Pods Manifest.lock中购买此修改:
Module 'FirebaseInstanceID' not found
我认为它有效。但是现在,尝试在我的设备上运行后,我在xCode中出现了一个新错误:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyProject' do
pod 'Firebase'
pod 'Firebase/Core'
pod 'Fi
我尝试再次运行pod安装,但没有区别。我试着像这样修改我的podfile ......
horizontalScrollBar()
但我保留了我的错误。有人有办法解决这个问题吗?
答案 0 :(得分:4)
我遇到了同样的问题,this solution为我工作:
cordova platform rm ios
cordova platform add ios
内部平台/ ios
pod install --verbose
转到平台/ ios / Pods /目标支持文件/ Pods-proj
复制文件的所有内容:
Pods-proj.debug.xconfig
Pods-proj.release.xconfig
然后将它们放在平台/ ios中的对应位置
然后在Xcode中成功进行了清洁和构建。
似乎在顶级文件中找不到或未正确引用它们。
答案 1 :(得分:0)
在ios设备上运行ionic3应用程序时,我确实遇到了这个问题,以下是您可能需要做的工作。
运行#include <boost/asio.hpp>
#include <iostream>
#include <fstream>
using namespace boost;
class SyncTCPClient {
public:
SyncTCPClient(const std::string& raw_ip_address, unsigned short port_num)
: m_ep(asio::ip::address::from_string(raw_ip_address), port_num), m_sock(m_ios) {
m_sock.open(m_ep.protocol());
}
~SyncTCPClient() { close(); }
void connect() { m_sock.connect(m_ep); }
std::string emulateLongComputationOp(unsigned int duration_sec) {
std::string request = "EMULATE_LONG_COMP_OP " + std::to_string(duration_sec) + "\n";
sendRequest(request);
return receiveResponse();
}
private:
void close() {
if (m_sock.is_open()) {
std::ofstream log("logfile1.txt", std::ios_base::app | std::ios_base::out);
log << "shutting down\n" << std::flush;
m_sock.shutdown(asio::ip::tcp::socket::shutdown_both);
log << "closing the socket\n" << std::flush;
m_sock.close();
log << "socket closed\n" << std::flush;
}
}
void sendRequest(const std::string& request) { asio::write(m_sock, asio::buffer(request)); }
std::string receiveResponse() {
asio::streambuf buf;
asio::read_until(m_sock, buf, '\n');
std::istream input(&buf);
std::string response;
std::getline(input, response);
return response;
}
private:
asio::io_service m_ios;
asio::ip::tcp::endpoint m_ep;
asio::ip::tcp::socket m_sock;
};
int main() {
const std::string raw_ip_address = "127.0.0.1";
const unsigned short port_num = 3333;
try {
SyncTCPClient client{raw_ip_address, port_num};
// Sync connect.
client.connect();
std::cout << "Sending request to the server...\n";
std::string response = client.emulateLongComputationOp(10);
std::cout << "Response received: " << response << "\n";
} catch (std::system_error& e) {
std::ofstream log("logfile1.txt", std::ios_base::app | std::ios_base::out);
log << "Error occurred! Error code = " << e.code().value() << ". Message: " << e.what() << "\n" << std::flush;
return e.code().value();
}
return 0;
}
或者查看此链接以获取更多帮助。
https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md