I build an apk using EAS to test my app with my android phone.
Strangely, when i used the expo build:android -t apk, my app was a little bit heavier (around 68 Mo) but it's work fine like when i test it on Expo Go App.
But, after using eas-cli with this command eas build -p android --profile preview, my apk file was pretty lighter (only 35 Mo), but it's i doesn't work now. It stucks at the main panel.
Perhaps i have an misunderstanding of the eas-cli. I'm reading hardly the doc right now but you're welcome if you have much more exp with eas-cli.
My eas.json file
{
"cli": {
"version": ">= 0.50.0"
},
"build": {
"preview": {
"ios": {
"simulator":true
},
"android":{
"buildApk":true
}
}
}
}
Related
I recently updated our Expo project from sdk 44 to 46.
During that process, I switched from Expo build:android to eas build -p android.
Everything is running as expected, except the version code is not compiled into the aab/apk files correctly, so I cant push updates to google play.
The version code is already set to 26, as we did release previous versions, and the semVer is 1.1.1 currently. EAS also doesn't show the correct version codes in the dashboard.
I tried setting "appVersionSource": "local" as well as "remote", but neither works. (As far as I understand, local should be the correct parameter.
eas build generally seems to ignore other parameters from the app.config.js, like the splash images, app icons and background colors (I didn't include those lines in the code examples below to keep it short)
eas.json
{
"cli": {
"version": ">= 2.3.0",
"appVersionSource": "local"
},
"build": {
...
"production": {
"channel": "production",
"env": {
"APP_ENV": "production"
},
"android": {
"buildType": "app-bundle",
"image": "latest"
}
}
},
"submit": {
"production": {}
}
}
app.config.js
import 'dotenv/config';
module.exports = {
expo: {
name: '...',
slug: '...',
version: '1.1.1',
assetBundlePatterns: ['**/*'],
android: {
package: '...',
versionCode: 26,
softwareKeyboardLayoutMode: 'pan',
},
extra: {
eas: {
projectId: '...',
},
releaseChannel: process.env.APP_ENV,
},
},
};
Eas showing the wrong version nr
Try running npx expo prebuild or npx expo run:android That would generate the native Android project, which is basically like the Bare workflow.
See the following post for some more details and what you can do:
https://forums.expo.dev/t/should-i-exclude-ios/63094/4
If this helped you I would really appreciate it if you mark this as the answer. Thanks :)
I'm trying to add in a built-in application with react-native-expo a series of tools from firebase.I managed to add the following features Cloud Messaging and Firebase Analitycs.But I have to integrate In-app-messaging and Dynamic links
First time I install all firebase module/dependencies to do this task.
"#react-native-firebase/app": "^12.9.3",
"#react-native-firebase/in-app-messaging": "^12.9.3",
and my file looks like:
.......
import inAppMessaging from '#react-native-firebase/in-app-messaging
.......
useEffect(()=>{
await inAppMessaging().setMessagesDisplaySuppressed(true);
}[])
but I recive a warning:
]Unhandled promise rejection: Error: You attempted to use a firebase module that's not installed on your Android project by calling firebase.app().
After that I try to find a solution,I learn that expo allow to create plugins to extend expo functionality
I tty to salve problem fallow expo documentation but I couldn't figure out how to create these plugins.
Next I find a module that can help me with-rn-firebase but is not working and the module is depeciated.
Then I searched the internet until I discovered other people with the same problem this is the link I see in their app.json a basic config of plugin and I try to implement in my project,after I install dependencies that I need i add in my file:
"plugins": [
"#react-native-firebase/app",
"#react-native-firebase/analytics",
"#react-native-firebase/in-app-messaging"
],
But the fallowing error occure:
Package "#react-native-firebase/analytics" does not contain a valid config plugin.
Learn more: https://docs.expo.io/guides/config-plugins/#creating-a-plugin
Cannot use import statement outside a module
What I mean is, if anyone has ever faced this problem, I want in my project to be able to use in-app-messaging and dynamyc-links if someone has tried an implementation with expo and has any idea
Eventually I solved the problem,expo when I use the command expo:build android it only compiles my javascript files,but some of the code was written in java and other optional files in the android / ios folder.So instead of compiling with expo I used eas.
Faloowing command:
Run as administrator cmd and write this line npm install -g eas-cli.
Initialize new module in your expo/react native project with this line eas init.
Build aplication using this line for android: eas build --platform android
*For ios is a bit different you mast edit your file eas.json:
{
"cli": {
"version": ">= 0.43.0"
},
"build": {
"development": {
"distribution": "internal",
"android": {
"gradleCommand": ":app:assembleDebug"
},
"ios": {
"buildConfiguration": "Debug"
}
},
"preview": {
"distribution": "internal"
},
"production": {
"ios": {
"cocoapods": "1.11.2"
}
}
},
"submit": {
"production": {}
}
}
Build aplication using this line for ios: eas build --platform ios
Eas build include in complile all app file .gradle/.js/.java/.xml/.m/.h and this thing offer your posibility to build mobile app in expo with same functionality and complexity like react native cli.
Usefull Link
https://docs.expo.dev/build/setup/
React Native Expo Build Failing due to cocoapods version
I think you need to run locally using expo dev client
https://docs.expo.dev/development/getting-started/
Mostly, the package that is not supported by expo can run natively. But you need successfully built in eas build.
I'm setting up my first hybrid app using cordova / framework7-cli....
all fine, except
cordova run android
freezes with:
"Reading build config file: C:\...\APP\build.json . . . . . . "
and many many more dots.
Tried to
1. cordova build android --release
2. Moved build.json, take a look inside, ok...
3. built a new apk, built a new session, tried another avd ...
build.json:
{
"ios": {
"release": {
"buildFlag": [
"-UseModernBuildSystem=0"
]
},
"development": {
"buildFlag": [
"-UseModernBuildSystem=0"
]
},
"debug": {
"buildFlag": [
"-UseModernBuildSystem=0"
]
}
}
}
However, this freeze causes to break my build-process and nothing happens. normally i can see my app on the selected device...
Does anybody got the same issue?
If using Android Virtual Device make sure to run "Cold Boot Now". This fixed the issue for me
I am trying to build an APK file for my CRNA project, using expo. The first issue is, it tries to build iOS every time. Why is it building iOS when I used exp build:android?
Second, iOS only succeeds in building occasionally. It usually hangs at 0%.
The output is below:
> exp build:android
[16:28:36] Making sure project is set up correctly...
-[16:28:38] Warning: Not using the Expo fork of react-native. See https://docs.expo.io/.
[16:28:38] Your project looks good!
[16:28:38] Checking if current build exists...
[16:28:39] No currently active or previous builds for this project.
[16:28:39] Unable to find an existing exp instance for this directory, starting a new one...
[16:28:40] Warning: Not using the Expo fork of react-native. See https://docs.expo.io/.
[16:28:42] Starting Metro Bundler on port 19001.
[16:28:42] Metro Bundler ready.
[16:28:43] Tunnel ready.
[16:28:43] Publishing to channel 'default'...
[16:28:44] Warning: Not using the Expo fork of react-native. See https://docs.expo.io/.
[16:28:44] Building iOS bundle
And then it hanngs indefinitely.
Has anyone came across any of these issues and have any advice?
My app.json is below
{
"expo": {
"sdkVersion": "27.0.0",
"icon": "./test-icon.png",
"entryPoint": "./AppEntry.js",
"ignoreNodeModulesValidation": true,
"packagerOpts": {
"config": "rn-cli.config.js",
"projectRoots": ""
},
"android":{
"package": "expo.android.package",
},
"ios":{
"bundleIdentifier": "expo.ios.package",
},
},
"privacy": "unlisted",
"platforms": ["ios", "android"],
"version": "1.0.0",
"orientation": "portrait"
}
expo version: 55.0.4
react-native version: 0.55.4
I have 2 days of react-native experience and just learned how to build & install app to real device. I signed up apk with key.
executing of:
react-native run-android
works fine on real device, i even can't see any errors in remote debugger
but launching
gradlew installRelease // or
gradlew assembleRelease // plus manually installation
== Unfortunately, App has stopped.
P.S. i can't share code, because it's under NDA, but i use only
redux, react-native-router-flux
and have only 2 simple pages
UP
after launching installation commit after commit starting from empty project, i have found, commit that breaks app on release on device:
i added .babelrc:
"presets": [
"es2015",
"stage-0",
"react-native"
]
}
installed new packages for tests:
"babel-core": "6.11.4",
"babel-loader": "6.2.4",
"babel-preset-es2015": "6.9.0",
"babel-preset-react-native": "1.9.0",
"babel-preset-stage-0": "6.5.0",
"chai": "3.5.0",
"enzyme": "2.4.1",
"eslint-plugin-react": "5.2.2",
"mocha": "2.5.3",
"mockery": "1.7.0",
"react-addons-test-utils": "15.2.1",
"react-dom": "15.2.1",
"react-native-mock": "0.2.5"
After removing
"es2015", "stage-0" from .babelrc app started work on real device also. It would be good to understand why :)