都是自己遇到的问题,然后解决的方案,有用的话,点个小星星呗
‘YGValue.h’ file not found
pod update
[!] The name of the given podspec glog
doesn’t match the expected one GLog
#pod ‘GLog’, :podspec => "#{rn_path}/third-party-podspecs/GLog.podspec”
GLog换成小写
[!] CocoaPods could not find compatible versions for pod “React/Core”:
In Podfile:
React/Core (from ../node_modules/react-native
)
Specs satisfying the React/Core (from
…/node_modules/react-native)
dependency were found, but they required a higher minimum deployment target.
platform :ios, ‘9.0’ 至 9.0
import React, {
Component,
PropTypes
} from 'react’;
修改成 import PropTypes from 'prop-types’
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.traveleasy.tecrm/com.traveleasy.tecrm.MainActivity}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation
android:screenOrientation=“portrait"
rm -rf Pods && pod install
pod ‘React’, :path => ‘…/node_modules/react-native’, :subspecs => [
‘RCTLinkingIOS’,
]
[!] Unable to find a specification for yoga (= 0.59.2.React)
depended upon by React/Core
pod ‘yoga’, :path => ‘…/node_modules/react-native/ReactCommon/yoga’
[!] The Demo3-tvOSTests [Debug]
target overrides the OTHER_LDFLAGS
build setting defined in Pods/Target Support Files/Pods-Demo3-tvOSTests/Pods-Demo3-tvOSTests.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the
$(inherited)` flag, or
- Remove the build settings from the target.
1.Target - > building settings中搜索 “ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES”,值类型是bool,点击other,把值换成
$(inherited)
2.如图中最后一个命令,执行pod update
3.解决问题完成。
- Right Click Libraries “Add Files to Project”
- /node_modules/react-native-gesture-handlers/ios/RNGestureHandler.xcodeproj
- Go to build phases and add libRNGestureHandler.a
- Run
Showing Recent Messages
👎 /Users/tiger/Documents/TRAVELEASY/guide-app/ios/Pods/Target Support Files/glog/glog.xcconfig: unable to open file (in target “glog” in project “Pods”) (in target 'glog’)
解决方式
Pod update
‘folly/hash/Hash.h’ file not found
rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/haste-* && watchman watch-del-all && npm cache clean --force && npm cache verify && rm -rf ios/build && rm -rf node_modules/ && npm i
rm -rf pods && pod install
Possible Unhandled Promise Rejection (id: 0):
Error: Unable to open URL: file:///Users/tiger/Library/Developer/CoreSimulator/Devices/9A6EC14D-DCA5-413B-B9DB-20DFCC45477D/data/Containers/Bundle/Application/847BCC43-E8B7-4A29-84FA-7D4E8A38318F/TE_GUIDE.app/
添加 originWhitelist={[‘*’]}
const wechat = require(‘react-native-wechat’);
wechat.registerApp();
[!] CocoaPods could not find compatible versions for pod “React/Core”:
In Podfile:
react-native-fetch-blob (from ../node_modules/react-native-fetch-blob
) was resolved to 0.10.6, which depends on
React/Core
None of your spec sources contain a spec satisfying the dependency: React/Core
.
You have either:
- mistyped the name or version.
- not added the source repo that hosts the Podspec to your Podfile.
在node_modules 里面搜索到当前报错的组件,找到 .podspec 文件,将s.dependency 'React/Core’ 修改成 s.dependency ‘React-Core’
将janalytics-react-native添加到项目后,运行react-native run-ios提示:library not found for -ljanalytics-ios-2.1.2。
需要把
/node_modules/janalytics-react-native/ios/RCTJAnalyticsModule/janalytics-ios-2.1.2.a
文件名修改为
libjanalytics-ios-2.1.2.a
dyld: Library not loaded: @rpath/XCTest.framework/XCTest
Referenced from: /Users/tiger/Library/Developer/CoreSimulator/Devices/87B74312-9409-407B-AD73-7CB7A21E750F/data/Containers/Bundle/Application/E7F48E2B-3C65-4083-98A9-EDB6BB044975/TE_GUIDE.app/TE_GUIDE
Reason: image not found
我明明是OC项目,不知道为什么,需要这个swift 项目的文件,很崩溃
解决方案
Project-> Targets-> Build Phases-> Link Binary with Libraries
中导入 XCTest.framework 并且把后面的Required改成Optional
0.62.0 以上的项目,全线标红
解决方案
Unable to resolve dependency for ‘:app@debug/compileClasspath’: Could not resolve project :react-native-code-push.
我通过将code-push 代码推入行移到所有行的底部来解决这个问题
The ‘Pods-xx’ target has libraries with conflicting names: libcrypto.a and libssl.a.
解决方法:
pod cache list | grep BaiduMapKit
报错
Out of memory: GC overhead limit exceeded.
Please fix the project’s Gradle settings.
上传图片报错 Missing request token for request: <NSURLRequest: 0x600002604bf
解决方案 For anyone else having this issue, as a temporary fix update your local file: node_modules/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm and replace the Obj-C method shouldCacheLoadedImages with the following
-
(BOOL)shouldCacheLoadedImages
{
// UIImage imageNamed handles the caching automatically so we don’t want
// to add it to the image cache.
return NO;
} -
(RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL
size:(CGSize)size
scale:(CGFloat)scale
resizeMode:(RCTResizeMode)resizeMode
progressHandler:(RCTImageLoaderProgressBlock)progressHandler
partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler
completionHandler:(RCTImageLoaderCompletionBlock)completionHandler
{
__block auto cancelled = std::make_shared<std::atomic>(false);
RCTExecuteOnMainQueue(^{
if (cancelled->load()) {
return;
}
UIImage *image = RCTImageFromLocalAssetURL(imageURL);
if (image) {
if (progressHandler) {
progressHandler(1, 1);
}
completionHandler(nil, image);
} else {
NSString *message = [NSString stringWithFormat:@“Could not find image %@”, imageURL];
RCTLogWarn(@“%@”, message);
completionHandler(RCTErrorWithMessage(message), nil);
}
});
return ^{
cancelled->store(true);
};
}