How to generate APK from an ExpoKit project?

-1

I was with an Expo project, but due to the need to apply payment methods, I had to eject the project to have the / android and / or ios folders to edit them directly. I decided to use react-native-iap, so I went for an ExpoKit project, as it is recommended by the Expo documentation since it continues to use Expo properties, as opposed to a complete ejection. So ... I did the right editions, but how do I generate the app apk? Since 'expo build: android' does not work on this type of project.

    
asked by anonymous 03.12.2018 / 03:28

1 answer

0

1 - Put the Keystore in android / app

2 - Change one of the files: ~ / .gradle / gradle.properties or android / gradle.properties by changing to the settings of your keystore:

MYAPP_RELEASE_STORE_FILE=minha_key.keystore
MYAPP_RELEASE_KEY_ALIAS=minha_key-alias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****

3 - Edit android / app / build.gradle and add the above variables:

...
android {
    ...
    defaultConfig { ... }
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }
    }
}
...

4 - To generate:

$ cd android
$ ./gradlew assembleRelease

The APK will be in: android / app / build / outputs / apk / release / app-release.apk

Any questions, see here: link

    
10.12.2018 / 16:02