expo-device returns null on standalone app

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

I’m using Expo in managed workflow for android.

I’m using sentry-expo and I want to log the device info (model, OS version, brand, etc) for the crashes. I noticed that Sentry dashboard logs everything correctly except for the device info (it says Unknown Device - Unknown OS) on standalone app, but on Expo Go it logs everything fine.

As an alternative i tried to use expo-device module, and use some data like:

import * as Device from 'expo-device';

alert(Device.brand + ' ' + Device.modelName + ' ' + Device.osName + ' ' + Device.osVersion);

All of these work fine IF i’m using Expo Go. But when I build a standalone app, ALL of these return null (tested on different Android phones).

So I’m wondering, why device info can be accessed if project is running on Expo Go, but nothing is accessed on standalone apps?

Thanks in advance.

Hey @osama.aref, have you tested on multiple devices and you’re getting null consistently? Also, can you let me know the SDK version of your project?

Cheers,
Adam

SDK: 38.

I tested on 3 different Android devices. If i run project on Expo Go then expo-device works, it only stops working on standalone apps.

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