diff --git a/.re-natal b/.re-natal index 4deadeddf4..5870e1e456 100644 --- a/.re-natal +++ b/.re-natal @@ -1,7 +1,7 @@ { "name": "Messenger", "interface": "om-next", - "androidHost": "10.0.3.2", + "androidHost": "localhost", "modules": [ "react-native-contacts", "react-native-invertible-scroll-view", @@ -10,5 +10,6 @@ ], "imageDirs": [ "images" - ] + ], + "iosHost": "localhost" } \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index fd8cf52214..3642aa0172 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,9 @@ import com.android.build.OutputFile * * // whether to bundle JS and assets in another build variant (if configured). * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants - * // The configuration property is in the format 'bundleIn${productFlavor}${buildType}' + * // The configuration property can be in the following formats + * // 'bundleIn${productFlavor}${buildType}' + * // 'bundleIn${buildType}' * // bundleInFreeDebug: true, * // bundleInPaidRelease: true, * // bundleInBeta: true, @@ -60,8 +62,7 @@ import com.android.build.OutputFile apply from: "react.gradle" /** - * Set this to true to create three separate APKs instead of one: - * - A universal APK that works on all devices + * Set this to true to create two separate APKs instead of one: * - An APK that only works on ARM devices * - An APK that only works on x86 devices * The advantage is the size of the APK is reduced by about 4MB. @@ -91,9 +92,9 @@ android { } splits { abi { - enable enableSeparateBuildPerCPUArchitecture - universalApk false reset() + enable enableSeparateBuildPerCPUArchitecture + universalApk false // If true, also generate a universal APK include "armeabi-v7a", "x86" } } @@ -121,7 +122,7 @@ android { dependencies { compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" - compile "com.facebook.react:react-native:0.20.+" + compile "com.facebook.react:react-native:+" // From node_modules compile project(':react-native-contacts') compile project(':react-native-i18n') compile(name:'geth', ext:'aar') diff --git a/android/app/react.gradle b/android/app/react.gradle index 4b43bf910c..11a4f8b871 100644 --- a/android/app/react.gradle +++ b/android/app/react.gradle @@ -30,21 +30,20 @@ gradle.projectsEvaluated { productFlavors.each { productFlavorName -> buildTypes.each { buildTypeName -> - // Create variant and source names - def sourceName = "${buildTypeName}" - def targetName = "${sourceName.capitalize()}" - if (productFlavorName) { - sourceName = "${productFlavorName}${targetName}" - } + // Create variant and target names + def targetName = "${productFlavorName.capitalize()}${buildTypeName.capitalize()}" + def targetPath = productFlavorName ? + "${productFlavorName}/${buildTypeName}" : + "${buildTypeName}" // React js bundle directories def jsBundleDirConfigName = "jsBundleDir${targetName}" def jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?: - file("$buildDir/intermediates/assets/${sourceName}") + file("$buildDir/intermediates/assets/${targetPath}") def resourcesDirConfigName = "jsBundleDir${targetName}" def resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?: - file("$buildDir/intermediates/res/merged/${sourceName}") + file("$buildDir/intermediates/res/merged/${targetPath}") def jsBundleFile = file("$jsBundleDir/$bundleAssetName") // Bundle task name for variant @@ -80,7 +79,9 @@ gradle.projectsEvaluated { "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir } - enabled config."bundleIn${targetName}" ?: targetName.toLowerCase().contains("release") + enabled config."bundleIn${targetName}" || + config."bundleIn${buildTypeName.capitalize()}" ?: + targetName.toLowerCase().contains("release") } // Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process diff --git a/android/build.gradle b/android/build.gradle index 60402fc4df..0bf558e768 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -16,6 +16,11 @@ allprojects { repositories { mavenLocal() jcenter() + maven { + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm + url "$projectDir/../../node_modules/react-native/android" + } + // for geth flatDir { dirs 'libs' } diff --git a/env/dev/env/android/main.cljs b/env/dev/env/android/main.cljs index f307d378b8..3bf98813b0 100644 --- a/env/dev/env/android/main.cljs +++ b/env/dev/env/android/main.cljs @@ -7,7 +7,7 @@ (enable-console-print!) (figwheel/watch-and-reload - :websocket-url "ws://10.0.3.2:3449/figwheel-ws" + :websocket-url "ws://localhost:3449/figwheel-ws" :heads-up-display true :jsload-callback #(om/add-root! state/reconciler core/AppRoot 1)) diff --git a/package.json b/package.json index c900c6366d..b3682689a5 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,10 @@ }, "dependencies": { "awesome-phonenumber": "^1.0.12", - "react-native": "0.20.0", + "react-native": "^0.21.0", "react-native-contacts": "^0.2.1", "react-native-i18n": "0.0.8", "react-native-invertible-scroll-view": "^0.2.0", - "web3": "^0.15.2" + "web3": "^0.15.3" } }