Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Gradlew "build successful", now what? #1457

Closed
SafwatHalaby opened this issue May 6, 2014 · 30 comments
Closed

Question: Gradlew "build successful", now what? #1457

SafwatHalaby opened this issue May 6, 2014 · 30 comments

Comments

@SafwatHalaby
Copy link

Hi, This is my first Android APK build. Sorry if the mistake is too obvious, it isn't for me.

I followed the instructions found here (1 to 5): https://github.com/WhisperSystems/TextSecure/blob/master/BUILDING.md

The result was this:

signing.properties not found
:help

Welcome to Gradle 1.11.
To run a build, run gradlew ...
To see a list of available tasks, run gradlew tasks
To see a list of command-line options, run gradlew --help
BUILD SUCCESSFUL
Total time: 5.701 secs

Now what? I did not get an APK.

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

I also answered on the other thread, but your APK is in ./build/apk/ from your git clone directory :)

You want TextSecure-release-unsigned.apk. You will have to sign it yourself.

@SafwatHalaby
Copy link
Author

That's what Google said as well, but I don't have such a directory.

@SafwatHalaby
Copy link
Author

gradle_out

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

Did you also run ./gradlew clean ?

That command will delete your build directory. Re-run ./gradlew build and look for the folder then.

@SafwatHalaby
Copy link
Author

Am I supposed to have a bin with the name"gradle" or is this a typo?
I only have "gradlew".

I did not run "./gradlew clean".

And I appreciate your help :)

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

Sorry, I made a typo. You are correct- it should be ./gradlew build

I would re-run the command and watch the folder.

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

Are you on Linux or Cygwin?

@SafwatHalaby
Copy link
Author

Turns out I am using "./gradlew" instead of "./gradlew build". Oops!

Now I'm getting an error regarding not having JDK, I think I can resolve that.
Will post an update :)

@SafwatHalaby
Copy link
Author

Do I need openJDK 6 or 7? Does it matter?

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

I don't /think/ it matters. Try one and see.

For later, here's my ./gradlew build output:

signing.properties not found
:compileDebugNdk UP-TO-DATE
:preBuild
:preDebugBuild
:checkDebugManifest
:preReleaseBuild
:library:compileLint
:library:copyReleaseLint UP-TO-DATE
:library:mergeReleaseProguardFiles UP-TO-DATE
:library:packageReleaseAidl UP-TO-DATE
:library:preBuild
:library:preReleaseBuild
:library:checkReleaseManifest
:library:prepareReleaseDependencies
:library:compileReleaseAidl UP-TO-DATE
:library:compileReleaseRenderscript UP-TO-DATE
:library:generateReleaseBuildConfig UP-TO-DATE
:library:mergeReleaseAssets UP-TO-DATE
:library:generateReleaseResValues UP-TO-DATE
:library:generateReleaseResources UP-TO-DATE
:library:packageReleaseResources UP-TO-DATE
:library:processReleaseManifest UP-TO-DATE
:library:processReleaseResources UP-TO-DATE
:library:generateReleaseSources UP-TO-DATE
:library:compileReleaseJava UP-TO-DATE
:library:processReleaseJavaRes UP-TO-DATE
:library:packageReleaseJar UP-TO-DATE
:library:compileReleaseNdk UP-TO-DATE
:library:packageReleaseJniLibs UP-TO-DATE
:library:packageReleaseLocalJar UP-TO-DATE
:library:packageReleaseRenderscript UP-TO-DATE
:library:bundleRelease
:prepareComActionbarsherlockActionbarsherlock440Library UP-TO-DATE
:prepareOrgWhispersystemsTextsecureLibrary01Library UP-TO-DATE
:prepareSeEmilsjolanderStickylistheaders220Library UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:compileDebugJava UP-TO-DATE
:preDexDebug UP-TO-DATE
:dexDebug UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:validateDebugSigning
:packageDebug UP-TO-DATE
:assembleDebug UP-TO-DATE
:checkReleaseManifest
:prepareReleaseDependencies
:compileReleaseAidl UP-TO-DATE
:compileReleaseRenderscript UP-TO-DATE
:generateReleaseBuildConfig UP-TO-DATE
:mergeReleaseAssets UP-TO-DATE
:generateReleaseResValues UP-TO-DATE
:generateReleaseResources UP-TO-DATE
:mergeReleaseResources UP-TO-DATE
:processReleaseManifest UP-TO-DATE
:processReleaseResources UP-TO-DATE
:generateReleaseSources UP-TO-DATE
:compileReleaseJava UP-TO-DATE
:lintVitalRelease SKIPPED
:compileReleaseNdk UP-TO-DATE
:preDexRelease UP-TO-DATE
:dexRelease UP-TO-DATE
:processReleaseJavaRes UP-TO-DATE
:packageRelease
:assembleRelease
:assemble
:compileLint
:lint
Ran lint on variant debug: 1624 issues found
Ran lint on variant release: 1624 issues found
Wrote HTML report to file:/home/username/Documents/TextSecure/build/lint-results.html
Wrote XML report to /home/username/Documents/TextSecure/build/lint-results.xml
:check
:build
:library:copyDebugLint UP-TO-DATE
:library:mergeDebugProguardFiles UP-TO-DATE
:library:packageDebugAidl UP-TO-DATE
:library:preDebugBuild
:library:checkDebugManifest
:library:prepareDebugDependencies
:library:compileDebugAidl UP-TO-DATE
:library:compileDebugRenderscript UP-TO-DATE
:library:generateDebugBuildConfig UP-TO-DATE
:library:mergeDebugAssets UP-TO-DATE
:library:generateDebugResValues UP-TO-DATE
:library:generateDebugResources UP-TO-DATE
:library:packageDebugResources UP-TO-DATE
:library:processDebugManifest UP-TO-DATE
:library:processDebugResources UP-TO-DATE
:library:generateDebugSources UP-TO-DATE
:library:compileDebugJava UP-TO-DATE
:library:processDebugJavaRes UP-TO-DATE
:library:packageDebugJar UP-TO-DATE
:library:compileDebugNdk UP-TO-DATE
:library:packageDebugJniLibs UP-TO-DATE
:library:packageDebugLocalJar UP-TO-DATE
:library:packageDebugRenderscript UP-TO-DATE
:library:bundleDebug
:library:assembleDebug
:library:assembleRelease
:library:assemble
:library:lint
Ran lint on variant debug: 8 issues found
Ran lint on variant release: 8 issues found
Wrote HTML report to file:/home/username/Documents/TextSecure/library/build/lint-results.html
Wrote XML report to /home/username/Documents/TextSecure/library/build/lint-results.xml
:library:check
:library:build

BUILD SUCCESSFUL

Total time: 35.538 secs

@SafwatHalaby
Copy link
Author

Thank you. The Android SDK docs mention JDK 6, I will go with that.

Reference:
http://developer.android.com/sdk/index.html
Bottom right.

@SafwatHalaby
Copy link
Author

What a disappointment, after finally obtaining an APK, my phone failed to install it. The only message is "Application not installed".
Is there any way I can pinpoint the issue?
Is the APK specific to an Android version?

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

Yes! That is because it is not signed.

@SafwatHalaby
Copy link
Author

But "Unknown sources" is ticked in the settings, shouldn't that be enough?

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

No. Android will not install an unsigned app. Unknown Sources simply means that the signer is not Google.

keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 4096 -validity 10000

then

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore
my_application.apk alias_name

The build was successful, so I wouldn't worry about the build log differences.

@SafwatHalaby
Copy link
Author

Error - "alias_name" is not a legal command.

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

In my comment at first I typo'd the keytool command and forgot the space in "my-release-key.keystore -alias". I edited with the correct command- that typo would cause this error.

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

Also, feel free to replace "alias-name" and "my-release-key.keystore" with names of your own choice.

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

Also also, I probably don't have to say it, but in the jarsigner command, replace "my_application.apk" with your unsigned TextSecure apk.

@SafwatHalaby
Copy link
Author

Your command is still incorrect, I used this instead:

keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore TextSecure-release-unsigned.apk alias_name

Reference:
http://developer.android.com/tools/publishing/app-signing.html

@SafwatHalaby
Copy link
Author

Thanks, will now test :)

@SafwatHalaby
Copy link
Author

It worked. That was indeed a great experience.
Many thanks!

This issue can be closed.
Perhaps the signing process should be added to the installation instructions.

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

I am at a loss as to how our commands are different, aside from the RSA key size. But I am glad it worked for you :)

@SafwatHalaby
Copy link
Author

"Sorry, this device is not supported for data messaging. Devices running versions of Android older than 4.0 must have a registered Google Account."

Lol, the irony.
My quest of avoiding Google is what led me to building in the first place.
Uninstalling.

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

That's what Websocket will eventually fix. Normal messaging will still work.

@SafwatHalaby
Copy link
Author

Oh, that's good news.
SMS does not guarantee delivery, does TextSecure resolve that?

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

Unfortunately, not to my knowledge.

What you can do, though, is request delivery reports for each SMS.

@SafwatHalaby
Copy link
Author

This issue can be closed.
I appreciate your help, @rdsqc22 :)

@SafwatHalaby
Copy link
Author

Any ETA for Websockets?

@rdsqc22
Copy link

rdsqc22 commented May 6, 2014

Not at the moment. You can follow the discussion here: #1000

It would appear to still be in its early stages.

@SafwatHalaby SafwatHalaby changed the title Question: Gradlew "build succesful", now what? Question: Gradlew "build successful", now what? May 6, 2014
@mcginty mcginty closed this as completed May 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants