Hi @charliecruzan, thank you for your response.
My project already used expo-constants to display version number and decide the enviroment.
This is my package.json
{
"private": true,
"dependencies": {
"@expo/vector-icons": "^10.0.3",
"expo": "^34.0.4",
"expo-asset": "^6.0.0",
"expo-av": "~6.0.0",
"expo-blur": "~6.0.0",
"expo-camera": "~6.0.0",
"expo-constants": "~6.0.0",
"expo-document-picker": "~6.0.0",
"expo-file-system": "~6.0.0",
"expo-font": "~6.0.1",
"expo-gl": "~6.0.0",
"expo-haptics": "~6.0.0",
"expo-image-manipulator": "~6.0.0",
"expo-image-picker": "~6.0.0",
"expo-linear-gradient": "~6.0.0",
"expo-localization": "~6.0.0",
"expo-location": "~6.0.0",
"expo-permissions": "~6.0.0",
"expo-pixi": "^1.1.0",
"expo-web-browser": "~6.0.0",
"geolib": "^2.0.24",
"lodash": "^4.17.10",
"moment": "^2.24.0",
"react": "16.8.3",
"react-dom": "^16.8.6",
"react-native": "0.59.8",
"react-native-custom-actionsheet": "0.0.4",
"react-native-fullwidth-image": "^0.1.2",
"react-native-gesture-handler": "~1.3.0",
"react-native-image-gallery": "^2.1.5",
"react-native-maps": "~0.24.2",
"react-native-modal": "^6.5.0",
"react-native-progress": "^3.6.0",
"react-native-reanimated": "~1.1.0",
"react-native-shimmer-placeholder": "https://github.com/tomzaku/react-native-shimmer-placeholder.git#expo",
"react-native-simple-dialogs": "^1.0.0",
"react-native-simple-radio-button": "^2.7.2",
"react-native-snap-carousel": "^3.7.2",
"react-native-status-bar-height": "^2.1.0",
"react-native-svg": "~9.5.1",
"react-native-swiper": "^1.5.14",
"react-native-tab-view": "^1.2.0",
"react-native-unimodules": "~0.5.2",
"react-native-web": "^0.11.4",
"react-navigation": "^2.18.2",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"babel-eslint": "^8.2.3",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-babel": "^5.2.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.11.1",
"jest": "^23.1.0",
"jest-expo": "^34.0.0",
"react-native-console-time-polyfill": "^0.0.6",
"react-test-renderer": "^16.4.0"
},
"scripts": {
"pretest": "yarn lint",
"test": "jest",
"lint": "eslint . --ext .js",
"start": "react-native start",
"ios": "react-native run-ios",
"android": "react-native run-android"
},
"jest": {
"preset": "jest-expo"
},
"resolutions": {
"@expo/browser-polyfill": "~0.1.0"
}
}
This is my build.gradle file:
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
// expo-camera bundles a custom com.google.android:cameraview
url "$rootDir/../node_modules/expo-camera/android/maven"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.7'
distributionUrl = distributionUrl.replace("bin", "all")
}
This is my app build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
apply from: "../../node_modules/react-native/react.gradle"
def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "<my app id>"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation project(':react-native-svg')
implementation project(':react-native-maps')
implementation project(':react-native-reanimated')
implementation project(':react-native-gesture-handler')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
addUnimodulesDependencies()
}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
And my settings.gradle
apply from: '../node_modules/react-native-unimodules/gradle.groovy'
includeUnimodulesProjects()
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
include ':react-native-reanimated'
project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android')
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
rootProject.name = 'figoinsurance.petcloud'
include ':app'
This is my MainApplication.java
public class MainApplication extends Application implements ReactApplication {
private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(
new BasePackageList().getPackageList(),
Arrays.<SingletonModule>asList()
);
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new MapsPackage(),
new ReanimatedPackage(),
new RNGestureHandlerPackage(),
new ModuleRegistryAdapter(mModuleRegistryProvider)
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
I will try to remove expo-constants from my package.json and see what happens when i try to run the app without it.
Btw, this is my expo diagnostics:
Expo CLI 3.0.9 environment info:
System:
OS: Linux 5.0 Ubuntu 19.04 (Disco Dingo)
Shell: 5.0.3 - /bin/bash
Binaries:
Node: 10.16.2 - /usr/bin/node
Yarn: 1.17.3 - /usr/bin/yarn
npm: 6.9.0 - /usr/bin/npm
npmGlobalPackages:
expo-cli: 3.0.9