万年素人からHackerへの道

万年素人がHackerになれるまで殴り書きするぜ。

  • ・資産運用おすすめ
    10万円は1000円くらい利益
    資産運用ブログ アセマネ
    • ・寄付お願いします
      YENTEN:YYzNPzdsZWqr5THWAdMrKDj7GT8ietDc2W
      BitZenny:ZfpUbVya8MWQkjjGJMjA7P9pPkqaLnwPWH
      c0ban:8KG95GXdEquNpPW8xJAJf7nn5kbimQ5wj1
      Skycoin:KMqcn7x8REwwzMHPi9fV9fbNwdofYAWKRo

    JavaScriptのisNan, Number.isNaN

    isNaN 関数の型強制は興味深いルールを持つことに注意してください。値が非数かどうかを判定する代用方法として、ECMAScript 2015 で定義されている Number.isNaN() が使用できます。

    https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/isNaN#Description

    isNaN(1)
    false
    Number.isNaN(1)
    false
    isNaN(false)
    false
    Number.isNaN(false)
    false
    isNaN(undefined)
    true
    Number.isNaN(undefined)
    false
    isNaN("")
    false
    Number.isNaN("")
    false
    isNaN(" ")
    false
    Number.isNaN(" ")
    false

    yarn.lock死んだ

    package-lock.jsonは正しいけどyarn.lockが怪しいとき synpがあるけど、これでsynp --source-file /path/to/package-lock.jsonしてpackage-lock.json => yarn.lockできるけど、 そのファイルでうまくyarn installできね。

    https://github.com/imsnif/synp

    npm - how to convert package-lock.json to yarn.lock? - Stack Overflow

    rm -rf node_modules
    yarn cache clean
    npm cache clean -force
    npm install
    rm yarn.lock
    yarn import

    ReactNativeでiOSのリリースのビルドでエラー

    undefined is not a function (near '...babelHelpers.applyDecoratedDescriptor...')
    
    <unknown>
        main.jsbundle:112024:60
    loadModuleImplementation
        main.jsbundle:180:14
    <unknown>
        main.jsbundle:73667:70
    loadModuleImplementation
        main.jsbundle:180:14
    <unknown>
        main.jsbundle:1719:60
    loadModuleImplementation
        main.jsbundle:180:14
    guardedLoadModule
        main.jsbundle:94:47
    global code
        main.jsbundle:112060:4

    なぜか?

    https://github.com/facebook/react-native/issues/19955#issuecomment-421295617

    .babelrcの中身

    {
      plugins: [
        ['@babel/plugin-proposal-decorators', {legacy: true}],
        ["@babel/plugin-transform-runtime", { "helpers": true }] # これ追加してみた
      ],
      "presets": ["module:metro-react-native-babel-preset"]
    }

    これやったり

    yarn add @babel/plugin-transform-runtime --dev
    yarn add @babel/runtime --dev

    package.jsonの中身.

        "@babel/plugin-transform-runtime": "^7.1.0",
        "@babel/runtime": "^7.1.2",

    これやったり yarn add babel-plugin-transform-inline-environment-variables --dev

    package.json.

        "babel-plugin-transform-inline-environment-variables": "^0.4.3",

    だめ

    HTTP load failed (error code: -999 [1:89])

    のログが出てるのも気になる・・・・

    ReactNative Admobの Info.plist の警告

    <AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist

    これでる。Xcodeのログ。

    ios - Disabling firebase automatic screen reporting - Stack Overflow

    <key>FirebaseScreenReportingEnabled</key>
    <false/>

    を追記した。

    この警告関係ないかもしれないがGoogleService-Info.plistも必要なのかも?

    f:id:shinriyo:20181004085231p:plain