I've developed my app using expo with react-native and type script, for the entirety of my development I used npx expo start
to run and test my application. I am currently trying to bundle it to an APK with eas build -p android --profile preview
(according to expo documentation). The APK I am getting doesn't work; it crashes every time I try to start it after installation.
My eas.json
{
"build": {
"preview": {
"android": {
"buildType": "apk"
}
},
"preview2": {
"android": {
"gradleCommand": ":app:assembleRelease"
}
},
"preview3": {
"developmentClient": true
},
"production": {}
}
}
I tried using adb logcat
to understand the logs but haven't found anything valuable:
/data/data/com.*.myapp/lib-main
07-30 19:58:25.249 28613 29609 D SoLoader: libexpo-modules-core.so found on /data/app/~~auisghsPKDGuFzpW4b0C0Q==/com.*.myapp-AgdjN0bcWCy6xfENs1Iezw==/lib/arm64
07-30 19:58:25.249 28613 29609 D SoLoader: Not resolving dependencies for libexpo-modules-core.so
07-30 19:58:25.250 28613 29598 I AdrenoGLES-0: PFP: 0x016ee190, ME: 0x00000000
07-30 19:58:25.253 28613 29609 V SoLoader: libturbomodulejsijni.so not found on /data/data/com.*.myapp/lib-main
07-30 19:58:25.253 28613 29609 D SoLoader: libturbomodulejsijni.so found on /data/app/~~auisghsPKDGuFzpW4b0C0Q==/com.*.myapp-AgdjN0bcWCy6xfENs1Iezw==/lib/arm64
07-30 19:58:25.253 28613 29609 D SoLoader: Not resolving dependencies for libturbomodulejsijni.so
07-30 19:58:25.255 28613 29609 I ExpoModulesCore: ✅ JSI interop was installed
07-30 19:58:25.256 1104 5549 E surfaceflinger: [frame_perf] perfboost open boost file failed
07-30 19:58:25.257 1104 1888 E surfaceflinger: [frame_perf] perfboost open boost file failed
07-30 19:58:25.258 28613 29609 I ExpoModulesCore: ✅ Constants were exported
07-30 19:58:25.262 602 602 I hwservicemanager: getTransport: Cannot find entry android.hardware.graphics.mapper@4.0::IMapper/default in either framework or device manifest.
07-30 19:58:25.262 28613 29598 I Gralloc4: mapper 4.x is not supported
07-30 19:58:25.262 602 602 I hwservicemanager: getTransport: Cannot find entry android.hardware.graphics.mapper@3.0::IMapper/default in either framework or device manifest.
07-30 19:58:25.262 28613 29598 W Gralloc3: mapper 3.x is not supported
07-30 19:58:25.273 1104 1480 E surfaceflinger: [frame_perf] AutoTurboBoostQuery fd<0 failed, errno=Inappropriate ioctl for device
07-30 19:58:25.273 1104 1480 E surfaceflinger: [frame_perf] AutoBoostConfigQuery fd<0 failed, errno=No such file or directory
07-30 19:58:25.279 1561 1847 D ArtManagerInternalImpl: /data/misc/iorapd/com.*.myapp/1/com.*.myapp.MainActivity/compiled_traces/compiled_trace.pb doesn't exist
07-30 19:58:25.281 1561 1874 I ===> HoustonPackage: addLaunchTimeInfo: for com.*.myapp/.MainActivity isCold:true launchTime:285
07-30 19:58:25.281 1561 1874 I 322 : com.*.myapp#30#285
07-30 19:58:25.281 1561 1847 I ActivityTaskManager: Displayed com.*.myapp/.MainActivity: +285ms
I tried running my apk after bundling it with expo and it crashed without any error codes.
Since then I always run npx expo install react-native-gesture-handler
then npx expo install @react-native-masked-view/masked-view
then npx expo install react-native-screens react-native-safe-area-context
. I also import 'react-native-gesture-handler';
at the top of my App.tsx or App.js.
Keep in mind this instructions may be a little excessive. I don't know exactly what step fixed the issue. But I have not run into it ever since.