Skip to content

Commit

Permalink
Fix Android build errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentritter committed Nov 5, 2022
1 parent cc9e8b8 commit 493ac26
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 184 deletions.
25 changes: 21 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,23 @@ android {

}
}
packagingOptions {
pickFirst '**/armeabi-v7a/libfolly_runtime.so'
pickFirst '**/x86/libfolly_runtime.so'
pickFirst '**/arm64-v8a/libfolly_runtime.so'
pickFirst '**/x86_64/libfolly_runtime.so'
}
}

//configurations.all {
// resolutionStrategy.eachDependency { DependencyResolveDetails details ->
// def requested = details.requested
// if (requested.group == 'com.android.support' && requested.name != 'multidex') {
// details.useVersion "${rootProject.ext.supportLibVersion}"
// }
// }
//}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
Expand All @@ -206,19 +221,21 @@ dependencies {
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group: 'com.facebook.flipper'
}

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/"
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
exclude group:'com.facebook.fbjni'
}
} else {
implementation jscFlavor
}

implementation platform('com.google.firebase:firebase-bom:29.0.4')
implementation 'com.google.firebase:firebase-core:16.0.0'
// implementation 'com.android.support:design:25.4.0'
// implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
}

// Run this once to be able to run the application with BUCK
Expand Down
8 changes: 5 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:exported="true">

<meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground" android:value="true"/>
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_notification" />
<meta-data android:name="com.google.firebase.messaging." android:resource="@drawable/ic_notification" />
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color" android:resource="@color/notification"/>
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
Expand All @@ -40,6 +41,7 @@
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -51,7 +53,7 @@
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize" android:theme="@style/AppTheme">
android:windowSoftInputMode="adjustResize" android:theme="@style/AppTheme" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
Expand Down
17 changes: 16 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

buildscript {
ext {
supportLibVersion = "31.0.0"
RNNKotlinVersion = "1.6.0"
buildToolsVersion = "30.0.2"
minSdkVersion = 25
compileSdkVersion = 31
targetSdkVersion = 30
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
}
repositories {
Expand All @@ -24,6 +25,20 @@ buildscript {

allprojects {
repositories {
exclusiveContent {
// We get React Native's Android binaries exclusively through npm,
// from a local Maven repo inside node_modules/react-native/.
// (The use of exclusiveContent prevents looking elsewhere like Maven Central
// and potentially getting a wrong version.)
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
mavenCentral()
mavenLocal()
maven {
Expand Down
8 changes: 8 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
rootProject.name = 'Micro.blog'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')

if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}
21 changes: 8 additions & 13 deletions ios/MicroBlog_RN/AppDelegate.mm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#import "AppDelegate.h"
#import <ReactNativeNavigation/ReactNativeNavigation.h>

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

#import <React/RCTAppSetupUtils.h>

Expand Down Expand Up @@ -34,6 +34,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
RCTAppSetupPrepareApp(application);

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
[ReactNativeNavigation bootstrapWithBridge:bridge];

#if RCT_NEW_ARCH_ENABLED
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
Expand All @@ -43,20 +44,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
#endif

NSDictionary *initProps = [self prepareInitialProps];
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"MicroBlog_RN", initProps);


if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
} else {
rootView.backgroundColor = [UIColor whiteColor];
}


self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}

Expand All @@ -82,6 +73,10 @@ - (NSDictionary *)prepareInitialProps
return initProps;
}

- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
return [ReactNativeNavigation extraModulesForBridge:bridge];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
Expand Down
2 changes: 1 addition & 1 deletion ios/MicroBlog_RN/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<true/>
</dict>
</plist>
12 changes: 6 additions & 6 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,13 @@ PODS:
- React-jsi (= 0.70.4)
- React-logger (= 0.70.4)
- React-perflogger (= 0.70.4)
- ReactNativeNavigation (7.29.1):
- ReactNativeNavigation (7.29.0):
- HMSegmentedControl
- React-Core
- React-RCTImage
- React-RCTText
- ReactNativeNavigation/Core (= 7.29.1)
- ReactNativeNavigation/Core (7.29.1):
- ReactNativeNavigation/Core (= 7.29.0)
- ReactNativeNavigation/Core (7.29.0):
- HMSegmentedControl
- React-Core
- React-RCTImage
Expand Down Expand Up @@ -448,7 +448,7 @@ PODS:
- React-RCTText
- ReactCommon/turbomodule/core
- Yoga
- RNSVG (13.4.0):
- RNSVG (13.5.0):
- React-Core
- SDWebImage (5.11.1):
- SDWebImage/Core (= 5.11.1)
Expand Down Expand Up @@ -723,7 +723,7 @@ SPEC CHECKSUMS:
React-RCTVibration: 0e247407238d3bd6b29d922d7b5de0404359431b
React-runtimeexecutor: 5407e26b5aaafa9b01a08e33653255f8247e7c31
ReactCommon: abf3605a56f98b91671d0d1327addc4ffb87af77
ReactNativeNavigation: f1c5b86f993758d0af2942ba9058a340166bef07
ReactNativeNavigation: 3b09d0b7a64326dbcea7e64231287c766b18adf0
RNCAsyncStorage: 0c357f3156fcb16c8589ede67cc036330b6698ca
RNCClipboard: 2834e1c4af68697089cdd455ee4a4cdd198fa7dd
RNCPushNotificationIOS: 87b8d16d3ede4532745e05b03c42cff33a36cc45
Expand All @@ -732,7 +732,7 @@ SPEC CHECKSUMS:
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNInAppBrowser: e36d6935517101ccba0e875bac8ad7b0cb655364
RNReanimated: b3e54f4501b3b22bacb3acd0e7c34dfd0932d9fc
RNSVG: 07dbd870b0dcdecc99b3a202fa37c8ca163caec2
RNSVG: 38ca962c970dbce1ca38991a5aebf26d163f9efb
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"react-native-image-picker": "^4.6.0",
"react-native-image-viewing": "^0.2.1",
"react-native-inappbrowser-reborn": "^3.7.0",
"react-native-navigation": "^7.22.3",
"react-native-navigation": "7.29.0",
"react-native-navigation-bottom-sheet": "^1.3.0",
"react-native-push-notification": "^8.1.1",
"react-native-reanimated": "2.3.1",
"react-native-reanimated": "^2.9.0",
"react-native-sensitive-info": "^5.5.8",
"react-native-sfsymbols": "^1.2.1",
"react-native-simple-toast": "^1.1.4",
Expand Down

0 comments on commit 493ac26

Please sign in to comment.