Changing the package name in Android app signing

I have noticed from my Android build log that the package name used in app signing ( nameOld ) does not match my Android package name used in my app.json file ( name ). This is likely because about a year ago I shortened the package name by removing the suffix.

While overall other things seem to work, I have a problem with loading the Google Map on standalone Android version only (from Google Play; otherwise the map works on iOS as well as the Expo clients: Android + iOS). I suspect this might be the cause of it.

I really appreciate it if you guide me on the proper way to make this change happening.

So in the Verify APK log:

smk 36524 Fri Nov 30 00:00:00 UTC 1979 AndroidManifest.xml
X.509,, OU=, O=, L=, ST=, C=US (qg9uc…)

 [certificate is valid from 6/5/19 7:48 AM to 10/21/46 7:48 AM]
  X.509,, OU=, O=, L=, ST=, C=US (qg9uc...)

Many thanks!

hi @bkamrani ! Is this a bare workflow app, or a managed one? I’m assuming it’s bare because otherwise I’m not sure how your app.json package name could be different from the one used in app signing, but maybe I’m missing something there.

Maybe this is because the API key is configured for the wrong package? You may have to go through these steps and make sure everything is configured correctly

1 Like

CN value in keystore is not used for anything neither by expo nor play store, it’s added by expo-cli during generation to help identify keystore manually.

1 Like

This is managed one. I am using SDK 36. Attaching a few screenshots to give a clue about my app.json and Google APIs.

@charliecruzan thank you very much! On your good point that “API key may be configured for the wrong package”; please excuse my lack of knowledge but I actually have 3 projects in my Google API Manager so I am wondering where it is actually specified which projected is associated with MapView (so that I can assure the right project is configured). Do you have any tips on that? At any rate, I have enabled the Maps SDK for Android in all my three projects, and have gone through the steps by adding the fingerprints for all of them. So I have gone through the steps a few times, and even tried re-generating the API keys, but I still have not succeeded.

This is what I do in each case after the steps: expo build:android -t apk and re-open and close the app twice to get the latest loaded (by double-checking the new version number) and test the Map page. I hope these steps are enough to get the changes kicked in (?).

FWIW, as a separate test, I went ahead to disable the Maps SDK for Android in all my three projects, and check the MapView page on Expo app as container but the map was still visible in contrast to my expectation.

@wkozyra thank you very much! Excuse me if this is irrelevant, is it possible to change it just in case? (wonder where it is read from).

Good news! I uploaded the binary .apk file from my previous build and the map works there. So it seems expo build:android -t apk only doing OTA and therefore is not sufficient to activate the API key update.

Few follow-up questions:

  • I did more tests by uploading my three builds which have used different API keys from three projects and now actually all of those versions load the map. I wonder why this is the case (i.e., shouldn’t it be only one build that has the correct API key for maps?)

  • I guess now I have to submit a new build to Google Play with the correct API key (hopefully I can find that from an answer to the previous question) because the OTA doesn’t cut this. Is this correct?

  • Is there any way to completely enforce downloading the latest OTA updates from Google Play (and App Store) upon the first time download without having to closing&openning the app 1-2 times? Even though I change fallbackToCacheTimeout to zero or 60 the lastest is not immediately received, and I have to close and reopen the app sometimes twice to get the latest.

Many many thanks! Sorry the long post.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.