Skip to content

Commit 86853c6

Browse files
Merge pull request #226 from mendix/min-build-fix
[MOO-2309] - MiN build fix
2 parents f0d3d12 + 8ff78b7 commit 86853c6

11 files changed

Lines changed: 314 additions & 301 deletions

File tree

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
package com.mendix.developerapp
22

3-
import android.content.Context
43
import com.facebook.react.PackageList
5-
import com.facebook.react.ReactInstanceManager
64
import com.facebook.react.ReactPackage
75
import com.mendix.developerapp.utilities.CrashlyticsErrorHandler
86
import com.mendix.mendixnative.MendixReactApplication
97
import com.mendix.mendixnative.error.ErrorHandler
10-
import java.lang.reflect.InvocationTargetException
118

129
@Suppress("unused")
1310
open class BaseApplication : MendixReactApplication() {
1411

15-
override fun onCreate() {
16-
super.onCreate()
17-
if(reactNativeHost.hasInstance()) {
18-
initializeFlipper(this, reactNativeHost.reactInstanceManager)
19-
}
20-
}
21-
2212
override fun getPackages(): List<ReactPackage> {
2313
val packages: MutableList<ReactPackage> = PackageList(this).packages
2414

@@ -32,32 +22,4 @@ open class BaseApplication : MendixReactApplication() {
3222
override fun createErrorHandler(): ErrorHandler {
3323
return CrashlyticsErrorHandler(this)
3424
}
35-
36-
private fun initializeFlipper(context: Context, reactInstanceManager: ReactInstanceManager) {
37-
if (BuildConfig.DEBUG) {
38-
try {
39-
/*
40-
* We use reflection here to pick up the class that initializes Flipper, since
41-
* Flipper library is not available in release mode
42-
*/
43-
val aClass = Class.forName("com.mendix.developerapp.flipper.ReactNativeFlipper")
44-
aClass.getMethod(
45-
"initializeFlipper",
46-
Context::class.java,
47-
ReactInstanceManager::class.java
48-
).invoke(
49-
null, context,
50-
reactInstanceManager
51-
)
52-
} catch (e: ClassNotFoundException) {
53-
e.printStackTrace()
54-
} catch (e: NoSuchMethodException) {
55-
e.printStackTrace()
56-
} catch (e: IllegalAccessException) {
57-
e.printStackTrace()
58-
} catch (e: InvocationTargetException) {
59-
e.printStackTrace()
60-
}
61-
}
62-
}
6325
}

android/app/src/main/java/com/mendix/developerapp/utilities/CrashlyticsErrorHandler.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import com.mendix.mendixnative.error.ErrorType
1212

1313
class CrashlyticsErrorHandler(val context: Context) : ErrorHandler {
1414
override fun handleError(title: String?, stack: Array<out StackFrame>?, type: ErrorType) {
15+
val crashlyticsStack = stack?.let { source -> Array(source.size) { index -> source[index] } } ?: emptyArray()
1516
FirebaseCrashlytics.getInstance().setCustomKey("Error type", type.name)
16-
FirebaseCrashlytics.getInstance().log(StackTraceHelper.formatStackTrace(title, stack!!))
17+
FirebaseCrashlytics.getInstance().log(StackTraceHelper.formatStackTrace(title, crashlyticsStack))
1718
(if (type === ErrorType.NATIVE) Exception(title) else title?.let {
1819
JavascriptException(
1920
it
@@ -23,7 +24,7 @@ class CrashlyticsErrorHandler(val context: Context) : ErrorHandler {
2324
Bundle().let {
2425
it.putString("title", title)
2526
it.putString("type", type.name)
26-
it.putString("stack_frame", StackTraceHelper.formatStackTrace(title, stack))
27+
it.putString("stack_frame", StackTraceHelper.formatStackTrace(title, crashlyticsStack))
2728
FirebaseAnalytics.getInstance(context).logEvent("red_box", it)
2829
}
2930
}

android/app/src/production/java/com/mendix/developerapp/loading/ProjectLoaderViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class ProjectLoaderViewModel : ViewModel() {
185185
}
186186
}
187187

188-
override fun onFailure(cause: Exception?) {
188+
override fun onFailure(cause: Exception) {
189189
setStatus(STATUS_ERROR_BUNDLE)
190190
}
191191
}

android/app/src/production/java/com/mendix/developerapp/mendixapp/MendixProjectFragment.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ class MendixProjectFragment : MendixProjectFragmentBase() {
2020
super.onCreate(savedInstanceState)
2121

2222
// Setting up our download listener
23-
reactNativeHost.reactInstanceManager.devSupportManager.apply {
24-
setBundleDownloadListener(this, viewModel.devServerCallback)
25-
}
23+
setBundleDownloadListener(reactHost?.devSupportManager, viewModel.devServerCallback)
2624

2725
// This now uses built-in RN mechanism to show bundling progress.
2826
DefaultDevLoadingViewImplementation.setDevLoadingEnabled(true);

android/build.gradle

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,6 @@ allprojects {
7171
// Uncomment the following line if Windows fails due to long paths
7272
// buildDir = c:/temp/${rootProject.name}/${project.name}
7373
repositories {
74-
all { ArtifactRepository repo ->
75-
if (repo.url.toString().contains("jcenter.bintray.com")) {
76-
remove repo
77-
mavenCentral()
78-
}
79-
}
80-
google()
81-
maven { url 'https://jitpack.io' }
8274
maven {
8375
url "$rootDir/../node_modules/@notifee/react-native/android/libs"
8476
}

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
77
validateDistributionUrl=true
88
networkTimeout=10000

ios/DeveloperApp/Info.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@
6767
<string>To use that feature the app needs access to your media library.</string>
6868
<key>NSBluetoothAlwaysUsageDescription</key>
6969
<string>${BLUETOOTH_USAGE_DESCRIPTION}</string>
70-
<key>NSBluetoothPeripheralUsageDescription</key>
71-
<string>${BLUETOOTH_USAGE_DESCRIPTION}</string>
7270
<key>NSCalendarsUsageDescription</key>
7371
<string>${CALENDARS_USAGE_DESCRIPTION}</string>
7472
<key>NSCameraUsageDescription</key>

ios/Podfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ target 'DeveloperApp' do
4848
:fabric_enabled => true,
4949
:app_path => "#{Pod::Config.instance.installation_root}/.."
5050
)
51-
pod 'react-native-ble-plx', :path => '../node_modules/react-native-ble-plx'
5251
pod 'react-native-google-maps', :path => '../node_modules/react-native-maps'
5352
pod 'GoogleMaps'
5453
pod 'Google-Maps-iOS-Utils'

ios/Podfile.lock

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ PODS:
202202
- SocketRocket
203203
- SSZipArchive
204204
- Yoga
205-
- MultiplatformBleAdapter (0.1.9)
205+
- MultiplatformBleAdapter (0.2.0)
206206
- nanopb (2.30910.0):
207207
- nanopb/decode (= 2.30910.0)
208208
- nanopb/encode (= 2.30910.0)
@@ -2126,9 +2126,35 @@ PODS:
21262126
- React-RCTFBReactNativeSpec
21272127
- ReactCommon/turbomodule/core
21282128
- SocketRocket
2129-
- react-native-ble-plx (2.0.3):
2130-
- MultiplatformBleAdapter (= 0.1.9)
2129+
- react-native-ble-plx (3.5.1):
2130+
- boost
2131+
- DoubleConversion
2132+
- fast_float
2133+
- fmt
2134+
- glog
2135+
- hermes-engine
2136+
- MultiplatformBleAdapter (= 0.2.0)
2137+
- RCT-Folly
2138+
- RCT-Folly/Fabric
2139+
- RCTRequired
2140+
- RCTTypeSafety
21312141
- React-Core
2142+
- React-debug
2143+
- React-Fabric
2144+
- React-featureflags
2145+
- React-graphics
2146+
- React-ImageManager
2147+
- React-jsi
2148+
- React-NativeModulesApple
2149+
- React-RCTFabric
2150+
- React-renderercss
2151+
- React-rendererdebug
2152+
- React-utils
2153+
- ReactCodegen
2154+
- ReactCommon/turbomodule/bridging
2155+
- ReactCommon/turbomodule/core
2156+
- SocketRocket
2157+
- Yoga
21322158
- react-native-blob-util (0.24.7):
21332159
- boost
21342160
- DoubleConversion
@@ -4214,11 +4240,11 @@ SPEC CHECKSUMS:
42144240
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
42154241
GoogleMaps: 8939898920281c649150e0af74aa291c60f2e77d
42164242
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
4217-
hermes-engine: 9909ca521b44677f3244c0ddbe64a261fbc506d7
4243+
hermes-engine: d6436b1abe54ecbd1c6f6b72cfe18ebefa2bb3e3
42184244
IQKeyboardManager: c8665b3396bd0b79402b4c573eac345a31c7d485
42194245
libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8
42204246
MendixNative: 91822aad01e73d9afe13953415824bd451b809d9
4221-
MultiplatformBleAdapter: 5a6a897b006764392f9cef785e4360f54fb9477d
4247+
MultiplatformBleAdapter: b1fddd0d499b96b607e00f0faa8e60648343dc1d
42224248
nanopb: 438bc412db1928dac798aa6fd75726007be04262
42234249
op-sqlite: 64000c0da2357c4d73faf4d23ff34dd1ddb332d4
42244250
OpenSSL-Universal: 9110d21982bb7e8b22a962b6db56a8aa805afde7
@@ -4261,7 +4287,7 @@ SPEC CHECKSUMS:
42614287
React-logger: 993e4b9793768764e0fdd379ad1d6582f7905463
42624288
React-Mapbuffer: 3a5f700ed673820ab4b1b35ba0cf8476400bc4c5
42634289
React-microtasksnativemodule: 094677e625f12276a8f871844a5ee6a945a90221
4264-
react-native-ble-plx: 2dd8780ee8d34c60399aaa897249ed1860ebef10
4290+
react-native-ble-plx: 152b07bdf772c95e30c0251649d462b5154a0e13
42654291
react-native-blob-util: 6dec9023ecc3ee5ac8ad377598e943f9ca63f741
42664292
react-native-cameraroll: bb98380ee21115d5fe1ae0f8b80c86e044613746
42674293
react-native-file-viewer-turbo: 360bf8416154b6c9de8c8f377fcb60d05e0f9838
@@ -4342,6 +4368,6 @@ SPEC CHECKSUMS:
43424368
VisionCamera: 7187b3dac1ff3071234ead959ce311875748e14f
43434369
Yoga: b669e79fa0f8d3f6f5e35372345f54b99e06b13c
43444370

4345-
PODFILE CHECKSUM: 4055089adb603ffbf3447d2f4b53833e1309be14
4371+
PODFILE CHECKSUM: dfd6edcdfb21607087b6c181b325f90fb96b198d
43464372

43474373
COCOAPODS: 1.16.2

0 commit comments

Comments
 (0)