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

Don't set a signing config on debug builds #762

Closed
wants to merge 1 commit into from

Conversation

Plastix
Copy link
Contributor

@Plastix Plastix commented Oct 14, 2018

This commit updates the app module's gradle script so that the signing
config property is only set on release variants. This meanst thats if
you don't have any real signing keys configured with a
signing.properties file you can still build and install a debug
version of the app.

@PaulWoitaschek I doubt you ran into this issue since I assume you set up your signing keys once and forgot about it. This fix allows me to build the app on my machine.

This commit updates the app module's gradle script so that the signing
config property is only set on release variants. This meanst thats if
you don't have any real signing keys configured with a
`signing.properties` file you can still build and install a debug
version of the app.
@PaulWoitaschek
Copy link
Owner

This came up in #753 and should have been fixed by a9d817f

Doesn't it work?

@PaulWoitaschek
Copy link
Owner

PaulWoitaschek commented Oct 14, 2018

To explain me: I want the same signing in debug and release builds (for example because else I can't test Android Auto.)
Therefore I added a keystore explicitly for the CI. If the signing.properties is not found, the CI key is being used.
See:

signingConfigs {
create("release") {
val props = Properties()
var propsFile = rootProject.file("signing.properties")
if (!propsFile.canRead()) {
println("Use CI keystore.")
propsFile = rootProject.file(".circleci/signing/signing.properties")
}
props.load(propsFile.inputStream())
storeFile = rootProject.file(props["STORE_FILE"]!!)
storePassword = props["STORE_PASSWORD"] as String
keyAlias = props["KEY_ALIAS"] as String
keyPassword = props["KEY_PASSWORD"] as String
}
}

@Plastix
Copy link
Contributor Author

Plastix commented Oct 14, 2018

Yea it should use the CI signing key. I'm getting the following error:

AGPBI: {"kind":"warning","text":"Methods with invalid locals information:\n  java.lang.Object de.ph1b.audiobook.data.repo.BookRepository$updateBook$2.doResume(java.lang.Object, java.lang.Throwable)\n  Attempt to read local this but no local information was associated with the value being read.","sources":[{"file":"/Users/Pieper/AndroidStudioProjects/Voice/data/build/intermediates/intermediate-jars/debug/classes.jar"}],"tool":"D8"}
> Task :app:transformClassesWithDexBuilderForOpensourceDebug
> Task :app:transformDexArchiveWithExternalLibsDexMergerForOpensourceDebug
> Task :app:transformDexArchiveWithDexMergerForOpensourceDebug
> Task :app:transformNativeLibsWithMergeJniLibsForOpensourceDebug UP-TO-DATE
> Task :app:transformResourcesWithMergeJavaResForOpensourceDebug
> Task :app:packageOpensourceDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageOpensourceDebug'.
> com.android.ide.common.signing.KeytoolException: Failed to read key ci from store "/Users/Pieper/AndroidStudioProjects/Voice/.circleci/signing/ci.jks": Invalid keystore format

What is wrong with using Android Studio's default debug signing config? (Which is what this PR defaults to)

@PaulWoitaschek
Copy link
Owner

Are you building on windows? Do you use an outdated java version? Do you have changed the signing.properties?
On my machine and on the CI (both linux) there is no issue.

What is wrong with using Android Studio's default debug signing config? (Which is what this PR defaults to)

I already answered that:

To explain me: I want the same signing in debug and release builds (for example because else I can't test Android Auto.)

@Plastix
Copy link
Contributor Author

Plastix commented Oct 14, 2018

I'm building on MacOS 10.14 (Mojave) with Java 1.8.0_40. This is when compiling master without changing any local property files.

@PaulWoitaschek
Copy link
Owner

That's weird.

When doing a clean pull of the master on MacOS and a ./gradlew app:assembleProprietaryDebug, it just builds without issues.
Can you check that?

@Plastix
Copy link
Contributor Author

Plastix commented Oct 14, 2018

./gradlew app:assembleProprietaryDebug fails with the same issue.

@PaulWoitaschek
Copy link
Owner

Even after a clean checkout?
I updated my mac to Mojave and am on java:

# java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

If this still doesn't work can you create a CI keystore that works for you and replace the current jks one and send a PR?

@Plastix
Copy link
Contributor Author

Plastix commented Oct 16, 2018

Yep it still is failing on my machine. No idea why.

@Plastix Plastix closed this Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants