首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >生成APK (签名)升级级版本时的问题

生成APK (签名)升级级版本时的问题
EN

Stack Overflow用户
提问于 2021-12-20 08:38:22
回答 2查看 1.4K关注 0票数 1

我正在尝试将我的gradle版本更新到最新版本,一切都正常工作,但是当我生成签名的APK时,应用程序停止工作(没有启动)。目前我有: Android插件版本: 4.1.2 gradle版本: 6.5

我试着升级到: Android插件版本:4.2.0Gradle版本: 7.0.2,这就是我遇到问题的地方,我生成了签名的APK,而应用程序不起作用。

我怀疑这是否与Proguard或R8有关,我对这些文档不太了解,所以我试图不运行这些文档,看它是否来自那里的失败,但即使是我让它开始工作。

我buildTypes:

代码语言:javascript
运行
复制
buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles 'proguard-android.txt'
    }
}

你知道问题出在哪里吗?

逻辑猫:

代码语言:javascript
运行
复制
12-24 11:23:10.982   504  1885 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.spotbros.defense/com.spotbros.spotbroslib.MainActivity bnds=[842,613][1043,923]} from uid 10129
12-24 11:23:10.984   504  1885 W ActivityTaskManager: Can't find TaskDisplayArea to determine support for multi window. Task id=39 attached=false
12-24 11:23:10.986   970  1660 D EGL_emulation: app_time_stats: avg=2043.51ms min=16.19ms max=14202.23ms count=7
12-24 11:23:10.990   504  1885 D CompatibilityChangeReporter: Compat change id reported: 174042980; UID 10147; state: DISABLED
12-24 11:23:10.992   504  1885 D CompatibilityChangeReporter: Compat change id reported: 184838306; UID 10147; state: DISABLED
12-24 11:23:10.994   504  1885 D CompatibilityChangeReporter: Compat change id reported: 185004937; UID 10147; state: DISABLED
12-24 11:23:10.997   504  1885 D CompatibilityChangeReporter: Compat change id reported: 181136395; UID 10147; state: DISABLED
12-24 11:23:10.998   504  1885 D CompatibilityChangeReporter: Compat change id reported: 174042936; UID 10147; state: DISABLED
12-24 11:23:11.002   504  1885 D CompatibilityChangeReporter: Compat change id reported: 168419799; UID 10147; state: DISABLED
12-24 11:23:11.017   504   541 D CompatibilityChangeReporter: Compat change id reported: 135634846; UID 10147; state: DISABLED
12-24 11:23:11.017   504   550 D CompatibilityChangeReporter: Compat change id reported: 143937733; UID 10147; state: ENABLED
12-24 11:23:11.029   320   320 D Zygote  : Forked child process 23520
12-24 11:23:11.032   504   550 I ActivityManager: Start proc 23520:com.spotbros.defense/u0a147 for pre-top-activity {com.spotbros.defense/com.spotbros.spotbroslib.MainActivity}
12-24 11:23:11.041 23520 23520 W potbros.defens: Unexpected CPU variant for X86 using defaults: x86_64
12-24 11:23:11.047 23520 23520 E potbros.defens: Not starting debugger since process cannot load the jdwp agent.
12-24 11:23:11.057   353   353 D goldfish-address-space: claimShared: Ask to claim region [0x3f0f68000 0x3f18cd000]
12-24 11:23:11.073   353   353 D goldfish-address-space: claimShared: Ask to claim region [0x3f71ef000 0x3f7b54000]
12-24 11:23:11.073   504   532 W InputReader: Device virtio_input_multi_touch_5 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_8 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_10 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_11 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_4 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_2 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_7 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_6 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_9 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_3 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_5 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_8 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_10 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_11 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_4 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_2 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_7 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_6 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_9 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.074   504   532 W InputReader: Device virtio_input_multi_touch_3 is associated with display ADISPLAY_ID_NONE.
12-24 11:23:11.090 23520 23520 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10147; state: DISABLED
12-24 11:23:11.104   353   353 D goldfish-address-space: claimShared: Ask to claim region [0x3f4feb000 0x3f5950000]
12-24 11:23:11.120   504   659 D CompatibilityChangeReporter: Compat change id reported: 171306433; UID 10147; state: DISABLED
12-24 11:23:11.146 23520 23520 V GraphicsEnvironment: ANGLE Developer option for 'com.spotbros.defense' set to: 'default'
12-24 11:23:11.150 23520 23520 V GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.
12-24 11:23:11.155 23520 23520 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
12-24 11:23:11.160  2116  2116 I GsaVoiceInteractionSrv: Handling ACTION_STOP_HOTWORD
12-24 11:23:11.162  2116  2116 E HwDetectorWithState: a: 3
12-24 11:23:11.170 23520 23520 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
12-24 11:23:11.174 23520 23520 I MultiDex: VM with version 2.1.0 has multidex support
12-24 11:23:11.176 23520 23520 I MultiDex: Installing application
12-24 11:23:11.178 23520 23520 I MultiDex: VM has multidex support, MultiDex support library is disabled.
12-24 11:23:11.194   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.197   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.209 23520 23520 D FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
12-24 11:23:11.211   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.213   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.217 23520 23520 D FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
12-24 11:23:11.219 23520 23520 D FirebaseApp: com.google.android.gms.measurement.AppMeasurement is not linked. Skipping initialization.
12-24 11:23:11.221 23520 23520 I FirebaseInitProvider: FirebaseApp initialization successful
12-24 11:23:11.228   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.239   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.245   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.255 23520 23520 W System.err: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
12-24 11:23:11.255 23520 23520 W System.err: SLF4J: Defaulting to no-operation (NOP) logger implementation
12-24 11:23:11.255 23520 23520 W System.err: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
12-24 11:23:11.257   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.261   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.263   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.279   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.281   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.294   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.297   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.311   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.313   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.320 23520 23520 D ActivityThread: Loading provider com.spotbros.defense.contentproviders.multiprocesspreferencesprovider: com.imbox.defense.database.ImboxDefenseMultiprocessPreferencesProvider
12-24 11:23:11.327   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.330   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.344   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.347   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.361   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.363   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.377   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.379   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.395   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.397   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.411   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.413   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.428   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.430   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.445   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.447   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.462   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.464   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.478   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.480   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.494   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.497   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.511   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.514   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.528   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.532   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.545   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.548   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.561   355   355 W RanchuHwc: validateDisplay: layer 706 CompositionType 1, fallback
12-24 11:23:11.564   355   355 W RanchuHwc: presentDisplay display has no layers to compose, flushing client target buffer.
12-24 11:23:11.620   504  1885 W ActivityManager: Unable to start service Intent { act=android.service.smartspace.SmartspaceService cmp=com.google.android.as/com.google.android.apps.miphone.aiai.app.AiAiSmartspaceService } U=0: not found
12-24 11:23:11.620   504  1885 W RemoteSmartspaceService: could not bind to Intent { act=android.service.smartspace.SmartspaceService cmp=com.google.android.as/com.google.android.apps.miphone.aiai.app.AiAiSmartspaceService } using flags 67112961
12-24 11:23:11.622   504   504 W ActivityManager: Unbind failed: could not find connection for android.app.LoadedApk$ServiceDispatcher$InnerConnection@4d069a6
12-24 11:23:11.625   727   779 D EGL_emulation: app_time_stats: avg=1663.02ms min=13.67ms max=14835.26ms count=9
12-24 11:23:11.946 23520 23520 E ActivityThread: Failed to find provider info for com.spotbros.enterprise.contentproviders.mainprovider
12-24 11:23:11.949 23520 23520 E ActivityThread: Failed to find provider info for com.spotbros.enterprise.contentproviders.mainprovider
12-24 11:23:11.952 23520 23520 E ActivityThread: Failed to find provider info for com.spotbros.enterprise.contentproviders.mainprovider
12-24 11:23:11.955   504  1885 D CompatibilityChangeReporter: Compat change id reported: 135634846; UID 10147; state: DISABLED
12-24 11:23:11.957   504   550 D CompatibilityChangeReporter: Compat change id reported: 143937733; UID 10147; state: ENABLED
12-24 11:23:11.965   320   320 D Zygote  : Forked child process 23543
12-24 11:23:11.966   504   550 I ActivityManager: Start proc 23543:com.spotbros.defense:remote/u0a147 for service {com.spotbros.defense/com.spotbros.service.SpotBrosService}
12-24 11:23:11.970 23520 23520 E ActivityThread: Failed to find provider info for com.spotbros.enterprise.contentproviders.mainprovider
12-24 11:23:11.972 23520 23520 E ActivityThread: Failed to find provider info for com.spotbros.enterprise.contentproviders.mainprovider
12-24 11:23:11.974 23520 23520 D AndroidRuntime: Shutting down VM
12-24 11:23:11.978 23520 23520 E AndroidRuntime: FATAL EXCEPTION: main
12-24 11:23:11.978 23520 23520 E AndroidRuntime: Process: com.spotbros.defense, PID: 23520
12-24 11:23:11.978 23520 23520 E AndroidRuntime: java.lang.RuntimeException: Unable to create application com.spotbros.application.SpotbrosApplication: java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.database.Cursor.moveToFirst()' on a null object reference
EN

回答 2

Stack Overflow用户

发布于 2021-12-20 08:45:31

您必须为“minifyEnabled”设置false,为发布设置“shrinkResources”

代码语言:javascript
运行
复制
buildTypes {
release {
    minifyEnabled false
    shrinkResources false
    proguardFiles 'proguard-android.txt'
    }
}
票数 0
EN

Stack Overflow用户

发布于 2022-07-07 16:45:39

如果您在应用程序中使用数据库,可能是因为您在数据库的proguard文件中设置了数据库,您应该在签署apk时检查数据库文件的存在。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70419226

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档