Categories
discuss

Publishing a bare-workflow expo React-Native app to Google Play which was previously published in the managed workflow

My app was previously built while in the expo managed workflow. I did this using expo ba. Because android apps require that you release your app before you can add in-app-purchases, I uploaded this apk and released a beta using it.

I needed to switch to the bare workflow in order to implement in-app-purchases. Now, when trying to create a build to release the actual app, I am following the React Native instructions but must create another upload key in order to create a build(which is an aab this time).

On the play console it states

Upload key: The key you use to sign your first release. Sign every subsequent release with the same key to verify it’s from you. Keep your upload key safe. If it’s ever lost or compromised, contact developer support to replace it.

I’m pretty sure this is a problem because I used whatever expo was giving me to sign the original apk. I also cannot delete my original app and create a new app with the same bundle name because once an app is released it cannot be deleted.

Answer

To get the previously used keystore file run

expo fetch:android:keystore

Which will display something like

Keystore credentials
  Keystore password: MYAPP_UPLOAD_STORE_PASSWORD
  Key alias:         MYAPP_UPLOAD_KEY_ALIAS
  Key password:      MYAPP_UPLOAD_KEY_PASSWORD

  Path to Keystore:  /Path/To/my_upload_store_file.jks

Edit the file android/app/build.gradle to include the information above

...
android {
    ...
    defaultConfig { ... }
    signingConfigs {
        release {
            //if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
                storeFile file("MYAPP_UPLOAD_STORE_FILE")
                storePassword "MYAPP_UPLOAD_STORE_PASSWORD"
                keyAlias "MYAPP_UPLOAD_KEY_ALIAS"
                keyPassword "MYAPP_UPLOAD_KEY_PASSWORD"
            //}
        }
    }
    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }
    }
}
...

Place my_upload_store_file.jks inside android/app

Edit the file ~/.gradle/gradle.properties or android/gradle.properties, and add the following

MYAPP_UPLOAD_STORE_FILE="my_upload_store_file.jks"
MYAPP_UPLOAD_KEY_ALIAS="MYAPP_UPLOAD_KEY_ALIAS"
MYAPP_UPLOAD_STORE_PASSWORD="MYAPP_UPLOAD_STORE_PASSWORD"
MYAPP_UPLOAD_KEY_PASSWORD="MYAPP_UPLOAD_KEY_PASSWORD"

Run the following in a terminal from the directory android

./gradlew bundleRelease

This will produce a file called app-release.aab inside the directory android/app/build/outputs/bundle/release/. Upload this file to the Google Playstore console

Categories
discuss

Any ideas on the list with fit/wrap width on item in Jetpack compose

I need to implement next UI element:

enter image description here

  • Unknown size list of strings
  • Any item should be wrap content.
  • If an item is not fitted to row, he will be in the next row.
  • All list/grid is centered

Answer

You can use FlowRow from accompanist-flowlayout to implement this. It renders its children horizontally (like Row) but also wraps them by moving to the new line if they don’t fit in the existing line. It also allows to configure horizontal and vertical spacing between items.

To nicely handle very long strings (that will not fit into single line themselves) you can set overflow = TextOverflow.Ellipsis and maxLines = 1 on Text.

@Composable
fun HashTagList(hashTags: List<String>) {
    FlowRow(
        modifier = Modifier.padding(8.dp),
        mainAxisAlignment = MainAxisAlignment.Center,
        mainAxisSize = SizeMode.Expand,
        crossAxisSpacing = 12.dp,
        mainAxisSpacing = 8.dp
    ) {
        hashTags.forEach { hashTag ->
            Text(
                text = hashTag,
                modifier = Modifier
                    .background(
                        color = colorForHashTag(hashTag),
                        shape = RoundedCornerShape(4.dp)
                    )
                    .padding(8.dp),
                overflow = TextOverflow.Ellipsis,
                maxLines = 1
            )
        }
    }
}

enter image description here

Categories
discuss

The application’s minSdkVersion is newer than the device API level (android-R)

I have a device with android version 10.

Also, I have an emulator with API 22

this is a part of my build.gradle(:app) file:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-kapt'

apply plugin: 'kotlin-android-extensions'

android {
    dataBinding {
        enabled = true
    }
    compileSdkVersion 'android-R'
    defaultConfig {
        applicationId "com.example.android.sOnline"
        minSdkVersion 17
        targetSdkVersion 'R'
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
//        android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
    }
}

It just not working on ‘android-R’

Thank you for helping me 🙂

Answer

targetSdkVersion "R" will restrict your app to only running on Android R, by artificially raising your minSdkVersion to R. This has been the case for the past several years: each developer preview only supports running the app on the developer preview itself, not older devices.

Sometime later this year, we will be able to switch to using targetSdkVersion 30, at which point normal behavior returns with respect to minSdkVersion.

Source: stackoverflow
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Privacy Policy, and Copyright Policy. Content is available under CC BY-SA 3.0 unless otherwise noted. The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 © No Copyrights, All Questions are retrived from public domain..