This troubleshooting tutorial is intended for experienced mobile developers who can no longer update an Android app in Google Play after updating to AppBuilder 1.6. You will learn:
- How to change the application identifier in
- How to export your cryptographic identity
- How to decode the application package
- How to modify the application package
- How to recreate and code sign the application package
After updating to AppBuilder 1.6, you were required to modify the application identifiers of one or more existing apps. After changing the identifiers, you can no longer update your apps in Google Play.
AppBuilder 1.6 introduces a limitation that might require you to change the application identifiers for existing apps.
To update an app in Google Play, you need to build and code sign the application package with the same application identifier and cryptographic identity used for publishing it. After changing the identifier in AppBuilder, you can no longer build the app with the original application identifier and you cannot update it.
Modify the contents of the application package for your app and code sign it with the same cryptographic identity that you used when you built the app.
In this tutorial, the following placeholders are used. You need to replace each placeholder with the corresponding value from your production environment.
- com.YourCompany.Old_Identifier: The application identifier you used when you published your app in Google Play first.
- com.YourCompany.NewIdentifier: The modified application identifier.
- YourApp.apk: The filename for your application package.
- YourApp: The folder that contains the decoded application package.
- certificate_alias: The alias for your cryptographic identity.
- exported_certificate.p12: The filename for your exported cryptographic identity.
- FilePath: The file path to a resource.
To complete this tutorial, you need to install and configure the Java Development Kit (JDK) and Android Apktool on your system.
With the latest version of the Java Development Kit (JDK), you will be able to run Android Apktool and code sign the application package after you modify it. For more information about installing and configuring JDK, see JDK 7 and JRE 7 Installation Guide.
With the latest version of Android Apktool, you can use a command prompt to decode and recreate the application package.
You need to code sign the modified application package with the same cryptographic identity that you used for publishing in Google Play. Verify that you have exported your cryptographic identity from AppBuilder as a
First, in the code editor, open AndroidManifest.xml for editing.
Next, configure the package identifier in the code. Locate the
$AppIdentifier$ placeholder and replace it with
com.YourCompany.Old_Identifier. Verify that the markup contains the following line.
Save your changes.
From the main menu, click Publish and select Google Play as the target platform. If you are running in-browser client, click Next.
Select your certificate and click Build.
Wait for the build process to complete and click Download to save the application package to disk.
Run a command prompt, navigate to the folder where you stored
YourApp.apk and run the following command.
apktool d YourApp.apk
YourApp.apk in a new folder named
smali directory nests subfolders in a pattern that resembles the updated application identifier you set in the app properties (
com.YourCompany.Old_Identifier, rename one or more subfolders in the
smali directory to make the file path pattern resemble the initial application identifier. After your changes, the
smali folder should have the following structure.
Next, from the
smali directory, open all
SMALI files for editing. Based on your initial and updated application identifiers, replace occurrences of
com/YourCompany/Old_Identifier in the code.
Save all changes.
In the command prompt run the following command:
apktool b FilePath\YourApp FilePath\YourApp.apk
In the command prompt, run the following command:
jarsigner -storetype pkcs12 -keystore FilePath\exported_certificate.p12 FilePath\YourApp.apk certificate_alias
When prompted, provide the password for the exported cryptographic identity.
Upload your app to Google Play.