Builds failing on SDK44 for ios

HI All,

I’ve got a managed app, which I’ve previously not had any issues with, even building and submitting. I recent upgraded to SDK 44, and now the build fails for both IOS and Android. I’m getting this error for ios:

[!] The following Swift pods cannot yet be integrated as static libraries:
The Swift pod `ExpoAdapterBranch` depends upon `react-native-branch`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
[stderr] [!] `<PBXResourcesBuildPhase UUID=`13B07F8E1A680F5B00A75B9A`>` attempted to initialize an object with an unknown UUID. `57AF3556EB6D47FFA9F80AB6` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
pod exited with non-zero code: 1

And for Android this is the error:

[stderr] Note: Some input files use unchecked or unsafe operations.
[stderr] Note: Recompile with -Xlint:unchecked for details.
> Task :react-native-branch:compileReleaseJavaWithJavac
> Task :react-native-branch:bundleLibCompileToJarRelease
[stderr] Note: /home/expo/workingdir/build/node_modules/react-native-branch/android/src/main/java/io/branch/rnbranch/RNBranchModule.java uses or overrides a deprecated API.
[stderr] Note: Recompile with -Xlint:deprecation for details.
[stderr] Note: /home/expo/workingdir/build/node_modules/react-native-branch/android/src/main/java/io/branch/rnbranch/AgingHash.java uses unchecked or unsafe operations.
[stderr] Note: Recompile with -Xlint:unchecked for details.
> Task :config-plugins-react-native-branch:compileReleaseKotlin FAILED
[stderr] e: /home/expo/workingdir/build/node_modules/@config-plugins/react-native-branch/android/src/main/java/expo/modules/adapters/branch/BranchReactActivityLifecycleListener.kt: (16, 5): 'onNewIntent' overrides nothing
[stderr] e: /home/expo/workingdir/build/node_modules/@config-plugins/react-native-branch/android/src/main/java/expo/modules/adapters/branch/BranchReactActivityLifecycleListener.kt: (20, 22): Unresolved reference: onNewIntent
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':config-plugins-react-native-branch:compileReleaseKotlin'.
[stderr] > Compilation error. See log for more details
[stderr] * Try:
[stderr] Run with
[stderr] --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 7m 13s

I have tried deleting my node modules and removing any lock files, and reinstalling everything again - but it seems that nothing works. Am I missing something with EAS and the SDK44 upgrade?

Since that PR has been merged it seems that a better place to direct @fairtasting to would be the following:

@fairtasting, could you give the above config plugin a try instead of using expo-branch?

So I actually went ahead and just remove my entire branch configuration, as I had only recently starting testing it, yet the issues remain. I’m starting to think it is more in the area of the modules with react-native-unimodules being replaced by expo. So I tried downgrading to SDK43 and build again it failed. I’ve not removed react-native-unimodules from packages.json and run the expo prebuild, as recommended in fyi/expo-modules-migration.md at main · expo/fyi · GitHub but the build still fails on andriod - IOS is now working:

Andriod:

[stderr]   void askForPermissionsWithPromise(final Promise promise, String... permissions);
[stderr]                                           ^
[stderr]   symbol:   class Promise
[stderr]   location: interface org.unimodules.interfaces.permissions.Permissions
[stderr] 5 errors
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
630 actionable tasks: 630 executed
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':unimodules-permissions-interface:compileReleaseJavaWithJavac'.
[stderr] > Compilation failed; see the compiler error output for details.
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Any help in getting Android working again would be much appreciated.

Yeah when I got my android build working I will try it out.

In a newly created Expo app there is no react-native-unimodules dependency.

In an Expo SDK 42 app, if you run “expo prebuild” or “expo run:android” (or ios) then it will generate the native android/ios directories and add a few dependencies:

@@ -14,13 +13,21 @@
     "expo-status-bar": "~1.0.4",
     "react": "16.13.1",
     "react-dom": "16.13.1",
-    "react-native": "https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz",
-    "react-native-web": "~0.13.12"
+    "react-native": "~0.63.4",
+    "react-native-web": "~0.13.12",
+    "expo-splash-screen": "~0.11.2",
+    "expo-updates": "~0.8.1",
+    "react-native-gesture-handler": "~1.10.2",
+    "react-native-reanimated": "~2.2.0",
+    "react-native-screens": "~3.4.0",
+    "react-native-unimodules": "0.14.10"
   },
   "devDependencies": {
     "@babel/core": "^7.9.0",

Because of the android/ios directories, the app is now a “bare” app.

If you do the same in an SDK 44 app, the only new dependency that is added is expo-screen-saver:

@@ -17,7 +16,8 @@
     "react": "17.0.1",
     "react-dom": "17.0.1",
     "react-native": "0.64.3",
-    "react-native-web": "0.17.1"
+    "react-native-web": "0.17.1",
+    "expo-splash-screen": "~0.14.1"
   },
   "devDependencies": {
     "@babel/core": "^7.12.9"

So, given that you have react-native-unimodules installed I suspect you have run expo run:*.

I don’t like the fact that expo run:* switches your app to the bare workflow as a side effect, so I generally avoid it. If I do use it, I revert all of the changes it makes and do not commit them.

I would recommend that you do the following:

  • Create a new Expo app and compare the dependencies with your app. Then remove any dependencies from your app that you don’t need. In particular react-native-unimodules.
  • If you have android or ios directories, and you are expecting to be on the managed workflow, delete them.
  • Avoid using expo run:*, or else make sure to clean up afterwards.