Upgrade SDK34 - Expokit [solved]

Hi,
I have upgraded my project from SDK33 to SDK34, but I have many issues with it. As a first, I have to manually install using expo these libraries (maybe because unimodules can’t be yet ommited on android?):

 "expo-ads-admob": "~6.0.0",
    "expo-barcode-scanner": "~6.0.0",
    "expo-camera": "~6.0.0",
    "expo-constants": "~6.0.0",
    "expo-contacts": "~6.0.0",
    "expo-face-detector": "~6.0.0",
    "expo-file-system": "~6.0.0",
    "expo-gl": "~6.0.0",
    "expo-google-sign-in": "~6.0.0",
    "expo-local-authentication": "~6.0.0",
    "expo-media-library": "~6.0.0",
    "expo-permissions": "~6.0.0",
    "expo-print": "~6.0.0",
    "expo-sensors": "~6.0.0",
    "expo-sms": "~6.0.0",

after that, build finished correctly. But now, when I run the app on mobile phone, than this error occured:

08-07 07:55:35.941 4092-4092/my.supersecretpackage.comcom E/AndroidRuntime: FATAL EXCEPTION: main
    Process: my.supersecretpackage.comcom, PID: 4092
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facebook/ads/AudienceNetworkAds;
        at host.exp.exponent.ExpoApplication.onCreate(ExpoApplication.java:110)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
        at android.app.ActivityThread.access$1500(ActivityThread.java:151)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5254)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.ads.AudienceNetworkAds" on path: DexPathList[[zip file 
.............

I think, it can be caused by removing some code in BasePackageList.java:

public List<Package> getPackageList() {
    return Arrays.<Package>asList(
        new expo.modules.ads.admob.AdMobPackage(),
   (removed)     new expo.modules.ads.facebook.AdsFacebookPackage(),
  (removed)      new expo.modules.analytics.amplitude.AmplitudePackage(),
  (removed)      new expo.modules.analytics.segment.SegmentPackage(),
  (removed)      new expo.modules.appauth.AppAuthPackage(),
   (removed)     new expo.modules.av.AVPackage(),
   (removed)     new expo.modules.backgroundfetch.BackgroundFetchPackage(),
  (removed)      new expo.modules.barcodescanner.BarCodeScannerPackage(),
......

but this file is autogenerated…i didnt remove anything manually.

Have I done sth wrong during upgrade? Do I have to add all unimodules you have removed in SDK34 manually? Which modules I have to add? I studied the documentation, but there is nothing about it…

My configration for expokit, react, and react-native:

 "react": "16.8.3",
  "react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
  "jsc-android": "245459",
  "expokit": "^34.0.1",

Thanks…I really do not know what should be wrong…and I am investigating it already for two days…
Tomas

4 Likes

I’m seeing the same issue. Failed resolution of: Lcom/facebook/ads/AudienceNetworkAds;

Let me know if you find anything!

1 Like

expo install expo-ads-facebook seems to have resolved this issue for me, my app doesn’t make use of this package.

4 Likes

Beat me to it! Just found that

It works! Thank you!!! :-)))))

Glad you got to the bottom of it. Thanks for sharing the remedy.

Thanks! This fixed the issue