[Urgent Pls Help] ERROR building apk with SDK 48

Please provide the following:

  1. SDK Version: 48
  2. Platforms(Android/iOS/web/all): android

i got error when trying to build apk with eas on sdk 48, here the error i got from expo build dashboard :

/home/expo/workingdir/build/android/app/src/main/java/com/wom/appname/MainApplication.java:67: error: cannot find symbol
[stderr] 
    ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
[stderr] 
    ^
[stderr] 
  symbol:   variable ReactNativeFlipper
[stderr] 
  location: class MainApplication
[stderr] 
8 errors

w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
ReactNativeFirebase WARNING: NPM package '@react-native-firebase/analytics' depends on '@react-native-firebase/app' v17.3.2 but found v15.4.0, this might cause build issues or runtime crashes.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

So what im trying to accomplish is based on the report of a message from playstore saying " Must Target api level 33" so thats why i upgraded from 45 to 48 so it can get the latest api level. is there another simpler way to set target api level 33 without having to upgrade to 48? im comfortable with 45 and seems like so many depreciationns found if i upgrade to 48

Hi @womfinance

Based on the error it looks like you have some problems with incompatible versions of some dependencies.

Instead of jumping from Expo SDK 45 to 48, rather go step by step. And deal with any deprecations etc. before moving to the next Expo SDK version.

You could try BuildProperties:

But I would recommend figuring out the issues you’re running into with later SDK versions. Staying on Expo SDK 45 will get harder over time.

there were 8 errors but i manage to find some workaround. now it left with one stopper error which is

cannot find symbol
[stderr] 
    ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());

i cant seems to find the solution, ive search through the internet, the closest thing to a solution is that i have to somehow edit the MainApplication.java but since i used managed workflow i couldnt do that. so it leave me hanging…

another thing is that does BuildProperties work on SDK 45 with managed workflow?

wait, i understand that i have @react-native-firebase/analytics incompatible warning in my terminal and i kinda ignore termporarly, do u think its related to the ReactNativeFlipper error?

I don’t know if it has anything to do with any Flipper errors. But since you say you’re having build problems and the warning says:

it seems like that might be the cause of the build error.

What I would do:

  • Make sure you do not have ios or android directories, unless you intend to be on the Bare workflow.
  • Revert to the version before you started trying to upgrade. Ensure that builds and works correctly.
  • Upgrade to Expo SDK 46. Run npx expo-doctor and fix any issues. Read the blog post and take care of any deprecations. Make sure it builds. Make sure it works correctly.
  • See if there are updates for your non-Expo dependencies. Decide if it’s necessary or desirable to upgrade any of those. If you do upgrade any, verify that the app still builds and works correctly before moving on to the next step.
  • Do the same with Expo SDK 47.
  • Then Expo SDK 48.

If you run into issues on one of these steps, doing something like the following might help:

  • Remove your package-lock.json or yarn.lock and node_modules
  • Reinstall your dependencies with npm install or yarn depending on which you use normally
  • Run npx expo install --fix
  • Run npx expo-doctor to check for any issues

If you still have issues, post the details here.

For stuff like Flipper, I haven’t tried it myself yet, but I think on iOS you might run into issues where some dependency needs to be statically compiled and another needs to be not statically compiled, or something like that. If you run into issues like that you might need to upgrade one of the dependencies. Sorry for being vague. As I said I haven’t tried Flipper yet. This is just my vague memory from seeing posts on the forums.

hey i run expo doctor and i got these :

Expected package expo-modules-autolinking@~1.1.0
Found invalid:
  expo-modules-autolinking@0.8.1
  (for more info, run: npm why expo-modules-autolinking)
Expected package @expo/config-plugins@~6.0.0
Found invalid:
  @expo/config-plugins@5.0.4
  @expo/config-plugins@4.1.5
  @expo/config-plugins@4.1.5
  @expo/config-plugins@4.1.1
  @expo/config-plugins@5.0.4
  @expo/config-plugins@4.1.5
  (for more info, run: npm why @expo/config-plugins)
Expected package @expo/prebuild-config@~6.0.0
Found invalid:
  @expo/prebuild-config@4.0.3
  (for more info, run: npm why @expo/prebuild-config)

I manage to make the build sucessfull by adding these in the package.json :

 "resolutions": {
        "@expo/config-plugins": "^6.0.0",
        "@expo/prebuild-config": "^6.0.0",
        "expo-modules-autolinking": "~1.1.0"
   },

make sure that the version in this config matches with what it says when you run expo-cli doctor or npx expo-doctor

also make sure you dont have expo-modules-autolinking, @expo/config-plugins, @expo/prebuild-config in your package.json dependencies object.

i dont know why is that but it solve the problem, one thing to note before building is that make sure the expo doctor returns “there are no problem” or some sort.

Try npm why expo-modules-autolinking@0.8.1 to see why that version’s being installed. You might need to remove the resolutions to get this to show you the correct info.
(Use npm why ... even if you normally use yarn to manage your dependencies.)

Try running npm why @expo/config-plugins@5.0.4 (and then the other two versions) to see why those versions are being installed.

Try npm why @expo/prebuild-config@4.0.3 to see why that version is being installed.

It looks like you have some potentially out of date dependencies. Setting the resolutions as you did might get it to work, but it would be better to fix the root causes of these warnings if possible.

i tried removinng the resolutions in package.json and running the npm why @expo/prebuild-config@4.0.3 but there is an error

npm ERR! No dependencies found matching @expo/prebuild-config@4.0.3

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/a/.npm/_logs/2023-03-29T03_10_14_802Z-debug-0.log

but when i run npm why @expo/prebuild-config@6.0.0 it returns

@expo/prebuild-config@6.0.0
node_modules/@expo/prebuild-config
  @expo/prebuild-config@"~6.0.0" from the root project
  @expo/prebuild-config@"6.0.0" from expo-splash-screen@0.18.1
  node_modules/expo-splash-screen
    expo-splash-screen@"~0.18.1" from the root project
  @expo/prebuild-config@"6.0.0" from @expo/cli@0.6.2
  node_modules/@expo/cli
    @expo/cli@"0.6.2" from expo@48.0.9
    node_modules/expo
      expo@"~48.0.9" from the root project
      peer expo@"*" from expo-application@5.1.1
      node_modules/expo-application
        expo-application@"~5.1.1" from expo@48.0.9
        expo-application@"~5.1.0" from expo-notifications@0.18.1
        node_modules/expo-notifications
          expo-notifications@"~0.18.1" from the root project
      peer expo@"*" from expo-av@13.2.1
      node_modules/expo-av
        expo-av@"~13.2.1" from the root project
      peer expo@"*" from expo-build-properties@0.5.1
      node_modules/expo-build-properties
        expo-build-properties@"~0.5.1" from the root project
      peer expo@"*" from expo-camera@13.2.1
      node_modules/expo-camera
        expo-camera@"~13.2.1" from the root project
      peer expo@"*" from expo-constants@14.2.1
      node_modules/expo-constants
        expo-constants@"~14.2.1" from expo@48.0.9
        expo-constants@"~14.2.0" from expo-asset@8.9.1
        node_modules/expo-asset
          expo-asset@"~8.9.1" from expo@48.0.9
        expo-constants@"~14.2.0" from expo-linking@4.0.1
        node_modules/expo-linking
          expo-linking@"~4.0.1" from the root project
        expo-constants@"~14.2.0" from expo-notifications@0.18.1
        node_modules/expo-notifications
          expo-notifications@"~0.18.1" from the root project
      peer expo@"*" from expo-crypto@12.2.1
      node_modules/expo-crypto
        expo-crypto@"~12.2.1" from the root project
        expo-crypto@">8.0.0" from react-native-expo-cached-image@1.3.1
        node_modules/react-native-expo-cached-image
          react-native-expo-cached-image@"^1.2.1" from the root project
      peer expo@"*" from expo-dev-menu@2.1.4
      node_modules/expo-dev-menu
        expo-dev-menu@"2.1.4" from expo-dev-launcher@2.1.6
        node_modules/expo-dev-launcher
          expo-dev-launcher@"2.1.6" from expo-dev-client@2.1.6
          node_modules/expo-dev-client
            expo-dev-client@"~2.1.6" from the root project
        expo-dev-menu@"2.1.4" from expo-dev-client@2.1.6
        node_modules/expo-dev-client
          expo-dev-client@"~2.1.6" from the root project
      peer expo@"*" from expo-dev-launcher@2.1.6
      node_modules/expo-dev-launcher
        expo-dev-launcher@"2.1.6" from expo-dev-client@2.1.6
        node_modules/expo-dev-client
          expo-dev-client@"~2.1.6" from the root project
      peer expo@"*" from expo-device@5.2.1
      node_modules/expo-device
        expo-device@"~5.2.1" from the root project
      peer expo@"*" from expo-dev-client@2.1.6
      node_modules/expo-dev-client
        expo-dev-client@"~2.1.6" from the root project
      peer expo@"*" from expo-face-detector@12.1.1
      node_modules/expo-face-detector
        expo-face-detector@"~12.1.1" from the root project
      peer expo@"*" from expo-firebase-analytics@7.2.0
      node_modules/expo-firebase-analytics
        expo-firebase-analytics@"~7.2.0" from the root project
      peer expo@"*" from expo-font@11.1.1
      node_modules/expo-font
        expo-font@"~11.1.1" from the root project
        expo-font@"~11.1.1" from expo@48.0.9
      peer expo@"*" from expo-image-manipulator@11.1.1
      node_modules/expo-image-manipulator
        expo-image-manipulator@"~11.1.1" from the root project
      peer expo@"*" from expo-dev-menu-interface@1.1.1
      node_modules/expo-dev-menu-interface
        expo-dev-menu-interface@"1.1.1" from expo-dev-menu@2.1.4
        node_modules/expo-dev-menu
          expo-dev-menu@"2.1.4" from expo-dev-launcher@2.1.6
          node_modules/expo-dev-launcher
            expo-dev-launcher@"2.1.6" from expo-dev-client@2.1.6
            node_modules/expo-dev-client
              expo-dev-client@"~2.1.6" from the root project
          expo-dev-menu@"2.1.4" from expo-dev-client@2.1.6
          node_modules/expo-dev-client
            expo-dev-client@"~2.1.6" from the root project
        expo-dev-menu-interface@"1.1.1" from expo-dev-client@2.1.6
        node_modules/expo-dev-client
          expo-dev-client@"~2.1.6" from the root project
      peer expo@"*" from expo-file-system@15.2.2
      node_modules/expo-file-system
        expo-file-system@"~15.2.2" from expo@48.0.9
        expo-file-system@"~15.2.0" from expo-asset@8.9.1
        node_modules/expo-asset
          expo-asset@"~8.9.1" from expo@48.0.9
        expo-file-system@">8.0.0" from react-native-expo-cached-image@1.3.1
        node_modules/react-native-expo-cached-image
          react-native-expo-cached-image@"^1.2.1" from the root project
      peer expo@"*" from expo-image-picker@14.1.1
      node_modules/expo-image-picker
        expo-image-picker@"~14.1.1" from the root project
      peer expo@"*" from expo-image-loader@4.1.1
      node_modules/expo-image-loader
        expo-image-loader@"~4.1.0" from expo-image-manipulator@11.1.1
        node_modules/expo-image-manipulator
          expo-image-manipulator@"~11.1.1" from the root project
        expo-image-loader@"~4.1.0" from expo-image-picker@14.1.1
        node_modules/expo-image-picker
          expo-image-picker@"~14.1.1" from the root project
      peer expo@"*" from expo-intent-launcher@10.5.2
      node_modules/expo-intent-launcher
        expo-intent-launcher@"~10.5.2" from the root project
      peer expo@"*" from expo-local-authentication@13.2.1
      node_modules/expo-local-authentication
        expo-local-authentication@"~13.2.1" from the root project
      peer expo@"*" from expo-location@15.1.1
      node_modules/expo-location
        expo-location@"~15.1.1" from the root project
      peer expo@"*" from expo-firebase-core@5.2.0
      node_modules/expo-firebase-core
        expo-firebase-core@"~5.2.0" from expo-firebase-analytics@7.2.0
        node_modules/expo-firebase-analytics
          expo-firebase-analytics@"~7.2.0" from the root project
      peer expo@"*" from expo-media-library@15.2.3
      node_modules/expo-media-library
        expo-media-library@"~15.2.3" from the root project
      peer expo@"*" from expo-notifications@0.18.1
      node_modules/expo-notifications
        expo-notifications@"~0.18.1" from the root project
      peer expo@"*" from expo-splash-screen@0.18.1
      node_modules/expo-splash-screen
        expo-splash-screen@"~0.18.1" from the root project
      peer expo@"*" from expo-permissions@14.1.1
      node_modules/expo-permissions
        expo-permissions@"~14.1.1" from the root project
      peer expo@"*" from expo-updates@0.16.3
      node_modules/expo-updates
        expo-updates@"~0.16.3" from the root project
      peer expo@"*" from expo-keep-awake@12.0.1
      node_modules/expo-keep-awake
        expo-keep-awake@"~12.0.1" from expo@48.0.9
      peer expo@"*" from expo-updates-interface@0.9.1
      node_modules/expo-updates-interface
        expo-updates-interface@"~0.9.0" from expo-dev-client@2.1.6
        node_modules/expo-dev-client
          expo-dev-client@"~2.1.6" from the root project
        expo-updates-interface@"~0.9.0" from expo-updates@0.16.3
        node_modules/expo-updates
          expo-updates@"~0.16.3" from the root project
      peer expo@"*" from expo-constants@13.2.4
      node_modules/expo-firebase-core/node_modules/expo-constants
        expo-constants@"~13.2.0" from expo-firebase-core@5.2.0
        node_modules/expo-firebase-core
          expo-firebase-core@"~5.2.0" from expo-firebase-analytics@7.2.0
          node_modules/expo-firebase-analytics
            expo-firebase-analytics@"~7.2.0" from the root project

maybe because when i run yarn install the updated version is now 6.0.0 ?

Yes, maybe. Run npx expo-doctor again to see if it still complains about anything.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.