How to make a signed APK in Sencha Touch 2 - android

Dear All,
I have successfully made an application using Sencha touch 2 it's
working fine in my Android device, also on Tablet and emulator. But
the problem is that the apk file could not be uploaded on Android Market it shows
me a error:
.apk is not signed also validity year 50 Error in Google market -:
Google Play does not accept apks signed with the debug certificate.
Create a new certificate that is valid for at least 50 years.
I have changed my certificate also "configuration":"Release"
but not get any success. Dear i am also sharing my whole configuration
file. If you find any of the error inside the configuration file
please let me know about it. Any of the suggestion is appreciated.
Thank in advance.
Code in Configuration file is that-:
{
"applicationName":"navi",
"applicationId":"com.amit.navi",
"versionString":"1.0",
"iconName":"resources/icons/Icon~ipad.png",
"inputPath":"build/native",
"outputPath":"build/",
"configuration":"Release",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"C:/Documents and Settings/amit/.android/amit.keystore",
"certificateAlias":"alias_name",
"sdkPath":"C:/android-sdk",
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}

Here is a guide to creating a key to sign your apk with.
You have currently signed your app with a debug key and need to generate a new one using keytool (java tool) then sign your apk with that.
Sencha guide: http://docs.sencha.com/touch/2-0/#!/guide/native_android
Keytool guide: http://developer.android.com/tools/publishing/app-signing.html
the keytool is in your java directory

Related

Your Android App Bundle is signed with the wrong key. Ensure that your app bundle is signed with the correct signing key and try again

How do I sign my android app bundle with the correct signing key?
I was banging my head on the table over this for about two hours. When I finally gave up and was filling out my "reset key" request, I realized that I was currently attempting to upload it to the wrong project the whole time.
So, step one: confirm that you're attempting to upload to the correct project.
I tried using the multiple answers here & in this question, but somehow I was getting this error because I had some issues with my android/app/build.gradle and android/gradle.properties files.
Two things you should check (in addition to the other solutions here) are:
In android/gradle.properties and android/app/build.gradle, make sure your keystore variables match exactly.
In android/gradle.properties, you probably have something like this:
MYAPP_RELEASE_STORE_FILE=<>
MYAPP_RELEASE_KEY_ALIAS=<>
MYAPP_RELEASE_STORE_PASSWORD=<>
MYAPP_RELEASE_KEY_PASSWORD=<>
Make sure these variable names exactly match those in android/app/build.gradle:
android {
...
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
}
}
}
}
In android/app/build.gradle, make sure you set signingConfig to signingConfigs.release in your release buildTypes:
android {
...
buildTypes {
debug ...
release {
signingConfig signingConfigs.release
}
}
}
The error suggests that you have uploaded an APK or an App Bundle previously. All the artifacts you upload to the Play Console should all be signed with the same keystore.
So the error means that you signed the App Bundle with a key that is different than the ones you have uploaded previously. You have to either find that keystore you used before or reset the key by contacting Play Console support team.
Just rebuild the project and generate signed apk once again and try !
Wasted my 2 days on this, had my keystore key but still showed error and request google for generating new key.... Read some random stackoverflow, where it was written to rebuild the project and try uploading once again.. IT WORKED !
there is **sign in key ** just click and upload with new keystore file that created manually
Read this is you have requested a new upload key from Google Play and still get this error (should work for both native Android and Flutter as well).
I had experienced the same problem. And here's out steps on how to resolve it:
We've lost the upload key (initial keystore file, probably .jks) that was used to sign the app.
We created a new keystore file and exported created certificate to PEM format as stated here in the docs. We sent the request to the Google Play Team to reset our key, attached .pem file.
When Google Play team reset the key we've tried to use the new .jks keystore we had created in the step 2 and the error appeared one more time, unfortunately.
The solution is to clean your project, rebuild it from scratch to reset all the cached builds.
In case of Flutter (we had this error building the app using Flutter). Make sure you use
flutter clean
Build the application on simulator or device.
Then run:
flutter build appbundle --release
This is how it was solved in our case.
PS. This should also help on native Android too.
I got the same error :
In my case, I was trying to upload debug version. That caused me this error.
So I changed below line in app-level Gradle:
signingConfig signingConfigs.debug
With:
signingConfig signingConfigs.release
Well after wasting hours on this problem ,Below Solution works for me -
When you are creating signed bundle it gets saved to some location,
Then when it gets rejected,
you went again to make new Signed Bundle,
Well thats where the mistake happens.
See when now you will create another signed bundle,
you sign it another folder , assuming that previous one was made last time,
, make sure you store the signed key in the "SAME FOLDER",
No need to make any new signed key path ,
JUST use the path you used while doing it for First time.
See this image,
use the same path which you have used during first time
Use the same JKS FILES as you have used for the first time.
NOW WHEN YOU WILL MAKE BUNDLES FILE,
IT WILL BE HAVING THE CORRECT KEY.
Thank You!!!
React Native here!
I got this error after trying to upload the generated .aab file from the ./gradlew bundleRelease command. I fixed it by exporting the .aab file by using Android Studio again. I believe that this is the way to upload your first .aab file to Google Play anyway. In case you don't know how:
In Android Studio:
Open you React Native's project android folder
Go to Build -> Generate Signed Bundle / APK
Select Android App Bundle
Enter your key-store details (if this is your first time doing this, you have to check the Export encrypted key checkbox, which you can use for Google Play App signing) and click Next
When Android Studio finishes it gives you the option to locate the file(s) created
Now if you upload this .aab file, it should be accepted.
Late answer(for any one possibly still struggling with this topic)-
You may have forgot the .jks file of that project.
Search for .jks files in File explorer.
Connect it to your project.
I realized that when I upload apk it gives more detailed error. so maybe try that solve errors and maybe then try app bundle.
hope it helps.
For those who have released apk without a manually generated keystore and facing this issue when trying to release the apk or bundle from a different machine, follow the below steps:
Copy debug.keystore (C:\Users\username\.android\debug.keystore) from the machine which used to build the first version of the App
Select Build > Generate Signed Bundle/APK
Provide the Key store path to the debug.keystore file
Fill the other fields with the default values mentioned below and build
Keystore name: "debug.keystore"
Keystore password: "android"
Key alias: "androiddebugkey"
Key password: "android"
CN: "CN=Android Debug,O=Android,C=US"
Make sure you are using the correct JKS for App Signing.
Common developer error, Android app with multiple flavours sign bundle using different JKS file.
In google play console I solved this issue by going to the aab archive tab and removed all existing versions there. Then I went back to production and choose change key for app signing. After this I could successfully upload my aab file.
I just discarded the previous release and then create a new release and uploaded the app-release.aab.
I have tried nearly everything that for a moment thought it must have been easier.
This is for new releases
If it is a new release just ignore it, create a new release ( create a new app ) and make sure you choose a different package name. This time also make sure there is nothing left between the folder you copied and new project
I got the same error and it consumed my lot time
Here the simple solution just change debug
signingConfig signingConfigs.debug
to release
signingConfig signingConfigs.release
What I did was exclude my android files from git, then when I changed branch and rebuilt, my build.gradle file was overwritten.
I am using expo to build my app bundle. In my case, I had to:
Manually create a new keystore file.
Or download your existing keystore using command expo fetch:android:keystore
Download the Upload certificate of my app from Google Play Console
Import the Upload certificate of the app into the newly created keystore file, giving it a key alias and a password. This is easily done using the java keytool. In MacOS is in the path so issue a keytool -h to see the various commands available.
run expo ba -c , took the manual route and when asked, I specified the keystore file I created in step 1.
I had the same error when building a signed Android App Bundle.
For debug purposes on the local maschine, I enabled debuggable in the release build type.
It seems, Playstore recognized an debug build and simply said it is not a valid Bundle.
build.gradle:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
//debuggable = true <----- Works like expected when disabled
}
}
This is worked for me!
While uploading apk/bundle first time to play store you might generated
private_key.pepk then your key might be also changed. So if you selected default key alias key0 then make sure you selected proper alias then only proceed. If that steps is correct then your bundle will be upload successfully.
I got the same error :
enter image description here
In my case I changed :
android {
compileSdkVersion 30
with
android {
compileSdkVersion 31
and
targetSdkVersion 30
with
targetSdkVersion 31
and it worked. Hope it will work for you.
if you lost your upload-keystore.jks file then either you have to reset the upload signing key or create a new app with new app bundle.
for reset the upload the key-store.jks follow the link below.He has explained very nicely how to do that. reset the signing key
Wowwww it it took me so long to understand why it is not working....
I changed the app key and send it to google and thy sent me to do:
"
Follow the instructions in the Android Studio Help Center to generate a new key. It must be different from any previous keys. Alternatively, you can use the following command line to generate a new key:
keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks
This key must be a 2048 bit RSA key and have 25-year validity.
Export the certificate for that key to PEM format:
keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks
Reply to this email and attach the upload_certificate.pem file.
"
i did it and the 1 thing that miss is to change in my keyAlias in the build.gradle to upload 🤦‍♂️
If you are using Fastlane, just check that you are actually typing the right passwords.
When trying to run the flow to upload to the play store, I was typing wrong the passwords for the signing store and alias key.
If you are publishing app to playstore and find error Your Android App Bundle is signed with the wrong key. Ensure that your app bundle is signed with the correct signing key and try again:
Then,
If you have not generated/changed app bundle or rebuild/clean project before reaching the current state displayed in pic then make sure to make new app project on play console as play console might be mixing the two keys.
image
It Worked for me with this solution
I rebuild the project in Android Studio then i changed the version code, and export the project with new keystore
in my console i deleted the release and create a new release and it worked good

Where is APK file after "phonegap build android" command?

After "phonegap build android" command,i searched .apk file on D:\firstapp\platforms\android\ant-build but i found only the CordovaApp-debug.apk and CordovaApp-debug-unaligned.apk file...
where can i get my .apk file, Also my app name if firstapp, still only CordovaApp-debug.apk file found..
Actually i'm new to phonegap, help me...
You found the right apk. Cordova is the new name for Phone Gap. CordovaApp-debug.apk is your apk. The -debug part means that it was signed with the default debug key.
You need to sign it with your own key when you upload the apk to Google Play. But for now, you can use the current apk you have to test it on your own device, or on your friends devices.
Cordova has changed name fixed to CordovaApp to avoid issues with unicode app name (https://issues.apache.org/jira/browse/CB-6511)
If your application name is normal (A..z) you can revert this behaviour by changine line 217 of C:\Users\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\lib
from:
var safe_activity_name = "CordovaApp"
to:
var safe_activity_name = project_name.replace(/\W/g, '');
CordovaApp-debug.apk is your .apk, cordova will not generate apk with your application name. It will be "CordovaApp-debug.apk"

ADM for Amazon Kindle Fire - INVALID_SENDER

Hi I am new to Amazon Kindle Fire,
I downloaded a sample code snsmobilepush.zip from docs.aws.amazon.com
and when i am following to get Obtaining ADM Credentials
To create an API Key,
I have expoted and created myapp.keystore file. When I am exporting, MD5 is taken like below
and API Key Name : test_profile_com.mycompany.kindletest
Package : com.mycompany.kindletest
Signature : 19:BB:B2:9C:91:0E:92:2D:8E:CC:9E:16:9E:F0:EE:34 (This is taken from above image while exporting) and press add button to create API_KEY and pasted in string.xml
I am getting error code INVALID_SENDER in the method onRegistrationError(final String string){.
Where am I wrong, Can you please anyone tell me ?
and to work ADM...
Do we need publish the app in Amazon App Store ?
Is it necessary Server side implementation for testing ?
Is it necessary to create api_key.txt in Assets folder ?
I have resolved this issue by exporting the apk from ecllipse and then install manually on my Kindle. Previously I was trying it from ecllipse.
To manually install apk on the kindle try following command
adb install -i com.amazon.venezia YOUR_APK_NAME.apk

"An internal error occurred" with integration of Google Plus Login

I am trying to integrate a Google plus Login in my application as per the instruction provided by following link :
https://developers.google.com/+/quickstart/android#install-sdk
I am following all the instructions perfectly. And when I run the sample application on a real device provided in the android-sdk and click the signin button, it display a Toast message that An internal error occurred
What am I doing wrong?
I have this problem and even after creating 10 different client IDs with different SHA and package name, it doesn't work... until I found out that you have to fill the Consent screen.
According to GoogleDevelopers Console -
The consent screen will be shown to users whenever you request access
to their private data using your client ID.
This can happen when you haven't set the signature for the client ID in your API console project, or if you copied the wrong key value from keytool. Doing so is documented in the steps of the quick start guide on steps 7, 8, 9, and 10.
I've solved problem by removing .setScopes("PLUS_LOGIN") in the PlusClient.Builder.
I got this toast message error in my android application:
An internal error occurred
Summary:
Assuming you made a mistake configuring the negotiation between your android app and the Android API server granting you access. Most likely caused by you not adding the correct package name or correct SHA1 fingerprint. I followed these steps to blow out the wrong configuration and do it right.
Steps to fix:
Go to your google api console and login: https://code.google.com/apis/console
Click "API Access" tab.
Click the button: "Create another client ID".
Choose: "Installed Application" radio button.
Choose: "Android" radio button.
Enter the package name of the android app that is displaying the above error. You can find it defined at the top of the PlusSampleActivity.java code file. For me it is com.google.android.gms.samples.plus
Acquire your SHA1 fingerprint value:
a. Use the command keytool -list -v -keystore /home/el/.android/debug.keystore. Enter password, If you never set it, the default password is 'android'.
b. The SHA1 fingerprint is shown on screen, copy that.
Paste the above value into the "Signing certificate fingerprint (SHA1):" box.
Click the button: "Create client ID".
Run your android application again, click "Sign in".
Now you are presented with an Activity to "Sign in to Google+ SDK with Google".
In my case, the solution was to actually set an email address in the Consent Screen.
First, I was a bit reluctant to select my personal address and for an strange reason you can save the form without this piece of data with no error. After checking what others have suggested, as soon as I set my email address in that form, it started working.
I have been searching how to fix this for a day with full of research without luck finally i managed
to resolve this issue with the following approach.
Before i begin resolving this (at least how ti worked for me) i have to say that everything on the
documentation is correct and you don't have to change any lines of code or so.
It looks like more of a bug in the https://cloud.google.com/console cloud console
First ensure you got the correct SHA1 and your project's package name as described in the docs
https://developers.google.com/+/quickstart/android
Now this bug as i noticed (at least for me) was that in my cloud console, the project i have created
was long ago with the old interface and few months ago i migrated to the new GUI.Once you get the new look on cloud console you will notice that new projects have an auto generated project id
like this atlantean-ares-331 while old projects got a long integer value as project id which is not visible. So if your project was created with the old GUI and you have just created new client id for OAuth for that project you will get the Toast "An internal error occurred” while trying to sign in with google.
How to Fix
Go to your cloud console
Make a new project i would suggest a name like
oldprojectname-gplus
In APIs section enable Google+ API
Ensure that none of your projects has the same package name on
OAuth Client ID with the one you will use now otherwise you will get Error This client ID is globally unique and is already in use.(you will have to delete the old OAuth client id with the same package name you will use now).
Go to Credentials Create New Client ID for OAuth.
Installed application
Android
Enter your project's package name and your SHA1
Done
My solution to the problem was following.
I did everything others recommended and there was no typo regarding the package name and SHA1 key. I also tried removing the key and then adding it again but it didn't help.
What did help is removing the key and creating a new project (at https://code.google.com/apis/console) and then creating the Client ID (with package+sha1) again there. After that (5 secs) everything worked on my Android device.
This problem is related to the permissions from the api console.
if you are using a permission related with SCOPE_PLUS_LOGIN, in the api console you must create two keys, one for OAuth client id, and other for public api key.
In my case the problem was that I changed the package name of the app and didn't update in dev console.
For me it was that i was attempting to use my production key when installing it using my debug key. Make sure your using the right SHA1 from the right keystore.
I turned around to the Google IO 2013, and changed the initialization of PlusClient, then it works.
public static final String AUTH_SCOPES[] = {
Scopes.PLUS_LOGIN,
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/developerssite" };
mPlusClient = new PlusClient.Builder(this, this, this)
.setScopes(AUTH_SCOPES)
.build();
Thanks Thano for the solution
"Now this bug as i noticed (at least for me) was that in my cloud console, the project i have created was long ago with the old interface and few months ago i migrated to the new GUI.Once you get the new look on cloud console you will notice that new projects have an auto generated project id like this atlantean-ares-331 while old projects got a long integer value as project id which is not visible. So if your project was created with the old GUI and you have just created new client id for OAuth for that project you will get the Toast "An internal error occurred” while trying to sign in with google."
Recreating the project in the Google Console worked for me after several other attempts:
For any reason my project did not have a project ID (old console/new console?).
As Thano (above) suggested, I created a brand new project, created Client IDs, ... and then in worked. Thanks for the advice!!
Remember to use the built-in debug keystore for testing. I had everything else working correctly, but I had set my production keystore SHA1 fingerprint in the Credentials in the Developers Console, which caused it not to work.
If your facing this error when you try to run the sample application "or" copy the project which you have created in other machine which was running successfully in that and giving such pop-up error in the other machine where you are trying to run ,you can follow the below method and it will help.
If your are building the app for testing/debug purpose then,
1.Generate the new SHA1 if you copy your project and run it on other machine for the package name and path provided for keystore.
2.Change the ClientId in developers console for new generated SHA1 and run it in the new machine where you have copied the project and trying to run it.
Something often overlooked is the package name. I'd like to clarify the step 6 by Eric Leschinski above (can't comment there): the required package is not the package of an activity, rather the package of your app's manifest.
You may retrieve the correct value from the root element of AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ntk.darkmoor"
android:versionCode="1"
android:versionName="1.0" >
In this example define "com.ntk.darkmoor" while creating the Client ID
I had the same issue when I used SHA1 for debug.keystore for debuging then exported my application forgetting to generate SHA1 for keystore that I used to export my application.
Its working for me when i connect the device and install the apk from Android Studio.
But its now working for me when i generate the .apk and install it from dropbox.
I went through all the answers provided here and others as well. In my case the issue was the SHA-1 as well. The reason I was getting the incorrect SHA-1 was my keytool export cert command.
Previously I was using
C:\Users\mysuername\.android SHA 1 signature keytool -exportcert -alias androiddebugkey -keystore "keystorepath" -list -v
The problem was in the androiddebugkey variable. Here you have to give the name of the key you use for signing the application.
C:\Users\mysuername\.android SHA 1 signature keytool -exportcert -alias mykeyname -keystore "keystorepath" -list -v
Hope this helps someone!
To add to this long list of reasons my problem was that i got the debugkey from the jks file rather than the app.
Its always something small.

updating sencha touch 2 android app

I am trying to submit a update to the google play store for my sencha touch 2 app.
the following is my packager.json file.
{
"applicationName":"DBS",
"applicationId":"com.keshav.dbs",
"versionCode":"2",
"versionString":"1.0.1",
"iconName":"ic_launcher.png",
"inputPath":"./build/package/Android",
"outputPath":"./build/native/Android",
"configuration":"Release",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"/Developer/Android-Keystore/myAndroidKeyStore",
"certificateAlias":"myandroidkey",
"certificatePassword":"<password>",
"sdkPath":"/Developer/sdks/android-sdk-macosx",
"androidAPILevel":"16",
"orientations": [
"portrait"
]
}
I run the following command
sencha package run packager.json
this creates the apk file however when i try to upload the new apk i get a message saying the versonCode 1 is already in use.
The instruction of packaging on Senchas website dont include the "versionCode" property I added that my self
Does anyone know how to change the version code for sencha app?
I was able to edit platforms/cordova/android/AndroidManifest.xml and update the android:versionCode, then run sencha app build native
It built the new APK (signed, based on my config) and it was accepted by the Google Play store.
Much easier than un-packaging and repackaging.
well here it is ...
After looking around the internet i found this approach works....
After Sencah creates the package use apktool to un-package the apk then edit the AndroidManifest.xml and package it up again with apktool.
Note when you re-package the app tit will be unsigned so you will have to sign it again for it install on peoples devices

Categories

Resources