For some reason, I am never able to install the APKs I build. I build successfully, but it always "appears to be corrupted". I have no idea what this could depend on. Would sending you the APK I build help? What can I do? I'm on a Ubuntu and I think I've configured Android Studio and everything correctly (or it wouldn't even build, right?).
Hi @someoneEsle and thanks for trying out our app. Sorry for the somewhat limited build instructions, we plan to make the documentation a more detailed soon, but at the moment we are a bit overloaded with feature development.
In the mean time let's see if we can get you up and running.
I suggest build from command line to start with and once you got that working, move to Android Studio and see if you can get it working there.
When you open our project in Android Studio you will be prompted to update the Gradle plugin from version 1.5.0 to 2.2.0 (?). Don't do this. If you already have, you will need to revert this. Our current build setup will not work unless you have version 1.5.0.
In our GitHub repo master branch is our development branch and release is latest release (which we publish in Play Store). If you prefer master I suggest you use the dev flavour of the app, and if you prefer release branch, you should use the prod flavour.
After cloning the repo, make sure there are no changes to build config files
git status
Then to build a dev build do
git checkout master
./gradlew clean
./gradlew assembleDevDebug
This will most likely fail due to a build issue related to our Scala bits (_BaseScalaActivity.scala:23: illegal inheritance;....?_) , and you'll have to run the same command once more. We hope to have a fix for this soon.
./gradlew assembleDevDebug
Given you have all the required Android SDKs/libs, you should now have an APK in app/build/outputs/apk/app-dev-debug.apk.
Should you want to make a build from the release branch, please to the following
git checkout release
./gradlew clean
./gradlew assembleProdRelease # will fail, we are working on a fix
./gradlew assembleProdRelease
And you'll find the resulting APK in app/build/outputs/apk/app-prod-release-unsigned.apk. You'll need to sign this APK before you can install it. See https://developer.android.com/studio/publish/app-signing.html for details.
Also note that you cannot install your own Prod build if you have the official version installed on the same phone, as the package ID is the same and your APK will not be signed with the same certificate is the official one.
Hope this helps you along a bit. Please let me know how you are getting on.
Cheers,
H氓kon
Hi, thank you for answering.
I do always build using command line -- can't be bothered with how slow Android Studio runs on my computer :)
The first thing I don't understand is this: you say to use gradle 1.5, which I do, but then when I give the command ./gradlew it fetches the 2.13 version, as you specified in the wrapper:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip
So my first doubt is whether I should really use ./gradlew or use the gradle version (1.5) that I downloaded manually. I tried both but neither seem to work (they, however, throw different errors).
Also, I thought I'd read on github that the Dev flavor wouldn't work for us because it uses internal backend, is this correct?
Hi,
I mean the Gradle plugin specified here: https://github.com/wireapp/wire-android/blob/master/build.gradle#L13
As long as you don't have any local changes you should be able to build the project.
Regarding the dev flavour, you _can_ use it as it now asks you what backend to use on the first launch. As long as you select the prod backend, you should be fine. The edge/staging backends are for internal use only and will only work for whitelisted users.
Solved.
Solution: I reinstalled everything several times until it magically(?) worked. Now I can build APKs that I can also install.
+1
I have the same issue
@someoneEsle What do you mean by you reinstalled everything ? Any particular order ? What components did you reinstall ?
Hi, i honestly don't remember :/ try reinstalling all the tools you use to build and it might start working
You need to build the apk first by :-1 Build > Build apk(s)
This is because of security issue. if any non-developer want your APK, so its easily to get it from your folder. so now it does not happen only developer will able to create sharable APK.
@JitenderVerma has a correct fix for the issue.
You need to build the apk first by :-1 Build > Build apk(s)
This is because of security issue. if any non-developer want your APK, so its easily to get it from your folder. so now it does not happen only developer will able to create sharable APK.
That works for me!!! Thanks a lot. @JitenderVerma
Prerequisite - You must have a keystore file, If you don't have then Open cmd run keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 follow instructions and you are done.You will have a keystore file. Now follow these steps.
1 .On windows cd android and then run gradlew assembleRelease
2 .Find APK at this location android/app/build/outputs/apk/release/app-release-unsigned.apk
3 .Copy this APK to bin folder of jdk installation directory ( for me directory was C:Program FilesJavajdk1.8.0_181bin ) [ Basically in this step we are trying to go to the same directory as jarsigner]
4 .Also Copy your keystore file to this ( C:Program FilesJavajdk1.8.0_181bin ) directory.
5 .Now Open cmd in Administrator mode and run cd C:Program FilesJavajdk1.8.0_181bin
6 .Now run jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore
<
Here goes your apk , now find your signed apk here cd C:Program FilesJavajdk1.8.0_181bin . Run it, Now it should install.
Most helpful comment
You need to build the apk first by :-1 Build > Build apk(s)
This is because of security issue. if any non-developer want your APK, so its easily to get it from your folder. so now it does not happen only developer will able to create sharable APK.