Skip to content
Permalink
Browse files

Enable Java8 (#23295)

Summary:
Running *lint* on RN found that there are some Java 8 features used without specifying Java 8 compatibility in projects. This PR adds Java 8 compatibility and fixes errors caused by Java 8 feature use. I suspend that it may be cause of many failures on older Androids, but also found that many modules/packages switched to and require Java 8.

```java
../../src/main/java/com/facebook/react/devsupport/BundleDownloader.java:167: Try-with-resources requires API level 19 (current min is 16)
../../src/main/java/com/facebook/react/devsupport/DevServerHelper.java:658: Try-with-resources requires API level 19 (current min is 16)
```

For more information https://developer.android.com/studio/write/java8-support

[Android] [Changed] - Enable Java 8
Pull Request resolved: #23295

Differential Revision: D13959096

Pulled By: cpojer

fbshipit-source-id: 0bfd0565b61a132906cf35ee55b4afcf5450f7cb
  • Loading branch information...
dulmandakh authored and facebook-github-bot committed Feb 5, 2019
1 parent 8beb4bb commit 38eb2a70afa87c49c1e62754f5ae3cd26e7f59c3
Showing with 15 additions and 0 deletions.
  1. +5 −0 RNTester/android/app/build.gradle
  2. +5 −0 ReactAndroid/build.gradle
  3. +5 −0 template/android/app/build.gradle
@@ -93,6 +93,11 @@ def enableProguardInReleaseBuilds = true
android {
compileSdkVersion 28

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "com.facebook.react.uiapp"
minSdkVersion 16
@@ -266,6 +266,11 @@ task packageReactNdkLibsForBuck(dependsOn: packageReactNdkLibs, type: Copy) {
android {
compileSdkVersion 28

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
minSdkVersion 16
targetSdkVersion 27
@@ -96,6 +96,11 @@ def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "com.helloworld"
minSdkVersion rootProject.ext.minSdkVersion

0 comments on commit 38eb2a7

Please sign in to comment.
You can’t perform that action at this time.