Summary:
Fix a bug that allows us to run integration tests in our android project, where RN is specified as a module to our project.
sdkHandler does not exist. The android documentation suggests that we should be using android.ndkDirectory instead.
http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0
An alternative solution would be to set the environment variable ANDROID_NDK, but we do not want to rely on setting this environemnt variable at a system wide level.
We ran two tests.
1.) perform a gradle sync from within our Android studio project, and verify there is no error output.
2.) build android using ./gradleW, from command land. Verify there are no build errors.
Closes https://github.com/facebook/react-native/pull/14136
Differential Revision: D5327421
Pulled By: shergin
fbshipit-source-id: d9e18519a8ca318f2026eb409b90cb09e2adbda1
Summary: View tags are currently used for end-to-end test IDs. We'd like to overload the tag field with other information such as nativeID (for native refs) and transitionID (for shared element transitions) in the future. Added a key for testID's tag
Reviewed By: AaaChiuuu
Differential Revision: D4833045
fbshipit-source-id: c2f9371c9a3dbb2411e114f4f096f723ac3132c0
Summary:
We use this version internally.
Closes https://github.com/facebook/react-native/pull/12837
Differential Revision: D4688986
Pulled By: mkonicek
fbshipit-source-id: 93d9dedb51a56d6104aae443e939455c44397e88
Summary:
Removing unused code. We used to have this dependency for the RecyclerViewBackedScrollView, which has been removed.
**Test plan (required)**
Tests pass on Circle CI.
Closes https://github.com/facebook/react-native/pull/12636
Differential Revision: D4646561
Pulled By: ericnakagawa
fbshipit-source-id: 285de78debec306078eb9ad34a2339f95bc42a9c
Summary:
A copy of https://github.com/facebook/react-native/pull/7791 because of our very imperfect tools that mirror the changes from pull requests in the fb monorepo. The internal Phabricator revision for #7791 is in an 'abandoned' state (by foghina probably because of changing teams) and Phabricator doesn't allow me to claim that revision and merge it. Therefore I'm creating a new one.
(It's not foghina's fault, no one probably knew about this "abandoned Phabricator revision" edge case, don't remember we hit it before.)
Will try to keep attribution (git blame) to rigdern when merging.
Closes https://github.com/facebook/react-native/pull/12448
Differential Revision: D4584743
Pulled By: mkonicek
fbshipit-source-id: 66e5b88134fca1980adc4cd8a2ff17c42e10022c
Summary: Update the Android RecyclerView, support v4, and annotation libraries to 23.4.0.
Differential Revision: D4345649
fbshipit-source-id: 859c6555bc79358b1c8ffed0629cdf0e83408a00
Summary:
Improvement over https://github.com/facebook/react-native/pull/11469.
Depends on https://github.com/react-native-community/boost-for-react-native/issues/1, **don't merge before it is fixed**.
It would be more in line with other dependencies to depend only on github for thirdparty bridge dependencies.
**Test plan (required)**
- Circle (testing with caches cleaned)
- ./gradlew ReactAndroid:packageReactNdkLibsForBuck (check twice to make sure caches work)
REACT_NATIVE_BOOST_PATH=./path-to-local-boost/
- ./gradlew ReactAndroid:packageReactNdkLibsForBuck (check twice to make sure caches work)
Closes https://github.com/facebook/react-native/pull/11511
Differential Revision: D4348098
fbshipit-source-id: 5c2f25cc395ae0cad19d56b7c0b2b102513580fb
Summary:
Boost is officially hosted on SourceForge which has ab SSL problem that Gradle complains about and also it is sometimes unavailable.
I switched to using npm hosted (yarnpkg mirrored for performance) boost lib exactly the same as from Source Forge.
Other alternatives considered:
- CDN e.g. mirror.nienbo.com started responding with 4XX code when requested by Gradle
- File sharing like DropBox are not for mass anonymous downloads
- Github is not good for binary files and is throttled for anonymous raw file downloads
- S3 or similar. Requires amazon account for maintenance and does not expose semver API and other nice features that npm has
In the future I'd like to try Yarn as dependency management tool for bridge builds, this could be the first step.
**Test plan (required)**
- Circle (testing with caches cleaned)
- `./gradlew ReactAndroid:packageReactNdkLibsForBuck` (check twice to make sure caches work)
- `REACT_NATIVE_BOOST_PATH=./bridge-dependencies/node_modules/boost-react-native-bundle ./
Closes https://github.com/facebook/react-native/pull/11469
Differential Revision: D4339446
Pulled By: mkonicek
fbshipit-source-id: ccc9196e9b675c16a235a318c4861aaa4e263d6e
Summary:
ReactAndroid/build.gradle downloads a number of ad-hoc dependencies from the internet such as boost, JSC headers, and folly. Having the build depend on the internet is problematic. For example, if the site hosting the JSC headers was to go down, then CI builds would start failing.
This change introduces the environment variable REACT_NATIVE_DEPENDENCIES which refers to a path. Developers can pre-download all of the ad-hoc dependencies into that path and then the build process will grab the dependencies from that local path rather than trying to download them from the internet. This solution is in the spirit of the existing REACT_NATIVE_BOOST_PATH hook.
**Test plan (required)**
This change is used by my team's app.
Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/11195
Differential Revision: D4247080
Pulled By: mkonicek
fbshipit-source-id: 7c4350339c8d509a829e258d8f1bf320ff8eef64
Summary:
This PR removes dependency to Jackson third-party library in Android React Native.
Looking at some older PRs that got merged, it seems like some work had already been done to move away from Jackson.
Anyway, there was only two classes left with a dependency on Jackson. I refactored the code to use android built-in `JsonReader` and `JsonWriter` classes instead.
Prep work was done in https://github.com/facebook/react-native/pull/10516 introducing a few unit tests around serialization, to make sure that refactoring around serialization would not break things.
All references to Jackson in build systems files (BUCK files & build.gradle) have also been removed now that no code depend anymore on this third-party library.
Motivation behind this work is that third-party dependencies in Android React Native can prove to be a pain when trying to integrate React Native components into an already existing large Android application (I know this is not the most common use case for react-native ... yet ;P), that might a
Closes https://github.com/facebook/react-native/pull/10521
Differential Revision: D4226705
Pulled By: mkonicek
fbshipit-source-id: e3a7430a79dd00c871ba3c6a705b0b0c3ec3a701
Summary:
Downloading from the CDN is much faster than from SourceForge, both on my home WiFi and at the office.
I checked using the `diff` utility that both files are identical.
**Test Plan**
Circle CI build on this PR.
Closes https://github.com/facebook/react-native/pull/11087
Differential Revision: D4226538
fbshipit-source-id: a30ec1d94fe3228342c4a198bf65df7a95e0c005
Summary:
In most .gradle files, lines are indented with 4 spaces, but in some places they are indented with 2 spaces. This PR fixes them and enforce it by adding .editorconfig settings.
Closes https://github.com/facebook/react-native/pull/10267
Differential Revision: D4048335
Pulled By: lacker
fbshipit-source-id: df2f2556380f56672cf85690eb1c80e640a6aedf
Summary:
Running the command `./gradlew clean` resulted in the following error:
```
./node_modules/react-native/ReactAndroid/src/main/jni//xreact/jni/Android.mk:42: *** Android NDK: Aborting. . Stop.
Android NDK: ./node_modules/react-native/ReactAndroid/src/main/jni//xreact/jni/Android.mk: Cannot find module with tag 'cxxreact' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
```
The problem was that `REACT_COMMON_DIR` wasn't defined.
**Test plan (required)**
Running `./gradlew clean` now works.
Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9607
Differential Revision: D3780364
fbshipit-source-id: 2b45d538413f7ee2cf0b36a1fa33287f0b1bf23f
Summary:
LazyReactPackage is an extension of ReactPackage that allows us to lazily construct native modules.
It's a separate class to avoid breaking existing packages both internally and in open source.
Reviewed By: astreet
Differential Revision: D3334258
fbshipit-source-id: e090e146adc4e8e156cae217689e2258ab9837aa
Summary:
The `clean` task always fail due to the failure of the `cleanReactNdkLib` task, error messages:
```
:ReactAndroid:cleanReactNdkLib
Android NDK: /my/react-native/ReactAndroid/src/main/jni/react/jni/Android.mk: Cannot find module with tag 'react' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make: Entering directory `/my/react-native/ReactAndroid/src/main/jni/react/jni'
make: Leaving directory `/my/react-native/ReactAndroid/src/main/jni/react/jni'
/my/react-native/ReactAndroid/src/main/jni/react/jni/Android.mk:31: *** Android NDK: Aborting. . Stop.
:ReactAndroid:cleanReactNdkLib FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ReactAndroid:cleanReactNdkLib'.
> Process 'command '/usr/local/opt/android-ndk/ndk-build'' finished with non-zero exit value 2
* Try:
Run with --stacktrace option to get the stack trace. Run with --info
Closes https://github.com/facebook/react-native/pull/7935
Differential Revision: D3646120
Pulled By: bestander
fbshipit-source-id: c869ff4a2d3407643fdeec431f454071747eb429
Summary: Updating to new release from 16.06.2016.
Reviewed By: bestander
Differential Revision: D3444598
fbshipit-source-id: d8c14b3d088bab6c08effcdacde9bf2eccb20d68
Summary:
Update to [OkHttp](https://github.com/square/okhttp) to [OkHttp3](https://publicobject.com/2015/12/12/com-squareup-okhttp3/)
We must also update:
- Fresco to 0.10.0
- okio to 1.8.0
**Motivation**
Reasons for upgrading:
* Issue #4021
* "We discovered that RN Android sometimes fails to connect to the latest stable version of NGINX when HTTP/2 is enabled. We aren't seeing errors with other HTTP clients so we think it's specific to RN and OkHttp. Square has fixed several HTTP/2 bugs over the past eight months." - ide
* OkHttp3 will be maintained & improved, but OkHttp2 will only receive [security fixes](https://publicobject.com/2016/02/11/okhttp-certificate-pinning-vulnerability/)
* Cleaner APIs - "Get and Set prefixes are avoided"
* Deprecated/Removed - HttpURLConnection & Apache HTTP
* React Native apps are currently being forced to bundle two versions of OkHttp (v2 & v3), if another library uses v3
* Improved WebSocket performance - [CHANGELOG.md](https://github.com/square/okhttp/blob/master
Closes https://github.com/facebook/react-native/pull/6113
Reviewed By: andreicoman11, lexs
Differential Revision: D3292375
Pulled By: bestander
fbshipit-source-id: 7c7043eaa2ea63f95854108b401c4066098d67f7
Summary:Building React Native for Android from source the first time is quite slow. A large part of the time is spent downloading the Boost C++ library. If the code is already present on the system, there's no need to download it.
**Test plan**
CircleCI tests on this pull request. The env variable is not defined on CircleCI so this pull request should have no effect.
Closes https://github.com/facebook/react-native/pull/7116
Differential Revision: D3207397
Pulled By: mkonicek
fb-gh-sync-id: 3454947f6c90fda0d8d2cbb17a1af518e45b47fd
fbshipit-source-id: 3454947f6c90fda0d8d2cbb17a1af518e45b47fd
Summary: Folly deprecated the brace initialization for dynamic::array, so point to a more recent tarball and fix it.
Reviewed By: bestander
Differential Revision: D3066402
fb-gh-sync-id: aaf70423886cb0cbc14aba7878a1d4e32bce82b1
shipit-source-id: aaf70423886cb0cbc14aba7878a1d4e32bce82b1
Summary:Added ability to run instrumentation tests with BUCK.
This change uses BUCK to build and run instrumentation tests facebook style.
The gains are that we can execute the same tests internally at FB and in OSS.
Also running tests not via graddle:connect command is 1.5 minutes faster.
I'll keep keep an eye on stability Gradle and BUCK builds for a while.
Closes https://github.com/facebook/react-native/pull/6176
Differential Revision: D2999878
Pulled By: bestander
fb-gh-sync-id: d715ba231769e57100685a1256f2e530c589921c
shipit-source-id: d715ba231769e57100685a1256f2e530c589921c
Summary:
The annotation processor finds subclasses of ViewManager and ShadowNode and generates classes that can both provide a mapping of property names to their type as well as a way of setting these properties.
This avoids having to do reflection to find the properties.
The annotation processor is currently not working when building with Gradle.
public
Reviewed By: astreet
Differential Revision: D2748958
fb-gh-sync-id: ded5b072d236ebf19fb43eaf704fc7f221a82c26
Summary:
Out of 57 builds in the 5 days during Christmas only 15 were successful.
15 of the failed ones were caused by `com.android.ddmlib.ShellCommandUnresponsiveException` when running unstrumentation tests.
Another 10 were because of crashes probably related to memory usage.
This PR follows ideas from https://github.com/Originate/guide/blob/master/android/guide/Continuous%20Integration.md
So far I've made 6 successful builds with this setup.
Need to run it for a few more days to get accurate stats.
Closes https://github.com/facebook/react-native/pull/5021
Reviewed By: svcscm
Differential Revision: D2795713
Pulled By: androidtrunkagent
fb-gh-sync-id: 33373fed7ca7c5fb83b35cf551f8501286e33d7b