Update RN and Viro. iOS build working

This commit is contained in:
John Lyon-Smith
2018-05-09 11:23:11 -07:00
parent 93cfa3b4dc
commit ccd159bb47
13 changed files with 1886 additions and 2274 deletions

View File

@@ -6,8 +6,7 @@
"development": {
"plugins": [
"transform-react-jsx-source",
"transform-decorators-legacy",
"transform-inline-environment-variables"
"transform-decorators-legacy"
]
}
}

View File

@@ -1,5 +0,0 @@
{
"expoServerPort": 19000,
"packagerPort": 19001,
"packagerPid": 694
}

View File

@@ -1,7 +0,0 @@
{
"hostType": "tunnel",
"lanType": "ip",
"dev": true,
"minify": false,
"urlRandomness": null
}

View File

@@ -173,3 +173,12 @@ task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
repositories {
google()
}
buildscript {
repositories {
google()
}
}

View File

@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

View File

@@ -199,11 +199,11 @@
"${BUILT_PRODUCTS_DIR}/AWSDynamoDB/AWSDynamoDB.framework",
"${BUILT_PRODUCTS_DIR}/DoubleConversion/DoubleConversion.framework",
"${BUILT_PRODUCTS_DIR}/Folly/folly.framework",
"${BUILT_PRODUCTS_DIR}/GLog/glog.framework",
"${BUILT_PRODUCTS_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework",
"${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework",
"${BUILT_PRODUCTS_DIR}/React/React.framework",
"${PODS_ROOT}/../../node_modules/react-viro/ios/dist/ViroRenderer/ViroKit.framework",
"${BUILT_PRODUCTS_DIR}/glog/glog.framework",
"${BUILT_PRODUCTS_DIR}/react-native-image-picker/react_native_image_picker.framework",
"${BUILT_PRODUCTS_DIR}/react-native-maps/react_native_maps.framework",
"${BUILT_PRODUCTS_DIR}/yoga/yoga.framework",
@@ -214,11 +214,11 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSDynamoDB.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DoubleConversion.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/folly.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMSessionFetcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleToolboxForMac.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/React.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ViroKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_image_picker.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_maps.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/yoga.framework",

View File

@@ -23,7 +23,7 @@ target 'DeightonAR' do
# Third party deps podspec link
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'react-native-maps', path: '../node_modules/react-native-maps'
@@ -37,22 +37,61 @@ target 'DeightonAR' do
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
end
pre_install do |installer|
# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
# See https://gist.github.com/Jpunt/3fe75effd54a702034b75ff697e47578
#
# When using RN in combination with Cocoapods, a lot of
# things are broken. These are the fixes we had to append
# to our Podfile when upgrading to ReactNative@0.55.3.
#
# WARNING: Check those line numbers when you're on a different version!
def change_lines_in_file(file_path, &change)
print "Fixing #{file_path}...\n"
contents = []
file = File.open(file_path, 'r')
file.each_line do | line |
contents << line
end
file.close
File.open(file_path, 'w') do |f|
f.puts(change.call(contents))
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'yoga'
target.build_configurations.each do |config|
config.build_settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = 'NO'
config.build_settings['GCC_WARN_64_TO_32_BIT_CONVERSION'] = 'NO'
end
elsif target.name == 'react-native-google-maps'
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_MODULES'] = 'NO'
end
# https://github.com/facebook/yoga/issues/711#issuecomment-381098373
change_lines_in_file('./Pods/Target Support Files/yoga/yoga-umbrella.h') do |lines|
lines.reject do | line |
[
'#import "Utils.h"',
'#import "YGLayout.h"',
'#import "YGNode.h"',
'#import "YGNodePrint.h"',
'#import "YGStyle.h"',
'#import "Yoga-internal.h"',
].include?(line.strip)
end
end
end
# https://github.com/facebook/yoga/issues/711#issuecomment-374605785
change_lines_in_file('../node_modules/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.h') do |lines|
unless lines[27].include?("#ifdef __cplusplus")
lines.insert(27, "#ifdef __cplusplus")
lines.insert(34, "#endif")
end
lines
end
# https://github.com/facebook/react-native/issues/13198
change_lines_in_file('../node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h') do |lines|
lines.map { |line| line.include?("#import <RCTAnimation/RCTValueAnimatedNode.h>") ? '#import "RCTValueAnimatedNode.h"' : line }
end
# https://github.com/facebook/react-native/issues/16039
change_lines_in_file('../node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m') do |lines|
lines.map { |line| line.include?("#import <fishhook/fishhook.h>") ? '#import "fishhook.h"' : line }
end
end

View File

@@ -1,28 +1,14 @@
PODS:
- AWSCore (2.6.13)
- AWSDynamoDB (2.6.13):
- AWSCore (= 2.6.13)
- boost (1.59.0):
- boost/graph-includes (= 1.59.0)
- boost/math-includes (= 1.59.0)
- boost/numeric-includes (= 1.59.0)
- boost/pointer_cast-includes (= 1.59.0)
- boost/preprocessor-includes (= 1.59.0)
- boost/shared_ptr-includes (= 1.59.0)
- boost/string_algorithms-includes (= 1.59.0)
- boost/graph-includes (1.59.0)
- boost/math-includes (1.59.0)
- boost/numeric-includes (1.59.0)
- boost/pointer_cast-includes (1.59.0)
- boost/preprocessor-includes (1.59.0)
- boost/shared_ptr-includes (1.59.0)
- boost/string_algorithms-includes (1.59.0)
- AWSCore (2.6.17)
- AWSDynamoDB (2.6.17):
- AWSCore (= 2.6.17)
- boost-for-react-native (1.63.0)
- DoubleConversion (1.1.5)
- Folly (2016.09.26.00):
- boost
- boost-for-react-native
- DoubleConversion
- GLog
- GLog (0.3.4)
- glog
- glog (0.3.4)
- GoogleToolboxForMac/Defines (2.1.0)
- GoogleToolboxForMac/Logger (2.1.0):
- GoogleToolboxForMac/Defines (= 2.1.0)
@@ -31,42 +17,46 @@ PODS:
- GVRSDK (1.120.0):
- GoogleToolboxForMac/Logger (= 2.1.0)
- GTMSessionFetcher/Core (= 1.1.6)
- React (0.49.5):
- React/Core (= 0.49.5)
- React (0.55.4):
- React/Core (= 0.55.4)
- react-native-image-picker (0.14.3):
- React
- react-native-maps (0.20.1):
- react-native-maps (0.21.0):
- React
- React/Core (0.49.5):
- yoga (= 0.49.5.React)
- React/CxxBridge (0.49.5):
- React/Core (0.55.4):
- yoga (= 0.55.4.React)
- React/CxxBridge (0.55.4):
- Folly (= 2016.09.26.00)
- React/Core
- React/cxxreact
- React/cxxreact (0.49.5):
- boost
- React/cxxreact (0.55.4):
- boost-for-react-native (= 1.63.0)
- Folly (= 2016.09.26.00)
- React/jschelpers
- React/DevSupport (0.49.5):
- React/jsinspector
- React/DevSupport (0.55.4):
- React/Core
- React/RCTWebSocket
- React/fishhook (0.49.5)
- React/jschelpers (0.49.5):
- React/fishhook (0.55.4)
- React/jschelpers (0.55.4):
- Folly (= 2016.09.26.00)
- React/RCTAnimation (0.49.5):
- React/PrivateDatabase
- React/jsinspector (0.55.4)
- React/PrivateDatabase (0.55.4)
- React/RCTAnimation (0.55.4):
- React/Core
- React/RCTBlob (0.49.5):
- React/RCTBlob (0.55.4):
- React/Core
- React/RCTGeolocation (0.49.5):
- React/RCTGeolocation (0.55.4):
- React/Core
- React/RCTImage (0.49.5):
- React/RCTImage (0.55.4):
- React/Core
- React/RCTNetwork
- React/RCTNetwork (0.49.5):
- React/RCTNetwork (0.55.4):
- React/Core
- React/RCTText (0.49.5):
- React/RCTText (0.55.4):
- React/Core
- React/RCTWebSocket (0.49.5):
- React/RCTWebSocket (0.55.4):
- React/Core
- React/fishhook
- React/RCTBlob
@@ -75,12 +65,12 @@ PODS:
- GVRAudioSDK (= 1.120.0)
- GVRSDK (= 1.120.0)
- ViroReact (1.0)
- yoga (0.49.5.React)
- yoga (0.55.4.React)
DEPENDENCIES:
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
- GLog (from `../node_modules/react-native/third-party-podspecs/GLog.podspec`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
- react-native-maps (from `../node_modules/react-native-maps`)
- React/Core (from `../node_modules/react-native`)
@@ -100,7 +90,7 @@ SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
- AWSCore
- AWSDynamoDB
- boost
- boost-for-react-native
- GoogleToolboxForMac
- GTMSessionFetcher
- GVRAudioSDK
@@ -111,8 +101,8 @@ EXTERNAL SOURCES:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
GLog:
:podspec: "../node_modules/react-native/third-party-podspecs/GLog.podspec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
React:
:path: "../node_modules/react-native"
react-native-image-picker:
@@ -127,23 +117,23 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
AWSCore: 5da797bc476188fdaf00dec134fa18d84708eca9
AWSDynamoDB: 36abff7ce93fcadad2c4dc6f729d8716c933adf2
boost: 30a15ffb6d9aa4646dd3caffc960753f4cb4ca4e
DoubleConversion: ebb6747c5b66026ad4f97b789c3ceac6f18e57a6
Folly: b7255b29f1d693c375d642d0f04f0592181156d9
GLog: 3e4e4ae9746ce6bf6e9420c7fc1e08ad59c8ba1a
AWSCore: 82fbb01d73a22cfae77ac2f03f6073a123092452
AWSDynamoDB: bbfc2583819099ccc0ba92eb54cb425049d4278b
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: e22e0762848812a87afd67ffda3998d9ef29170c
Folly: 211775e49d8da0ca658aebc8eab89d642935755c
glog: 1de0bb937dccdc981596d3b5825ebfb765017ded
GoogleToolboxForMac: 2b2596cbb7186865e98cadf2b1e262d851c2b168
GTMSessionFetcher: 6aacd0ab48ddf0c3633ab2642d792abfcad1b08a
GVRAudioSDK: 302f0a8f190d855868ea07f246ce4f9b44c392ae
GVRSDK: 0cb9d0ce06a84d698e61e3db9509766022dcf815
React: bfd693e2d08a61bf1dc056bba3f5c01a13a3cc31
React: aa2040dbb6f317b95314968021bd2888816e03d5
react-native-image-picker: 42cfe2c8435d893414f8714a81e480313cb1412b
react-native-maps: 066c2afcc89e18726377bcc685315f989ca22449
ViroKit: 9631f301ef6a3f56116b23d6aac5d5c2307aa368
ViroReact: 5520f26ac4654e361786c82da3b29ce0402c3c00
yoga: 17521bbb0dd54a47c0b3ac43253e78cdac7488e0
yoga: a23273df0088bf7f2bb7e5d7b00044ea57a2a54a
PODFILE CHECKSUM: 6a4957d8115688cbb9e33db130bb6936259d12be
PODFILE CHECKSUM: bf7fd2f2a19c210b54a09cfb216d5f930cf6601c
COCOAPODS: 1.5.0.beta.1
COCOAPODS: 1.5.0

3878
mobile/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,6 @@
"private": true,
"devDependencies": {
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-inline-environment-variables": "^0.3.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"jest-react-native": "^18.0.0",
"react-test-renderer": "16.2.0"
@@ -14,28 +13,27 @@
"android": "react-native run-android",
"build:android": "cd android; rm -rf ./app/build && ./gradlew assembleRelease && ./rename-apk",
"ios": "react-native run-ios",
"test": "node node_modules/jest/bin/jest.js",
"postinstall": "sed -i '' 's/#import <RCTAnimation\\/RCTValueAnimatedNode.h>/#import \"RCTValueAnimatedNode.h\"/' ./node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h; sed -i '' 's/#import <fishhook\\/fishhook.h>/#import \"fishhook.h\"/' ./node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m"
"test": "node node_modules/jest/bin/jest.js"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"autobind-decorator": "^2.1.0",
"eventemitter3": "^3.0.1",
"eventemitter3": "^3.1.0",
"moment": "^2.22.1",
"react": "^16.2.0",
"react": "^16.3.2",
"react-form-binder": "^1.2.0",
"react-native": "^0.49.3",
"react-native": "^0.55.4",
"react-native-image-picker": "^0.26.7",
"react-native-iphone-x-helper": "^1.0.2",
"react-native-iphone-x-helper": "^1.0.3",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-maps": "^0.20.1",
"react-native-modal": "^5.4.0",
"react-native-swipe-list-view": "^1.0.7",
"react-native-maps": "^0.21.0",
"react-native-modal": "^6.0.0",
"react-native-swipe-list-view": "^1.1.1",
"react-router-native": "^4.2.0",
"react-viro": "^2.4.0",
"react-viro": "^2.6.1",
"socket.io-client": "^2.0.4",
"url-search-params-polyfill": "^3.0.0"
"url-search-params-polyfill": "^4.0.0"
}
}

View File

@@ -1,40 +1,39 @@
'use strict';
"use strict"
const blacklist = require('metro-bundler/src/blacklist');
const path = require('path');
const blacklist = require("metro/src/blacklist")
const path = require("path")
module.exports = {
getProjectRoots() {
return this._getRoots();
return this._getRoots()
},
getAssetRoots() {
return this._getRoots();
return this._getRoots()
},
getAssetExts() {
return ["obj", "mtl"];
return ["obj", "mtl"]
},
getBlacklistRE() {
return blacklist();
return blacklist()
},
_getRoots() {
// match on either path separator
if (__dirname.match(/node_modules[\/\\]react-native[\/\\]packager$/)) {
// packager is running from node_modules of another project
return [path.resolve(__dirname, '../../..')];
return [path.resolve(__dirname, "../../..")]
} else if (__dirname.match(/Pods\/React\/packager$/)) {
// packager is running from node_modules of another project
return [path.resolve(__dirname, '../../..')];
return [path.resolve(__dirname, "../../..")]
} else {
return [path.resolve(__dirname, '.')];
return [path.resolve(__dirname, ".")]
}
},
getTransformModulePath() {
return require.resolve('metro-bundler/src/transformer');
return require.resolve("metro/src/transformer")
},
};
}

View File

@@ -10,7 +10,8 @@ import {
Viro3DObject,
ViroSpotLight,
ViroNode,
ViroSurface,
ViroQuad,
ViroConstants,
} from "react-viro"
import autobind from "autobind-decorator"
import backImage from "./images/back.png"
@@ -136,8 +137,13 @@ class WorkItemSceneAR extends React.Component {
}
@autobind
handleTrackingInitialized() {
this.setState({ trackingInitialized: true })
handleTrackingUpdated(state, reason) {
if (
!this.state.trackingInitialized &&
state === ViroConstants.TRACKING_NORMAL
) {
this.setState({ trackingInitialized: true })
}
}
@autobind
@@ -169,7 +175,7 @@ class WorkItemSceneAR extends React.Component {
<ViroARScene
anchorDetectionTypes="PlanesHorizontal"
ref={(ref) => (this.arScene = ref)}
onTrackingInitialized={this.handleTrackingInitialized}
onTrackingUpdated={this.handleTrackingUpdated}
onAnchorFound={this.handleAnchorFound}>
<ViroAmbientLight color="#ffffff" intensity={200} />
<ViroNode
@@ -201,7 +207,7 @@ class WorkItemSceneAR extends React.Component {
onClick={this.handleClick}
/>
)}
<ViroSurface
<ViroQuad
rotation={[-90, 0, 0]}
position={[0, -0.001, 0]}
width={2.5}

View File

@@ -8,25 +8,25 @@ export const config = {
googleGeocodeAPIKey: "AIzaSyCs4JVT6gysnY5dAJ7KjVJYeykLv_xz1GI",
googleGeocodeURL: "https://maps.googleapis.com/maps/api/geocode/json",
refererURL: "https://dar.kss.us.com",
//defaultUser: "john@lyon-smith.org",
defaultUser: "",
defaultUser: "john@lyon-smith.org",
//defaultUser: "",
minGPSAccuracy: 50,
//minGPSAccuracy: 20,
minDistanceToItem: 10,
geocodeDelayMilliseconds: 500,
// This region is downtown Toronto
initialRegion: {
latitude: 43.653908,
longitude: -79.384293,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
},
// This region is Bainbridge Island
// initialRegion: {
// latitude: 47.629536,
// longitude: -122.524162,
// latitude: 43.653908,
// longitude: -79.384293,
// latitudeDelta: 0.0922,
// longitudeDelta: 0.0421,
// },
// This region is Bainbridge Island
initialRegion: {
latitude: 47.629536,
longitude: -122.524162,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
},
alwaysShowWorkItemInAR: true,
}