Skip to content

Android Code Signing instructions #52

@jennie-b

Description

@jennie-b

Description

The Problem

I am trying to implement Code Signing for Android following your public documentation: https://docs.bitrise.io/en/release-management/codepush/code-signing-with-codepush.html

Following the official docs and legacy Bitrise guides, developers are instructed to manually intercept the auto-linked package in MainApplication.kt and use either the CodePush constructor or the CodePushBuilder. Neither of these approaches seem to work in v10.4.1.

What I Tried & The Errors

Attempt 1: Using CodePushBuilder (As referenced in various setup guides)
When trying to use the builder to set the public key and server URL:

val customCodePush = CodePushBuilder(getString(R.string.CodePushDeploymentKey), applicationContext)
    .setIsDebugMode(BuildConfig.DEBUG)
    .setServerUrl(getString(R.string.CodePushServerUrl))
    .setPublicKeyResourceDescriptor(R.string.CodePushPublicKey)
    .build()

Error: Unresolved reference 'CodePushBuilder' (It appears this class was completely removed in recent major versions).

Attempt 2: Using the CodePush Constructor
When falling back to the standard CodePush constructor to manually pass the public key resource:

val customCodePush = CodePush(
    getString(R.string.CodePushDeploymentKey), 
    applicationContext, 
    BuildConfig.DEBUG, 
    R.string.CodePushPublicKey 
)

Error: Cannot access 'constructor(p0: String!, p1: Context!, p2: Boolean, p3: Int): CodePush': it is private in 'com/microsoft/codepush/react/CodePush'.

The Ask

Because CodePushBuilder is gone and the constructor allowing the Public Key injection is now private, it's very unclear how we are supposed to configure Code Signing on Android for v10+.

  1. Clarification: Are we supposed to rely 100% on the auto-linker finding and inside strings.xml?
  2. Docs Update: Could you please provide a working Android example in the documentation for how to properly configure Code Signing (and custom server URLs) for React Native 0.73+ / CodePush v10+?

Environment:

  • react-native: 0.80.3
  • @code-push-next/react-native-code-push: 10.4.1
  • Platform: Android (Kotlin)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions