我尝试在发布版本类型上安装应用程序,但出现一般错误:“解析错误。解析包时出现问题”
安装调试 apk 成功。
使用 adb 安装发布 apk 会显示以下信息:
C:\android-sdk-windows\platform-tools>adb install app-release-unsigned.apk
2577 KB/s(0.608 秒内 1606360 字节) pkg:/data/local/tmp/app-release-unsigned.apk
失败 [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
这是日志猫
V/ApplicationPolicy: isApplicationStateBlocked userId 0 pkgname com.android.packageinstaller I/ActivityManager: START u0 {act=android.intent.action.VIEW dat=file:///storage/emulated/0/Download/app-> > release- unsigned.apk typ=application/vnd.android.package-archive cmp=com.android.packageinstaller/.PackageInstallerActivity (has extras)} from uid 10019 on display 0
D/CustomFrequencyManagerService:acquireDVFSLockLocked:类型:DVFS_MIN_LIMIT 频率:1190400 uid:1000 pid:961 pkgName:ACTIVITY_RESUME_BOOSTER@4
W/ActivityManager:mDVFSHelper.acquire() D/InputDispatcher:焦点应用程序设置为:xxxx D/InputDispatcher:焦点左窗口:22409 /?D/MyFiles: FileUtils::update file open count D/DisplayManager: addAllDisplaysLocked() D/ActivityManager: 启动 com.android.packageinstaller,更新优先级 D/SSRM:a: DeviceInfo:: 000000000000 D/SSRM:a: SettingsAirViewInfo:: 000000000 /?
W/PackageInstaller:解析清单时出现解析错误。停止安装
模块 build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "xxxxxx.yyyy.zzzzz"
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':SAPE.Lib')
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.android.support:appcompat-v7:21.0.3'
}