【问题标题】:Can't sign APK because of third party library由于第三方库,无法签署 APK
【发布时间】:2018-02-13 17:35:52
【问题描述】:

这是我的第一个应用发布。该项目在开发方面运行良好,但我在签署 APK 时遇到问题。

内含库com.1gravity:android-contactpicker的应用中

仅在签署 apk 期间遇到问题。

错误来了

错误:(30, 44) 错误: 包 com.onegravity.contactpicker.contact 不存在

生成签名的 APK:构建 APK 时出错。你可以找到 “消息”视图中的错误。

gradle 文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId 'com.mymatatu'
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 3
        versionName "1.3"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    debugCompile project(':library')
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
    compile 'com.github.markushi:circlebutton:1.1'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
}

【问题讨论】:

  • 请分享你的proguard内容
  • 你没有错过在 build.gradle 文件的依赖项中添加 compile 'com.1gravity:android-contactpicker:1.3.2' 吗?
  • 请问哪里可以找到proguard的内容?
  • @Jordan 添加依赖后。我在外部库中做了一些更改。他们都没有工作....
  • @khaleel_jageer 你在处理这个文件吗proguard-rules.pro。它是空的。里面的每一件事都在评论...

标签: android android-studio apk signed-apk contactpicker


【解决方案1】:

在你的 gradle 文件中改变这个

debugCompile project(':library') 

插入

compile project(':library')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-18
    • 2019-08-17
    • 1970-01-01
    • 1970-01-01
    • 2017-05-21
    • 1970-01-01
    相关资源
    最近更新 更多