我正在更新别人的代码,当我通过android studio运行构建时,会出现以下错误
Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_NO_CERTIFICATES
List of apks:
[0] '... 1appbuildintermediatesextracted_apksreleaseoutbase-arm64_v8a_2.apk'
[1] '...appbuildintermediatesextracted_apksreleaseoutbase-en.apk'
[2] '...appbuildintermediatesextracted_apksreleaseoutbase-master_2.apk'
[3] '...appbuildintermediatesextracted_apksreleaseoutbase-xxhdpi.apk'
APK signature verification failed
我已经通过gradle运行它,然后在我的手机上安装了apk,它的工作,但它不能直接在模拟器上工作。minSdkversion很好。我改了
更新:这是我的构建文件:
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.abc.xyz"
minSdkVersion 21
targetSdkVersion 30
versionCode 6
versionName '1.6'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
//for one signal app id
manifestPlaceholders = [onesignal_app_id : "XXXX",
onesignal_google_project_number: "XXXX"]
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// firebaseCrashlytics {
// nativeSymbolUploadEnabled true
// }
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.1.0'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.onesignal:OneSignal:3.+@aar'
implementation 'com.google.android.gms:play-services-gcm:10.2.1'
implementation 'com.firebase:firebase-client-android:2.5.2+'
// implementation 'com.onesignal.OSNotificationOpenResult:3.8.3'
implementation 'com.google.firebase:firebase-messaging:21.0.1'
// Realm
// implementation 'io.realm:realm-android:0.82.1'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'androidx.core:core-ktx:1.3.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:26.4.0')
// Add the Firebase Crashlytics SDK.
implementation 'com.google.firebase:firebase-crashlytics:17.3.1'
// Recommended: Add the Google Analytics SDK.
implementation 'com.google.firebase:firebase-analytics:18.0.2'
// Add the Firebase Crashlytics NDK dependency.
implementation 'com.google.firebase:firebase-crashlytics-ndk:17.3.1'
}
repositories {
mavenCentral()
}
确保在签名配置中启用v2签名方案:
你应该有
v2SigningEnabled true
为signingConfigs
块中的所有口味。