评论在Sandbox

在2019/08/28 18:37上被shi chuck修改

  • shi chuck
    shi chuck, 2024/06/23 12:37

    react-native-neomorph-shadows在ios运行crash问题:
    执行  npm run postinstall

    ios图片不显示问题:
    vi ./node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m

    找到
    if (_currentFrame) {
        layer.contentsScale = self.animatedImageScale;
        layer.contents = (bridge id)_currentFrame.CGImage;
    }
    修改为:
    if (_currentFrame) {
        layer.contentsScale = self.animatedImageScale;
        layer.contents = (
    bridge id)_currentFrame.CGImage;
    } else {
        [super displayLayer:layer];
    }

    开发时编译问题:
    ./node_modules/@react-native-community/cli-platform-android/native_modules.gradle

    找到:ArrayList<HashMap<String, String>>[] packages = this.reactNativeModules
    修改为:ArrayList<HashMap<String, String>> packages = this.reactNativeModules

    ./node_modules/react-native-i18n/android/build.gradle

    找到:compile "com.facebook.react:react-native:+"
    修改为:implementation "com.facebook.react:react-native:+"

  • shi chuck
    shi chuck, 2024/06/23 12:57

    2、更换镜像
    安装CocoaPods时我们要访问cocoapods.org,该网站可能被我们大天朝墙了,我们可以更换到国内的源进行访问。很多旧教程使用的是淘宝的源http:ruby.taobao.org。这个源已经失效了,而有些近期的教程使用的是https:gems.ruby-china.org/
    这个源也已经改了,改成了https:gems.ruby-china.com/。大家可以进这个网站看看,首页有说明。
    2.1、移除原始源
    $ gem sources remove https://rubygems.org/
    2.2、添加新源
    $ gem sources 
    add https://gems.ruby-china.com/
    2.3、查看当前源
    $ gem sources -l
    如果显示下面的内容,则添加完成