Skip to content

Commit e2dc035

Browse files
authored
Merge pull request zingolabs#770 from dorianvp/bump_rn_0.74.0
Bump react-native to 0.74.0
2 parents 5fede0d + 9a9e30c commit e2dc035

File tree

35 files changed

+317
-600
lines changed

35 files changed

+317
-600
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23+
**/.xcode.env.local
2324

2425
# Exclude compiled libs
2526
android/app/src/main/jniLibs
@@ -76,7 +77,7 @@ buck-out/
7677
*.jsbundle
7778

7879
# CocoaPods
79-
/ios/Pods/
80+
**/Pods/
8081
/ios/Podfile.lock
8182

8283
# e2e test logs

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ ruby ">= 2.6.10"
66
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
77
# bound in the template on Cocoapods with next React Native release.
88
gem 'cocoapods', '>= 1.13', '< 1.15'
9-
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
10-
gem 'xcodeproj', '< 1.26.0'
9+
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Simple mock for Camera
2+
export const Camera = () => null;
3+
4+
// Mock that returns a mocked camera object
5+
export const useCameraDevice = jest.fn(() => ({
6+
id: 'mocked-camera',
7+
name: 'Mock Camera',
8+
position: 'back',
9+
}));
10+
11+
// Mock that returns permission status and a request function
12+
export const useCameraPermission = jest.fn(() => ({
13+
hasPermission: true,
14+
requestPermission: jest.fn(),
15+
}));
16+
17+
// Mock that provides a mocked scanner function
18+
export const useCodeScanner = jest.fn(() => ({
19+
codeTypes: ['qr', 'ean-13'],
20+
onCodeScanned: jest.fn(),
21+
}));

__tests__/__snapshots__/Scanner.snapshot.tsx.snap

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ exports[`Component Scanner - test Scanner - snapshot 1`] = `
88
"width": "100%",
99
}
1010
}
11-
>
12-
<mockQRCodeScanner />
13-
</RCTSafeAreaView>
11+
/>
1412
`;

android/app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ android {
109109
targetSdkVersion rootProject.ext.targetSdkVersion
110110
versionCode 218 // Real
111111
versionName "zingo-1.11.0" // Real
112-
missingDimensionStrategy 'react-native-camera', 'general'
113112
testBuildType System.getProperty('testBuildType', 'debug')
114113
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
115114
}
@@ -225,7 +224,6 @@ android.applicationVariants.configureEach { variant ->
225224
dependencies {
226225
// The version of react-native is set by the React Native Gradle Plugin
227226
implementation("com.facebook.react:react-android")
228-
implementation("com.facebook.react:flipper-integration")
229227

230228
androidTestImplementation('com.wix:detox:20.27.2')
231229
implementation 'androidx.appcompat:appcompat:1.7.0'
@@ -258,7 +256,8 @@ dependencies {
258256
implementation "androidx.work:work-rxjava2:$work_version"
259257

260258
// optional - GCMNetworkManager support
261-
implementation "androidx.work:work-gcm:$work_version"
259+
// GCM is deprecated
260+
//implementation "androidx.work:work-gcm:$work_version"
262261

263262
// optional - Test helpers
264263
androidTestImplementation "androidx.work:work-testing:$work_version"

android/app/src/debug/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
xmlns:tools="http://schemas.android.com/tools">
33

44
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
5+
<uses-permission android:name="android.permission.CAMERA"
6+
tools:ignore="PermissionImpliesUnsupportedChromeOsHardware" />
57

68
<application
79
android:usesCleartextTraffic="false"
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.ZingoLabs.Zingo
22

33
import android.app.Application
4+
import android.content.Context
45
import com.facebook.react.PackageList
56
import com.facebook.react.ReactApplication
67
import com.facebook.react.ReactHost
@@ -10,39 +11,39 @@ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1011
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1112
import com.facebook.react.defaults.DefaultReactNativeHost
1213
import com.facebook.soloader.SoLoader
13-
import android.content.Context
1414
import java.lang.ref.WeakReference
1515

1616
class MainApplication : Application(), ReactApplication {
1717

1818
override val reactNativeHost: ReactNativeHost =
19-
object : DefaultReactNativeHost(this) {
20-
override fun getPackages(): List<ReactPackage> =
21-
PackageList(this).packages.apply {
22-
// Packages that cannot be autolinked yet can be added manually here, for example:
23-
// add(MyReactNativePackage())
24-
add(RPCPackage())
19+
object : DefaultReactNativeHost(this) {
20+
override fun getPackages(): List<ReactPackage> =
21+
PackageList(this).packages.apply {
22+
// Packages that cannot be autolinked yet can be added manually here,
23+
// for example:
24+
// add(MyReactNativePackage())
25+
add(RPCPackage())
26+
}
27+
28+
override fun getJSMainModuleName(): String = "index"
29+
30+
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
31+
32+
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
33+
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
2534
}
26-
27-
override fun getJSMainModuleName(): String = "index"
28-
29-
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
30-
31-
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
32-
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
33-
}
34-
35+
3536
override val reactHost: ReactHost
36-
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
37-
37+
get() = getDefaultReactHost(applicationContext, reactNativeHost)
38+
3839
override fun onCreate() {
3940
super.onCreate()
4041
context = WeakReference(applicationContext)
4142

42-
4343
SoLoader.init(this, false)
4444
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
45-
// If you opted-in for the New Architecture, we load the native entry point for this app.
45+
// If you opted-in for the New Architecture, we load the native entry point for this
46+
// app.
4647
load()
4748
}
4849
}
@@ -58,4 +59,3 @@ class MainApplication : Application(), ReactApplication {
5859
}
5960
}
6061
}
61-

android/build.gradle

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ buildscript {
66
minSdkVersion = 24
77
compileSdkVersion = 34
88
targetSdkVersion = 34
9-
ndkVersion = "24.0.8215888"
10-
kotlinVersion = '1.8.22'
9+
ndkVersion = "26.1.10909125"
10+
kotlinVersion = "1.9.22"
1111
}
1212
repositories {
1313
google()
@@ -16,7 +16,7 @@ buildscript {
1616
dependencies {
1717
classpath('com.android.tools.build:gradle:8.3.2')
1818
classpath("com.facebook.react:react-native-gradle-plugin")
19-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin"
19+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
2020
}
2121
}
2222

@@ -31,18 +31,4 @@ allprojects {
3131
maven { url 'https://www.jitpack.io' }
3232
}
3333
}
34-
35-
// this is not the best solution, but while the libraries have no namespace...
36-
// https://discuss.gradle.org/t/namespace-not-specified-for-agp-8-0-0/45850/5
37-
38-
//subprojects {
39-
// afterEvaluate { project ->
40-
// if (project.hasProperty('android')) {
41-
// project.android {
42-
// if (namespace == null) {
43-
// namespace project.group
44-
// }
45-
// }
46-
// }
47-
// }
48-
//}
34+

android/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ hermesEnabled=true
4444
android.defaults.buildfeatures.buildconfig=true
4545
android.nonTransitiveRClass=false
4646
android.nonFinalResIds=false
47+
48+
VisionCamera_enableCodeScanner=true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Fri Jan 24 19:05:10 MST 2025
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
55
networkTimeout=10000
66
zipStoreBase=GRADLE_USER_HOME
77
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)