Home > Software design >  Generate ejected expo app through eas build
Generate ejected expo app through eas build

Time:12-04

I created an expo app then i needed to add a printing package and i could not find any that was supported by expo(if there is any please just comment below) so i ejected my app and i added the react-native-thermal-printer package and i want to generate my app apk through eas build.Is there any special configurations i have to set for the non expo supported package or do i generete the apk as normal...I have already set up my eas.json.Also do i include the generated android folder while uploading to eas ? Any help will be appreciated

CodePudding user response:

If you have ejected your Expo app, you can generate an APK for it in the usual way for a React Native app. This involves using the ./gradlew script in the android/ directory to build the APK. You will likely need to modify your build.gradle file to include the react-native-thermal-printer package.

After building the APK, you can upload it to Eas Build as you would with a regular React Native app. You will not need to include the android/ directory when uploading to Eas Build.

It's important to note that since the react-native-thermal-printer package is not supported by Expo, your app may not work as expected when run through the Expo client. You will need to test your app on a physical device after building the APK.

CodePudding user response:

Yes, you can use the eas build -p android --profile preview command to generate an APK for your non-ejected Expo app.

When you run this command, Expo will use the android platform and the preview profile specified in your eas.json file to build your app. This should produce an APK file that you can distribute and install on Android devices.

If you have added any native dependencies to your app (such as the react-native-thermal-printer package you mentioned), you will need to include the generated android folder when uploading your app to Expo. This folder contains the native code for your app, which is necessary for the app to function properly on Android devices.

I hope this helps! Let me know if you have any other questions.

  • Related