Skip to content

Commit 4c1845a

Browse files
expo prebuild clean
1 parent 445ce9c commit 4c1845a

File tree

21 files changed

+196
-196
lines changed

21 files changed

+196
-196
lines changed

demos/react-native-supabase-todolist/android/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ build/
1010
local.properties
1111
*.iml
1212
*.hprof
13+
.cxx/
1314

1415
# Bundle artifacts
1516
*.jsbundle

demos/react-native-supabase-todolist/android/app/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ android {
9090
targetSdkVersion rootProject.ext.targetSdkVersion
9191
versionCode 1
9292
versionName "1.0.0"
93-
94-
buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())
9593
}
9694
signingConfigs {
9795
debug {
@@ -114,6 +112,11 @@ android {
114112
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
115113
}
116114
}
115+
packagingOptions {
116+
jniLibs {
117+
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
118+
}
119+
}
117120
}
118121

119122
// Apply static values from `gradle.properties` to the `android.packagingOptions`
@@ -158,8 +161,6 @@ dependencies {
158161
}
159162
}
160163

161-
implementation("com.facebook.react:flipper-integration")
162-
163164
if (hermesEnabled.toBoolean()) {
164165
implementation("com.facebook.react:hermes-android")
165166
} else {

demos/react-native-supabase-todolist/android/app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
</intent>
1515
</queries>
1616
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme">
17-
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
18-
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="50.0.0"/>
17+
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
18+
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="51.0.0"/>
1919
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
2020
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
21+
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://u.expo.dev/foo"/>
2122
<activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
2223
<intent-filter>
2324
<action android:name="android.intent.action.MAIN"/>
@@ -29,6 +30,7 @@
2930
<category android:name="android.intent.category.BROWSABLE"/>
3031
<data android:scheme="powersync"/>
3132
<data android:scheme="com.powersync.example"/>
33+
<data android:scheme="exp+powersync-example"/>
3234
</intent-filter>
3335
</activity>
3436
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>

demos/react-native-supabase-todolist/android/app/src/main/java/com/powersync/example/MainApplication.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ package com.powersync.example
22

33
import android.app.Application
44
import android.content.res.Configuration
5-
import androidx.annotation.NonNull
65

76
import com.facebook.react.PackageList
87
import com.facebook.react.ReactApplication
98
import com.facebook.react.ReactNativeHost
109
import com.facebook.react.ReactPackage
1110
import com.facebook.react.ReactHost
12-
import com.facebook.react.config.ReactFeatureFlags
1311
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
14-
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1512
import com.facebook.react.defaults.DefaultReactNativeHost
16-
import com.facebook.react.flipper.ReactNativeFlipper
1713
import com.facebook.soloader.SoLoader
1814

1915
import expo.modules.ApplicationLifecycleDispatcher
@@ -40,21 +36,15 @@ class MainApplication : Application(), ReactApplication {
4036
)
4137

4238
override val reactHost: ReactHost
43-
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
39+
get() = ReactNativeHostWrapper.createReactHost(applicationContext, reactNativeHost)
4440

4541
override fun onCreate() {
4642
super.onCreate()
4743
SoLoader.init(this, false)
48-
if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {
49-
ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false
50-
}
5144
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
5245
// If you opted-in for the New Architecture, we load the native entry point for this app.
5346
load()
5447
}
55-
// if (BuildConfig.DEBUG) {
56-
// ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
57-
// }
5848
ApplicationLifecycleDispatcher.onApplicationCreate(this)
5949
}
6050

demos/react-native-supabase-todolist/android/app/src/main/res/drawable/rn_edit_text_material.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
1818
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
1919
android:insetTop="@dimen/abc_edit_text_inset_top_material"
20-
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
20+
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
21+
>
2122

2223
<selector>
2324
<!--

demos/react-native-supabase-todolist/android/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ buildscript {
66
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
77
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
88
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
9-
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.8.10'
9+
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.23'
1010

11-
ndkVersion = "25.1.8937393"
11+
ndkVersion = "26.1.10909125"
1212
}
1313
repositories {
1414
google()
1515
mavenCentral()
1616
}
1717
dependencies {
18-
classpath('com.android.tools.build:gradle:8.2.2')
18+
classpath('com.android.tools.build:gradle')
1919
classpath('com.facebook.react:react-native-gradle-plugin')
20+
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
2021
}
2122
}
2223

demos/react-native-supabase-todolist/android/gradle.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,8 @@ expo.webp.animated=false
5151

5252
# Enable network inspector
5353
EX_DEV_CLIENT_NETWORK_INSPECTOR=true
54+
55+
# Use legacy packaging to compress native libraries in the resulting APK.
56+
expo.useLegacyPackaging=false
57+
58+
android.extraMavenRepos=[]
Binary file not shown.

demos/react-native-supabase-todolist/android/gradlew.bat

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -42,11 +43,11 @@ set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
4344
if %ERRORLEVEL% equ 0 goto execute
4445

45-
echo.
46-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47-
echo.
48-
echo Please set the JAVA_HOME variable in your environment to match the
49-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5051

5152
goto fail
5253

@@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5657

5758
if exist "%JAVA_EXE%" goto execute
5859

59-
echo.
60-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61-
echo.
62-
echo Please set the JAVA_HOME variable in your environment to match the
63-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6465

6566
goto fail
6667

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,47 @@
1-
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), 'scripts/autolinking')
2-
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`),
3-
'scripts/react_native_pods')
1+
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
2+
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
43

54
require 'json'
6-
podfile_properties = begin
7-
JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json')))
8-
rescue StandardError
9-
{}
10-
end
5+
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
116

127
ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
138
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
149

1510
platform :ios, podfile_properties['ios.deploymentTarget'] || '13.4'
1611
install! 'cocoapods',
17-
deterministic_uuids: false
12+
:deterministic_uuids => false
1813

1914
prepare_react_native_project!
2015

2116
target 'powersyncexample' do
2217
use_expo_modules!
2318
config = use_native_modules!
2419

25-
use_frameworks! linkage: podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
26-
use_frameworks! linkage: ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
20+
use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
21+
use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
2722

2823
use_react_native!(
29-
path: config[:reactNativePath],
30-
hermes_enabled: podfile_properties['expo.jsEngine'].nil? || podfile_properties['expo.jsEngine'] == 'hermes',
24+
:path => config[:reactNativePath],
25+
:hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
3126
# An absolute path to your application root.
32-
app_path: "#{Pod::Config.instance.installation_root}/.."
33-
# Note that if you have use_frameworks! enabled, Flipper will not work if enabled
27+
:app_path => "#{Pod::Config.instance.installation_root}/..",
28+
# Temporarily disable privacy file aggregation by default, until React
29+
# Native 0.74.2 is released with fixes.
30+
:privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] == 'true',
3431
)
3532

3633
post_install do |installer|
3734
react_native_post_install(
3835
installer,
3936
config[:reactNativePath],
40-
mac_catalyst_enabled: false
37+
:mac_catalyst_enabled => false,
38+
:ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true',
4139
)
4240

4341
# This is necessary for Xcode 14, because it signs resource bundles by default
4442
# when building for devices.
4543
installer.target_installation_results.pod_target_installation_results
46-
.each do |_pod_name, target_installation_result|
44+
.each do |pod_name, target_installation_result|
4745
target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
4846
resource_bundle_target.build_configurations.each do |config|
4947
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
@@ -53,8 +51,10 @@ target 'powersyncexample' do
5351
end
5452

5553
post_integrate do |installer|
56-
expo_patch_react_imports!(installer)
57-
rescue StandardError => e
58-
Pod::UI.warn e
54+
begin
55+
expo_patch_react_imports!(installer)
56+
rescue => e
57+
Pod::UI.warn e
58+
end
5959
end
6060
end

0 commit comments

Comments
 (0)