Android Signed APK showing incomplete - android

I have signed the application using Eclipse's Export Wizard. When I published this, users started complaining that the application is behaving incorrectly. (Basically, the APK did not have necessary images & audio and hence showing incorrect behaviour).
Some information on Application and Signing which I have tried.
I have a lite version and paid version. Both are signed with same keypair. The lite version is working perfectly and full version is giving error.
I have tried to export the signed packages again and tried to install directly in device (instead of uploading to market). Same behaviour (i.e Lite apps works correctly and full version not proper)
Both Full Version and Lite Version uses shared Library (Code base is identical. Differences as follows.
Full Version has 5 times the resources of lite version. The lite version apk is ~2.6MB and full version is ~10.4MB. In Full Version I have 170 images (mostly png's of 5-10 KB) and ~55mp3 files. In Lite Version I have 45 images and 15 mp3s
Full Version has LVL (License Verification) implemented and Lite Version doesnot. Once LVL is passed, the code simply calls the Library Class
If I use Eclipse to build and deploy full version to phone (or emulator), it works correctly. (I guess this build and deploy will use debug key for signing)
I have error handling within the code to show code to show a dummypic (a question mark) if resource is missing. All my images are replaced with that question mark. Just to add.. This dummypic is in the Library and all other resources(images) are in Full Version.
I have checked the resources by renaming the signed apk file to .zip (thanks to NickT for suggesting this approach). All resource files (audio and images) are present in the zip file.
Any help is appreciated. The application is already in market and hence would like to minimise adverse impact.
Removed LVL. Still same error
Tried commenting the LVL code and directly calling the intent. Still same error.
By commenting the LVL, the code base for Lite and Full Version is identical. Only the resouce count is different. The full version has all the resources of Lite Version + ~5times the resource.
Update
This is how I temporarily fixed it.
I removed the library project and moved all classes and resources to the Implementation Project (Full Version). Now it is working.
As said, this is a temp fix only. I still need to know how I can fix this with library. Else I will have to create a lot of duplication of code.

My bet would be that it has to do with permissions.
The app that is being installed first, will have read-write permissions to that folder, the other will not.
Try using a ContentProvider to make your images accesible for both apps!

The sign shouldn't affect your code. I think the problem must be in the source code of Paid version.
Do you test in emulator? from eclipse? You can test the signed apk in emulator too through "adb install application-signed.apk".

I think you should uninstall and then re-install app, it happens sometimes, when your phone already has the application and you install it again with different resources and files without uninstalling(but overriding), it gives odd behavior,
try uninstall and then re-install should work for you.

I am not sure but i think no two apps of the same package name can co exist in a single device. try installing the apps in two different devices.

Two suggestions:
1) Do you have proguard enabled? If yes, try disabling it and test. If it works, you might need to update your proguard.cfg (probably with some -keep public class)
2) Delete your R.java manually and recompile your full version only!

I encountered this problem with Android projects using other Android Library projects. It looks like the AAPT (or an eclipse ADT part) sometimes fails when creating the R-file ids (So the resources are present, but the id's are not correct).
What quickly fixed the issue for me: Close the "master" project and reopen it having the Build Automatically option set or make a clean&rebuild on this project. The next exported APK shouldn't have the resources-not-found issue.

Maybe you let a debug flag into the Manifest file ?

Related

How do I check if the signing of an app is correct?

I'm developing some changes for an app. It worked properly and compile fine before I configured a VPN (I think this may be related to the problem). Since that the aplication compiles fine but I can't update from previous versions to the new one (let's say from 1.0.0 to 1.0.1), an error message says "The package appears to be corrupt". The version number and code are updated.
I've found this, but it doesn't fix my problem: I've compiled in release and debbug.
It's documentated that the problem is related with the signing of an app in Xamarin because I can install the apk from scracth without updating, I've loaded the keystore again, check the path %AppLocalData%, configure again the path manually... nothing. Besides, the 'debbug.keystore' file doesn't open when the app is compiled, nevertheless it's open when I use the command in the document to load it again. I don't know if it should open, just saying. The key file is the same, nothing else changed.
Thank you for your help!
The debug.keystore is as the name suggests, only for debugging. It will differ between different machines you install Visual Studio.
Make your own keystore and save it somewhere secure. Especially if you plan to release the App in Play Store. If you misplace it, you will have a bunch of issues.
Creating your own keystore will also ensure the same and correct signature every time, and you can configure your project to use your own keystore instead of the debug.keystore that Xamarin.Android defaults to.
I made everything above again and it worked, not sure what was wrong. For those of you that may have a similar problem that's what I tried:
Check your keystore (it must be the same for different compilations) and store in a safe place as Cheesebaron says.
Check you have well configured the path for your keystore.
You may have a wrong enviroment variable if the step above fails (i.e. %AppLocalData% pointing to other location).
Check your version number. The number for a version must be higher than previous versions, you may use YYMMddXX (XX for differnet compilations in the same day)
If you altern to compile in release/debug, make sure your code doesn't affect the path to the keystore

Firebase App Distribution APK will not install

I'm using the Firebase App distribution to send out updates to a few testers and the most recent APK I uploaded will not install on Android devices (actually it is several new versions that all have issues installing). I had previously uploaded a version that worked, but all subsequent updates fail with an 'App not installed' error message. I'm confused by the APK files that are generated from Android Studio and I don't recall which version I previously uploaded that worked. In the apk folder there is a debug folder that contains an apk file named app-debug.apk. I'm pretty sure this is the one I used with the successful version of the distribution. There is also a flutter-apk folder with an identically named file app-debug.apk. Does anyone know the difference between these files and which one I should use? That question is a side note as neither of those files work.
I have tried telling my testers to uninstall the previous (working) version and then try to update their Android with the latest version, but the error still occurs. I do not have any issues with my iOS version and that test group.
Do I need to update the debug.keystore file? I have searched many different threads for a solution and nothing seems to work. Any suggestions to debug the issue would be appreciated.
On Android, if the package exported by debug cannot be installed on some devices, such as "parsing failure", you can add a signature file to the debug version. It is better to generate it yourself, and do not use the tool's own. In addition, you can add a signature file to the debug version androidmanifast.xml Statement under application android:testOnly= "False", which may help you

Can not install my own generated apk

I updated my app and tested it on my device. Everything works fine if I test the app via the run button in eclipse but if I export it into an apk and try to install the apk it fails.
There is no error code or anything else, it just says the app has not been installed.
Any idea why this happens? I only changed a few things in my app: I removed the basegameutils lib from my app and migrated to the new api without basegameutils. Thats it (except for some bugfixes but that can not be the cause).
I did already restart eclipse and cleaned all projects mutiple times.
The target sdk is 22 and I am using newest system images and so on for that api level (my divce is a stock nexus 6 with 5.1.1 running). I also updated my build tools to 23.0.1 from 22.0.1 and removed the 22 version. Is this the cause?
I also tried to upload the apk in the dev console and there were no erros.
Thank you for your help.
EDIT:
The logcat output says the signature does not match the previously installed version.
If i try to install the current live version via the play store there is also an error message saying i can not install this app because another user already installed an incompatible version on this device (but i dont have it installed and i dont have multiple users on the device).
If i got to the app menu in the settings my app is shown at the bottom of the list but there is a note saying the app is not installed for the users. If i click on it all buttons are unclickable (so i can not uninstall it).
What is happening?
For me, selecting Signature Version v1 and v2 both solved the problem
Your signature changed, so as you mentioned you must uninstall the previous version. You tried to uninstall from the device UI and that fails - so try it from the command-line:
adb uninstall your_package_name
Seen on Nexus devices, occasionally only command-line uninstalls work.
I found a solution but I still have no idea what caused the problem.
somewhere on my device my app was still installed even though it didnt show up in the app drawer and the play store told me the same. In the settings/apps menu my app was still present (as i mentioned in the edit of my original post) so i clicked on it. If you click on the menu button you can chose unisntall for all users which did the trick. now I can install my apk again.
I have no idea how this happened but there you go, i hope this helps.
EDIT:
I had the same problem as this guy had. the accepted answer over there is much nicer than my poorly foramtted text ;)
"You cannot install this app because another user has already installed an incompatible version on this device"
I was facing same problem And I solved it this way, For Current Updated Android Studio 2.3
Build > Generate Signed apk.
Create Keystore path.
Put Password, alias, key password.
Build type select accordingly(eg to release in playstore use release).
Signature Version select both V1 and V2 checkboxes.
Finsih.
Go to the apk from explorer and use it for your playstore or in devices as Signed and Certified apk file.
For me the solution was to disable Play Protect on device.
You can not run signed apk directly in your android device .
I you want to run your apk then follow below steps :
1) Go to your device settings
2) In setting you find applications
3) In application checked unknown sources
This will allow you to run your signed apk without downloading from play store.
or
try this link :
"You cannot install this app because another user has already installed an incompatible version on this device"
The problem is because you have a version of your testing app. So, you're not really upgrading the app! Those are two different apps. You must first uninstall previous version (testing) so you can install the release (signed) version of your app.
I encountered this problem today and tried a few suggestions here, and this is how I solved the issue: I cleared my phone's caches / junk files and also uninstalled the test versions of the app and their APKs, and then reinstalled the new APK. Try this first before getting worried. 🙂
I got the save Error just incase someone faces this. For me it was because i have multiple projects for the same app on the phone. you need to delete older versions of the app from your phone.
If you have two options (V1 (jar signature) and V2 (Full APK Signature)) before generation signed apk. you should use V1 jar signature now, because there is no backward compatibility and all android phones with version < 7 won't accept this signature. Backward compatibility will be added in some next N Developer Preview.
There are also explanations on this developer.android in this link :
https://developer.android.com/about/versions/nougat/android-7.0#apk_signature_v2
In my case it was the proguardFiles path in build.gradle that caused this problem
Currently PlayStore performs regular checks for apps and device for harmful behavior. Installing signed APK manually is treated like unusually behavior so is preventend.
So turn off play protect feature temporary and your install will work as charm!
step one - open play store and select play protect
step two - click play protection setting button
step three - disable
step four - close and install your APK manually

Can't sign blackberry android app: Server response did not contain version

I'm trying to sign my Blackberry Android (ported) app for release to App World, but I can't get the tool to work. I've tried the eclipse plugin, the command line tools, and the online tool, but none will work. The eclipse plugin and command line tool just say:
Error: Server response did not contain version.
The online tool says that:
This APK was already packaged and signed, please update the APK’s version number to package again
Even though I've never successfully packaged it before. Does anyone have a solution to this problem?
Solved! It turns out that I did need to increase the version number, even though it had never successfully signed. The Blackberry signing server decided that versions 1 and 2 had already been signed (though they hadn't), so I just had to keep going until it worked.
Error: Server response did not contain version.
This error made me think that that wasn't the problem, but apparently both errors mean that the version is already in use. Just keep incrementing the version number until it works.
Need to increase the version code, until it works. This link might be helpful

What's the difference between a regular Android APK and one included as part of a device's system image?

We have a manufacturer that wants to pre-install our application on their Android device. We sent them the APK and even though it installs fine when used by a user, it appears to not get installed correctly when included in the manufacturer's build image. FYI, our application uses the JNI layer and some libraries built with NDK. The exception we're seeing seems to indicate that the class loader cannot find the library and is unable to load it. They have verified that the library files are indeed present in the APK.
Since we dont make devices, its unclear why they are seeing this exception and what needs to be done differently when including a package as part of the Android build image.
Any Android folks here care to comment?
I have worked with pre-installed Android apps, that also uses library files, in my case jar files. I am assuming that you have added the appropriate lines to AndroidManifest.xml like <uses-library android:name..... I am also assuming that you have provided instruction on how to install your library files on handset, with instructions like adb push ... on the command prompt. If you havent, do provide them the instructions.
Another issue may be permissions, we had to get the library jar AND the permissions xml file installed, that may be the issue.
Also ensure that you are using the correct version of Android for testing. And if everything fails, ask them to send one of the handsets that is not working to you and you can then compare with the one in office and debug this. Good Luck, as all this can be pretty frustrating.
Besides moving the apk file into /system/app, you should ask the manufacturer to move the native libraries created by NDK (.so files) to /system/lib or the path specified by LD_LIBRARY_PATH.
Please refer to https://groups.google.com/d/topic/android-porting/r_Ao7_PWgKQ for more details.

Categories

Resources