issue installing apk modified in apktool - android

I've been trying to change the package name for an android apk, but I've ran into some trouble.
I changed the package name as per this answer, signed, and zipaligned it. However, whenever I try to adb install modified.apk, it gives me the following error:
Failure [INSTALL_FAILED_DUPLICATE_PERMISSION]
How can I fix this? I have already tried changing all of the references to the old package name in the AndroidManifest.xml, but that caused some of the references to xml files in /res/ to break.
Any help would be appreciated.
Edit 12/15:
Still haven't figured this out and I can't find any documentation on this issue in the context of what I'm trying to do. Still looking for a solution.

Related

AndroidManifest no resource found

Ia m building react native app thats compatible with both ios and android platforms. But when I am trying to Build signed APK on Android Studio for Android platform then I am getting No resource found error in AndroidManifest file even though these files exist - anyone any idea ?
build.gradle
I think this must be a simple typo - you misspelled mipmap (you typed mitmap instead) - change the line from android:icon="#mitmap/ic_launcher into android:icon="#mipmap/ic_launcher. Hopefully the other error also disappears after fixing this? Please give it a try and let me know.
Try to run a clean after correcting the typos

Extracted code from apk showing a number of java code errors

I recently read about the concept of reverse engineering and wanted to try it.
So I downloaded an apk and extracted it source code by using
apktool, dex2jar and jd-gui
Every thing went on smoothly and I extracted the resource as well as java files successfully. However the problem arose when I tried to import this project in android studio.
Initially it was showing a number resource files related errors which I corrected by changing the dependencies of the project but now I am getting all these weird errors in java files.
The errors include "not a statement', 'variable not initialized' etc.
Kindly Help. Thanks in Advance!
I have extracted code from apk before myself, and the results I got were similar to yours. I got most of the code, but not all of it and not with all of the formatting. Numerical constants were missing and the the "if, while, for" instructions were faulty. I don't know if this always happens, I did it only once, but I managed to figure out the rest of the code by what this processes gave me in the begging.

"java.exe" exited with code 2

I added Google play services to my project for maps but now keep getting this error "java.exe" exited with code 2.
I am not sure if it is different from "java.exe" exited with code 1 but I have tried all the suggestions online
My heap size is 1G. My target version is 21, I have clean rebuild etc..
When I click on the error it takes me to this CompileToDalvik.
How can I resolve this? Even if I remove google play services I still get this error( clean / refresh rebuild etc..)
We had similar issues and nailed it down to our app going over 64k (65,536) methods limit which could be what's happening when you reference google play services.
Enabling multidex resolved our issue so may be worth trying.
Google Multi-Dex Reference:
http://developer.android.com/tools/building/multidex.html
Using Visual Studio and Xamarin I got this error because I had a wrong path for the Keystore in the .csproj file, and for some reason this path did not get updated while changing the path for the Keystore in the Visual Studio GUI.
Manual correcting the path in the .csproj file solved it for me.
None of the others answers worked for me. What worked for me (but I don't know why) was to empty my bin and obj directories before doing a rebuild.
I've seen this error recently. It was caused by an invalid (layout) xml file. Unfortunately, you don't get more hints where exactly the problem is :( I'd try to exclude the xml files one by one and check if the build succeeds without a certain file. Good luck!
Edit : I'm not even sure it actually was a layout xml file, maybe it has been a style or color xml :/ Any recent changes to one of those?
Increasing the Java Heap Size to 1G is worked for me!
Clean the Bin and the Obj folders, and rebuild again.
If it doesn't work please check different JDK version.
I had this error when switching from VS Mac to VS Windows.
Here the topic Switching From VS Mac To VS Windows got “java.exe” exited with code 2
The issue was comming from the Android.csproj and the Keystore Path.
It was set to my Mac Path even if I had already changed it on
VSWindows AndroidProject => Properties => Signin
So I removed this lines on Android.csproj (edited with third text editor):
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>YourMacPath/Alias.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>Password</AndroidSigningStorePass>
<AndroidSigningKeyAlias>Alias</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>AliasPassword</AndroidSigningKeyPass>
On debug & release Part.
Then you can edit them on VS Windows.
Hope I helped someone.
See ya
Now in VS 2022, I had the very same problem and nothing would work. I had noticed that, at least in my case, problem started when I accidentally lost the certificate from the keystore. For debugging mode I just took the signature out since it provides it's own. However, I will need to re-add the key once I change to release. Once the proper key is found in the keystore, the problem is resolved. Apparently that error code is useless.

Error in Eclipse when trying to export apk

I'm trying to export my game apk for publishing to the store, but then I get an error saying 'compilation issues', how do i fix this? I've tried everything, it still doesnt get fixed, and when i go to my project theres a red x over my project, i'm guessing this might be the error, please refer to the screenshot
http://postimg.org/image/osiir584t/
Follow the Steps :
1.Remove Automatic build selection
2.Clean your project
3.Build the project
4.Export the apk
First fix your project's error then you can export it.
Fix your project code(Make sure that don't present any error) that gives compilation error.
Clean your project
Then export for publish your app..
Well, unsurprisingly this means the compiler runs into problems when compiling the release apk. These errors should appear in either the 'Problems' view or one of the consoles (you may need to switch between them). Finding those will help track the actual problem down.
Also, since you mentioned changing package names you may want to check my answer here: Serializing CDT Project settings has encountered a. I'm fairly certain that changing the package name for my project was what caused Eclipse to corrupt my project configuration back then.

can't sign android app lite version with same private key

i just signed my paid app and now i want to sign a lite version of it with the same private key. my problem now is that, am receiving this error:
jarsigner: unable to open jar file.
do i have to create another keystore for it? or is the problem coming from the fact that i am saving it as a different file name? what can i do? Thank you
The problem is definitely not related to the fact that it is a lite version. I find it curious that the error message is Jarsigner: Unable to open jar file.
Some searching around leads me to believe you are making some typing error in your command (please revisit the steps found here http://developer.android.com/guide/publishing/app-signing.html#signapp )
Also some other searching I did pointed to difficulties someone had with certain file names. Is your .APK name elaborate? Another instance of this problem I found ( http://coding.derkeiler.com/Archive/Java/comp.lang.java.help/2005-09/msg01002.html ) was claimed to be solved by simplifying the name.
Also make sure you are actually pointing to the .APK. Try typing out full paths to the file if you're not already.
I see an issue where i was using the full paths and it did not work, if you are having this problem, then just ensure that the .apk and the .keystore file is in the same destination. For my scenario I moved the apk to the root folder and run command and it worked. Hope this helps.

Categories

Resources