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
Summary:
public
The `DialogModule` requires `android.support.v4.app.FragmentManager` which means
every app that wants to use Dialogs would need to have its Activity extend the legacy
`android.support.v4.app.FragmentActivity`.
This diff makes the `DialogModule` work with both the Support `FragmentManager`
(for AdsManager & potentially other fb apps) and the `android.app.FragmentManager`
(for new apps with no legacy dependencies).
Also wrap the native module in the same `Alert` API that we have on iOS and provide
a cross-platform example. In my opinion the iOS Alert API is quite nice and easy to use.
We still keep `AlertIOS` around because of its `prompt` function which is iOS-specific
and also for backwards compatibility.
Reviewed By: foghina
Differential Revision: D2647000
fb-gh-sync-id: e2280451890bff58bd9c933ab53cd99055403858
Summary:
public
New version of gradle has a better support for zipTree copy task. Since we have a few of those including one for boost library which used to take very long, after upgrading we no longer need 6a656a1.
Also seems like many improvements made to gradle since 2.2 made it perform better on incremental builds (around 10% improvement on my laptop).
Command used to upgrade gradle version:
gradle wrapper --gradle-version 2.9
Some of the plugins require updating as well since the previous versions were incompatible with gradle 2.9.
Closes https://github.com/facebook/react-native/pull/4462
Reviewed By: mkonicek
Differential Revision: D2754786
Pulled By: mkonicek
fb-gh-sync-id: 92c07d29aec6d5b4b2c55205b42b135c4d9479a9
Summary: but the NDK build command can't be found in that directory. This
more explicit error now shows the full NDK path where it's looking
and (importantly) includes a hint that backslashes need to be escaped
on Windows for ndk.dir. When I built on Windows the first time,
I didn't realize ndk.dir backslashes needed to be escaped and the
generic "not found" error made the root cause harder to track
down. This change should help others that build on Windows & run into
the same.
Closes https://github.com/facebook/react-native/pull/2960
Reviewed By: @svcscm
Differential Revision: D2470761
Pulled By: @kmagiera
This is an early release and there are several things that are known
not to work if you're porting your iOS app to Android.
See the Known Issues guide on the website.
We will work with the community to reach platform parity with iOS.