Skip to content

Commit

Permalink
Bump OSS Android build to SDK 31 (facebook#32606)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#32606

Updates OSS builds for internals and template to target SDK 31, corresponding to Android 12.

Changelog:
[Updated][Android] - Bump Android compile and target SDK to 21

Differential Revision: D32107409

fbshipit-source-id: d8bf0ff95943323ccd82f9596fcbf4264911c680
  • Loading branch information
Andrei Shikov authored and facebook-github-bot committed Nov 16, 2021
1 parent a6eec50 commit 9fc0027
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ jobs:
environment:
- ANDROID_HOME: "C:\\Android\\android-sdk"
- ANDROID_NDK: "C:\\Android\\android-sdk\\ndk\\20.1.5948944"
- ANDROID_BUILD_VERSION: 30
- ANDROID_BUILD_VERSION: 31
- ANDROID_TOOLS_VERSION: 30.0.2
- GRADLE_OPTS: -Dorg.gradle.daemon=false
- NDK_VERSION: 21.4.7075529
Expand Down
4 changes: 2 additions & 2 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ task installArchives {
}

android {
compileSdkVersion 30
compileSdkVersion 31
if (project.hasProperty("ANDROID_NDK_VERSION")) {
ndkVersion project.property("ANDROID_NDK_VERSION")
}
Expand All @@ -281,7 +281,7 @@ android {

defaultConfig {
minSdkVersion(21)
targetSdkVersion(28)
targetSdkVersion(31)
versionCode(1)
versionName("1.0")

Expand Down
1 change: 1 addition & 0 deletions ReactAndroid/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<activity
android:name="com.facebook.react.testing.ReactAppTestActivity"
android:theme="@style/Theme.ReactNative.AppCompat.Light.NoActionBar.FullScreen"
android:exported="false"
/>
</application>
</manifest>
3 changes: 2 additions & 1 deletion ReactAndroid/src/androidTest/buck-runner/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<uses-library android:name="android.test.runner" />
<activity
android:name="com.facebook.react.testing.ReactAppTestActivity"
android:theme="@style/Theme.ReactNative.AppCompat.Light.NoActionBar.FullScreen">
android:theme="@style/Theme.ReactNative.AppCompat.Light.NoActionBar.FullScreen"
android:exported="false">
</activity>
</application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
*
* IMPORTANT: In order for developer support to work correctly it is required that the
* manifest of your application contain the following entries:
* {@code <activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>}
* {@code <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>}
* {@code <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>}
*/
public final class BridgeDevSupportManager extends DevSupportManagerBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ReactPluginTest {
project.plugins.apply("com.android.application")
project.plugins.apply("com.facebook.react")

project.extensions.getByType(AppExtension::class.java).apply { compileSdkVersion(30) }
project.extensions.getByType(AppExtension::class.java).apply { compileSdkVersion(31) }
project.extensions.getByType(ReactExtension::class.java).apply {
applyAppPlugin.set(true)
cliPath.set(".")
Expand All @@ -36,7 +36,7 @@ class ReactPluginTest {
project.plugins.apply("com.android.application")
project.plugins.apply("com.facebook.react")

project.extensions.getByType(AppExtension::class.java).apply { compileSdkVersion(30) }
project.extensions.getByType(AppExtension::class.java).apply { compileSdkVersion(31) }
project.extensions.getByType(ReactExtension::class.java).apply { applyAppPlugin.set(false) }

assertTrue(project.getTasksByName("bundleDebugJsAndAssets", false).isEmpty())
Expand All @@ -48,7 +48,7 @@ class ReactPluginTest {
project.plugins.apply("com.android.application")
project.plugins.apply("com.facebook.react")

project.extensions.getByType(AppExtension::class.java).apply { compileSdkVersion(30) }
project.extensions.getByType(AppExtension::class.java).apply { compileSdkVersion(31) }
project.extensions.getByType(ReactExtension::class.java).apply { applyAppPlugin.set(false) }

assertTrue(project.getTasksByName("buildCodegenCLI", false).isNotEmpty())
Expand Down
4 changes: 2 additions & 2 deletions packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def reactNativeArchitectures() {
}

android {
compileSdkVersion 29
compileSdkVersion 31
if (project.hasProperty("ANDROID_NDK_VERSION")) {
ndkVersion project.property("ANDROID_NDK_VERSION")
}
Expand All @@ -165,7 +165,7 @@ android {
defaultConfig {
applicationId "com.facebook.react.uiapp"
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 31
versionCode 1
versionName "1.0"
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
Expand Down
5 changes: 3 additions & 2 deletions packages/rn-tester/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
android:label="@string/app_name"
android:screenOrientation="fullSensor"
android:launchMode="singleTask"
android:configChanges="orientation|screenSize|uiMode" >
android:configChanges="orientation|screenSize|uiMode"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand All @@ -51,7 +52,7 @@
<data android:scheme="rntester" android:host="example" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
<provider
android:name="com.facebook.react.modules.blob.BlobProvider"
android:authorities="@string/blob_provider_authority"
Expand Down
4 changes: 2 additions & 2 deletions scripts/.tests.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
# Android SDK Build Tools revision
export ANDROID_SDK_BUILD_TOOLS_REVISION=30.0.2
# Android API Level we build with
export ANDROID_SDK_BUILD_API_LEVEL="28"
export ANDROID_SDK_BUILD_API_LEVEL="31"
# Google APIs for Android level
export ANDROID_GOOGLE_API_LEVEL="23"
# Minimum Android API SDK Level we target
export ANDROID_SDK_MINIMUM_API_LEVEL="21"
# Target API SDK level to build for
export ANDROID_SDK_TARGET_API_LEVEL="29"
export ANDROID_SDK_TARGET_API_LEVEL="31"
# Android Image SDK level to install on the emulator
export ANDROID_SYSTEM_IMAGE_API_LEVEL="21"

Expand Down
2 changes: 1 addition & 1 deletion template/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
</manifest>
3 changes: 2 additions & 1 deletion template/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
4 changes: 2 additions & 2 deletions template/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
}
repositories {
Expand Down

0 comments on commit 9fc0027

Please sign in to comment.