Skip to content

official SDK demo release crash #119

@uiiang

Description

@uiiang

Excuse me, I have a question. In the official Brother Print SDK demo, I added the following code to the build.gradle.kts file and signed it:

getByName("debug") {
  isMinifyEnabled = true
  isShrinkResources = true
      proguardFiles(
        getDefaultProguardFile("proguard-android-optimize.txt"),
        "proguard-rules.pro",
      )
  signingConfig = signingConfigs.getByName("release")
}
getByName("release") {
  isMinifyEnabled = true
  isShrinkResources = true
      proguardFiles(
        getDefaultProguardFile("proguard-android-optimize.txt"),
        "proguard-rules.pro",
      )
  signingConfig = signingConfigs.getByName("release")
}

After performing assembleRelease, The demo app crashes when call PrinterDriverGenerator.openChannel

PrinterDriverGenerator.openChannel(channel)

etc: PrinterInfoFragment.kt line 68-69
Here's the error log:

16:01:28.370  A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 27372 (DefaultDispatch), pid 27298 (h.sdk.printdemo)
pid: 27298, tid: 27372, name: DefaultDispatch  >>> com.brother.ptouch.sdk.printdemo <<<
#01 pc 000000000010d464  /data/app/~~ETEnF5_f0w4xMzEwHj2CkA==/com.brother.ptouch.sdk.printdemo-C0gyqpilYkM-CwZTae0xFQ==/base.apk!libcreatedata.so (offset 0x108000) (Java_com_brother_ptouch_sdk_JNIWrapper_sendLogToGlobalLoggingV3JNI+268) (BuildId: 64beb171e60467fd60220ae07d11632b0472b453)
#02 pc 000000000001f7e0  /data/app/~~ETEnF5_f0w4xMzEwHj2CkA==/com.brother.ptouch.sdk.printdemo-C0gyqpilYkM-CwZTae0xFQ==/oat/arm64/base.odex (art_jni_trampoline+224)
#09 pc 00000000000878e6  /data/app/~~ETEnF5_f0w4xMzEwHj2CkA==/com.brother.ptouch.sdk.printdemo-C0gyqpilYkM-CwZTae0xFQ==/oat/arm64/base.vdex (B0.c.f0+1434)
#12 pc 000000000010fe1a  /data/app/~~ETEnF5_f0w4xMzEwHj2CkA==/com.brother.ptouch.sdk.printdemo-C0gyqpilYkM-CwZTae0xFQ==/oat/arm64/base.vdex (b2.a.X+78)
#15 pc 00000000001777b4  /data/app/~~ETEnF5_f0w4xMzEwHj2CkA==/com.brother.ptouch.sdk.printdemo-C0gyqpilYkM-CwZTae0xFQ==/oat/arm64/base.vdex (q2.b.x+150)
#18 pc 00000000001846da  /data/app/~~ETEnF5_f0w4xMzEwHj2CkA==/com.brother.ptouch.sdk.printdemo-C0gyqpilYkM-CwZTae0xFQ==/oat/arm64/base.vdex (s0.p.g+308)
#21 pc 000000000010efde  /data/app/~~ETEnF5_f0w4xMzEwHj2CkA==/com.brother.ptouch.sdk.printdemo-C0gyqpilYkM-CwZTae0xFQ==/oat/arm64/base.vdex (b1.f.f+16)
#24 pc 0000000000191e20  /data/app/~~ETEnF5_f0w4xMzEwHj2CkA==/com.brother.ptouch.sdk.printdemo-C0gyqpilYkM-CwZTae0xFQ==/oat/arm64/base.vdex (x2.t.run+258)
#27 pc 00000000001535f8  /data/app/~~ETEnF5_f0w4xMzEwHj2CkA==/com.brother.ptouch.sdk.printdemo-C0gyqpilYkM-CwZTae0xFQ==/oat/arm64/base.vdex (kotlinx.coroutines.scheduling.a.run+152)

I tried adding the following rules to the proguard-rules.pro file:

-keep class com.brother.ptouch.sdk.JNIWrapper { *; }
-keep class com.brother.** { *; }
-keep class com.brother.ptouch.sdk.** { *; }

But the issue remains unresolved.

However, when using the same configuration with assembleDebug, it runs normally.

I've emailed the official technical support but haven't received any response yet.

Android Studio 2025.1.4
compileSdk = "36"
targetSdk = "34"
minSdk = "28"
agp = "8.13.0"
gradle = 8.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions