I am failing to get an apk build file even though I am following the steps as mentioned on the create your build page.
I have done a few things differently as I want to use notifee package (as per their recommendations) :
a) added plug in app.json : “plugins”: [“@notifee/react-native”]
You shouldn’t need to do this, and in fact I’d recommend against it unless you’re developing your own native code as part of the app or you’re trying to debug a build issue locally. It has the side effect of generating the native projects which basically switches you to the bare workflow. To switch back to the managed workflow, the main thing is to delete the android and ios directories, or alternatively you could add them to your .gitignore.
No, the Notifee documentation is incorrect/misleading. It’s not required.
They link to the Expo “Adding custom native code” guide, which in the past implied that you should run npx expo prebuild, but it is not required, because the EAS Build servers automatically run it for you during the build process:
You are correct. My comments were not related to the .tar.gz creation. I’m surprised it did that at all. I’ve only ever seen that when building an iOS Simulator build.
Did you try changing "developmentClient" to true as Aman suggested? I suspect that is the real answer.
If you’re not sure what you should have in eas.json you can rename your current one and then run eas build:configure and it will generate the default one. The default one is probably what you want, although if you need to specify the "image" etc., then you can of course add that back in. But don’t change the "developmentClient" or "distribution" settings and you usually don’t need to change the "buildType" either. NOTE: I don’t believe you need to specify the "image" either. See below.
If you use the default eas.json and use the development profile for an Android build it should build a .apk file by default. Same with the preview profile. If you use the production profile it will build a .aab file.
Default build type
EDIT: This info from the Notifee docs is out of date and misleading too:
You will have to use image as ubuntu-18.04-jdk-11-ndk-r19c or another image that has jdk 11 as in the following configuration.
As you can see in the “EAS Build server infrastructure” page pointed to by the Notifiee docs, the “default” image is ubuntu-20.04-jdk-11-ndk-r21e, which already contains JDK 11, so no need for you to specify the older ubuntu-18.04-jdk-11-ndk-r19c image.
@wodin , thanks, your clarification was very helpful. Based on that I tried to replicate the issue by creating a new expo project from scratch rather than figuring out what’s wrong with the existing set up . But this time it worked fine, I was able to get an apk file.
The only 2 things ( I think) I did differently this time were :
a) I ran pre build command npx expo prebuild instead of npx expo run:android. I made the changes to the sdk version values in android/build.gradle once the file was generated.
b) added the dev client package after I created an apk first without it, using the command npx expo install expo-dev-client
If I were to guess it must be the step a) where things would have gone wrong for me.
I am able to create a dev client apk as well as a normal app apk now.
Again, thanks for your help in getting me to the solution as well as to for helping me understand the build process a bit more . _ /\ _
Neither a, nor b should have had anything to do with creating a .tar.gz file instead of a .apk file.
npx expo prebuild is automatically run when you run npx expo run:android
If I were you I would do this:
Create a new Expo app
Install the Notifee npm:
npm install @notifee/react-native
Install expo-dev-client and expo-build-properties:
I’m having the exact same problem and I think @anuanu23 was having the same problem but something got lost in communication. We have an app on the bare workflow and I’m trying to create a preview build, not a development build, and it consistently creates a tar.gz instead of just an apk. The tarball has two files, release/app-release.apk and debug/app-debug.apk. This happens for both local builds and builds on eas servers.
It used to only create one apk, which made installing the build from eas servers easy since you could scan the QR code or share the url and install the build directly for testing. This is no longer the case though, since we have to manually untar and install the apk.
I’ve tried various configs in eas.json. I’ve tried manually setting android.buildType: "apk", I’ve tried setting android.gradleCommand: ":app:assembleRelease", I’ve tried leaving out the android key. Nothing seems to work to create only an apk. Is there something else that controls whether it creates both a release apk and a debug apk?