When I build with Export Signed Application Package in Eclipse, and I use the keystore I created the first time, it works.
Now I'm trying to use ANT to build the release APK (not debug), but, when I try to install the new APK on my real phone (not emulator), it trhows an existing package by the same name with a conflicting signature and I can't install.
Of course, this means that the signature is incorrect, or something simialar with the password.
This is the info I put in local.propeties
sdk.dir=D:\\Documents\\Applications\\Android SDK
key.store=D:\\Projects\\myProject\\signature_key
key.alias=two words
key.store.password=PasswordUsing$and%
key.alias.password=PasswordUsing$and%
Yes. The key.alias has 2 words (my mistake, but it's late now)
1) Is the format valid? Should I use quotes for the alias? Should I escape $ or % characters in the password?
2) What format should I use in local.properties to make the keystore/password be valid?
3) Is there something I'm missing?
This is perfectly normal behaviour if you have previously loaded the debug version of your app on your phone. The OS recognises the package as being already present and refuses to install the release version which has been signed with a different key.
You must uninstall the debug version first, then install the release one.
If you are wanting to deploy your app to the Play Store, you will need to create your own keystore (not re-use the debug keystore the tools use to build your app by default).
Export your project using the Export Wizard (right-click on the project, Android, Export...)
When going through this Wizard, there is a selection to generate a keystore, go through that, and save the resulting keystore files (somewhere safe, if you lose these, you will NEVER be able to deploy your app again to the Play Store).
I think you should skip ANT, and instead use the Wizard GUI.
Also - keep in mind if you deploy a debug build, you will need to uninstall it, before deploying your officially signed APK.
Related
i have a debug mode APK which i need to convert into release Build.
the main issue is i lost source code and keyStore file of that APK.
and app is already on playstore.
so can we change Debug Build to Release Build in this case.
Usually when you lose your keys used for signing APKs or App Bundles, you can request a new one. Losing your source code. That's a bit interesting. Don't you use Git? I don't suppose you'd have non-existant version control on a "complex" project. I'm forced to assume your app isn't too complex and could be therefore created from scratch with no trouble... Take better care and make sure to use VC and backup your keys.
Yes you can reverse engineering your own app using this tool:
https://ibotpeaches.github.io/Apktool/
You have to decode your debug apk using:
apktool d debug-app.apk
And then build again the release apk:
apktool b debug-app
Then, Sign it with your own keystore.
I'm building a simple calculator app from a tutorial/class on Pluralsight (Java Fundamentals class), which starts with a Main.java file, and adds a class file later, MathEquation.java.
I created a Git repo to track my progress, and uploaded to Github: JavaFundamentalsClass. I used GitIgnore.IO to find a Java IntelliJ .gitignore file, and everything seemed to be working fine on the original PC I was using.
However, after switching over to a different PC, with a fresh install of IDEA, I cloned down the repo from Github, and found that the project would not build and/or run. I get this error:
"C:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.191-1\bin\java.exe" -Dfile.encoding=windows-1252 -jar ""
Error: Unable to access jarfile
Process finished with exit code 1
I suspect that there is something in the .gitigore file that is keeping some of the project, dependency, or build information from being saved in the repo that keeps IDEA from having all the info it needs to build and run the Main.java correctly.
Can anyone help? You should be able to download the project from the repo linked above in it's currently broken state, including the .gitignore file.
Additional Info
I wiped my repo clean and recloned and I forgot, originally it doesn't even give me the run button (it is grayed out). I had to do a procedure with "Add Configuration" from a search I did for that to show up to get the error above.
Also, I did install java from the OpenJDK, rather than oracle. I figured with Oracle cutting off commercial development maybe start the switch now as I'm learning, but maybe that's the issue (normal Java on my other PC).
It's working, but...
First thing - Intellij needs to know where Java is. It appears that if the SDK/JDK is not installed prior to Intellij, you will need to tell it where Java is after installing. Or if you use OpenJDK instead of Oracle Java SDK. You can do that at View/Open Library Settings, under Platform Settings / SDKs (select the JDK home path).
Then, after setting up Java, I am able to get everything working in Intellij IDEA if I find the Main.java file, right-click, and choose "Run main.main()". This runs the program okay, and also creates a Main configuration in the Run/Debug configuration area, and finally the "Run" button becomes available.
So I can get it working, but if I wipe all the files and clone it fresh from the remote repo, I have to go through running the Main.java file directly again to recreate the configuration.
So, this still doesn't answer my original question. Why doesn't this configuration get saved in the repo? What file is this information saved in? Is there something in the .gitignore file that is keeping this information from being saved to the repo?
Look like you have a different java version on your second machine.
First of all, check your java version
Update the configuration of your project, right now it pointing to java 1.8
https://github.com/LightCC/JavaFundamentalsClass/blob/master/.idea/misc.xml
I think it might be because of java not installed on the other PC you were trying. If it is installed just check whether the path mentioned has java executable file.
The first part is ensuring Java is setup, and that Intellij IDEA knows where Java is, per the other answers, comments, and addendums to the question.
The second part is setting up the run/debug configuration, per the "It's working but.." section of the question. This can be created automatically by right-clicking the file that has the main class to be run (usually Main()...), and selecting the "Run Main.main()" option (replacing Main and main() with the file and function which needs to be run)
The final piece is that to get the run/debug configurations to save to the repo, you either need to:
Share the workspace.xml file (i.e. make sure this is not in the .gitignore file). However, there is a lot of user-specific stuff in that file, so it should normally be excluded from the repo.
Or, edit the configuration and checkmark the "Share" box in the upper right-hand corner (just right of the "Name" field). This will put the configuration into a separate folder inside the .idea folder, which should not be excluded from the repo by .gitignore.
jarsigner is not working in java , therefor the build fails
[signjar] jarsigner: unable to sign jar: no response from the Timestamping Authority. When connecting from behind a firewall an HTTP or HTTPS proxy may need to be specified. Supply the following options to jarsigner:
[signjar] -J-Dhttp.proxyHost=<hostname>
[signjar] -J-Dhttp.proxyPort=<portnumber>
[signjar] or
[signjar] -J-Dhttps.proxyHost=<hostname>
[signjar] -J-Dhttps.proxyPort=<portnumber>
There is no error in the project build path. All the dependencies are imported in the build path.
Here's the problem as I understand it:
Your are attempting to build a project with an Ant "build.xml" file.
You are running the build from within Eclipse.
You are running Eclipse in a VM that has no internet access.
The build fails during JAR signing when jarsigner attempts to talk to a time stamp authority (TSA). Internet access is required to talk to a TSA.
Also I am not sure why is this error encountered.
It is because you are trying to use signature timestamps, and your build system doen't have direct internet access, and you haven't provided a http or https proxy in the appropriate fashion for jarsigner to use.
There are a couple of ways to solve this. (The following is based on the documentation. I haven't tested this.)
If you have an internet proxy available:
The simplest way is to edit the "signjar" task in your "build.xml" and add "tsaproxyhost" and "tsaproxyport" attributes as described in the Ant manual.
If you are building on the command line1, you should just be able to follow Ant instructions for Proxy Configuration. (There are two approaches ...)
If you are running the build using Eclipse, then you could find the Eclipse "runner" configuration that is used to run Ant, and then add command line as per the previous bullet.
(I think that the error message that talks about -J-D... options is coming from the jarsigner utility itself. That advice is only directly applicable if you are running jarsigner directly from the command line. That is, of course, another option.)
If you don't have a working proxy (or you are just fed up) the other alternative is to edit the "signjar" task to disable signing. Removing the "tsaurl" and "tsacert" attributes should do it.
Disabling timestamps will give you a signed JAR without signature timestamps. The significance is explained by the Oracle Signature Timestamp Support documentation:
"Prior to J2SE 5.0, the signature generated by jarsigner contained no information about w hen the signature was generated. With no other information available, systems/deployers (including users of the Java Plug-in) often based their validity assessment of a signed JAR file on the validity of the signing certificate. When the signing certificate expires, systems/deployers conclude that the signature, and hence, the JAR file, has expired. Because signing certificates typically expire annually, this caused customers significant problems by forcing them to re-sign deployed JAR files annually.
Starting in J2SE 5.0, jarsigner can generate signatures that include a timestamp, thus enabling systems/deployer (including Java Plug-in) to check whether the JAR file was signed while the signing certificate was still valid. In addition, APIs were added in J2SE 5.0 to allow applications to obtain the timestamp information."
1 - I recommend you download and install a free-standing Ant, so that you can run builds from command line.
I want to increase the initial RAM allocated to run a particular jar that needs it. However, passing the parameter "-xms1g" to the system JRE seems to prevent the launch of a JNLP file that I need to submit credentials for access to the U.S. Patent Office Private PAIR website:
https://ppair.uspto.gov/TruePassWebStart/AuthenticationChooser.html > "Authenticate with Java Web Start (new method)".
When the JNLP launches properly, it opens a GUI that prompts you to entire the filename and path of a certificate in one field, and a password in another field, and then it automatically closes and brings up the private PAIR website in your web browser, if your credentials are valid. You don't have to have a certificate or password to duplicate or test for my issue, as my problem is not getting the prompt to pop up.
For consistent testing and development of my jar, I want to run it on the latest JRE release, which I have to assume other users of my jar will be running. I believe I may also need to use the latest JRE release when launching the JNLP to access the USPTO, for security reasons. Maybe someone who understands cyber-security better than I do could tell me that JRE version doesn't matter when I am launching a JNLP file instead of running an applet through the Java browser plugin (the so-called "old method"), the latter plugin being what Google Chrome stopped supporting, but I don't want to assume that.
So ideally I would like to have two installed instances of the same (latest) JRE version and pass the -xms1g parameter only to the instance I use to run my jar, not to the (system) instance that launches the JNLP. Is this possible? When I tried executing the JRE installer twice, selecting different folders, I found that the second installation had deleted everything from the first folder.
So ideally I would like to have two installed instances of the same (latest) JRE version and pass the -xms1g parameter only to the instance I use to run my jar, not to the (system) instance that launches the JNLP. Is this possible? When I tried executing the JRE installer twice, selecting different folders, I found that the second installation had deleted everything from the first folder.
You do not need two installations of the same JRE to run different java processes with different options. Ensuring that is the purpose of providing them as command-line options. You can choose the non-default options you want when you launch the JVM, whether by configuring them in a shortcut, recording them in a launch script (taking the form of a batch file on Windows), or typing them manually on the command line.
i have lost my old debug.keystore file and i generated a new one, when i build my new apk and i want to update the old one in my phone it show me "Android App Not Install. An existing package by the same name".
Can any one help me what should i do? can i modify the debug.keystore with the old sha1 ???
Can any one help me what should i do?
Uninstall the existing app.
can i modify the debug.keystore with the old sha1 ?
No.
You will not be able to publish an update on Google Play if the app is signed by a different keystore than the one first published. You'll need to change the package name, resulting in a new app on Google Play.
If the old app isn't published just go ahead and uninstall the old app to be able to install the new.
Hi I had Shared the steps, It will definitely resolve the issue regarding Unity Android App Not Installed
UnInstall Existing App
Check is you bundle identifier is same with previous build
PlayerSettings > Enable build il2cpp Armv7 and 64bit build and donot split the build
Assign the keystore and assign password
Set the player setting SDK Card to Automatic
Make Sure your previous build is assigned with same keystore
Target Api Level should be Equal or greater than previous one