INSTALL_PARSE_FAILED_NO_CERTIFICATES with OWN .apk - android

Since I updated my Android Studio, I cant install my App anymore, neither in the debug nor in the release mode.
I always get the error:
pkg: /data/local/tmp/com.myappdomain.mypp
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
Installation failed since the APK was either not signed, or signed incorrectly.
If this is a Gradle-based project, then make sure the signing configuration is specified in the Gradle build script.
Error while Installing APK
From what I googled, this just happens when trying to install unsigned third party .apk
This is my own App though, signed with Android Studio
Gradle looks like this:
android {
signingConfigs {
release {
storeFile file("...")
keyAlias "..."
storePassword "..."
keyPassword "..."
}
}
buildTypes {
release {
minifyEnabled true
zipAlignEnabled true
signingConfig signingConfigs.release
}
}
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId '...'
minSdkVersion 14
targetSdkVersion 22
}
productFlavors {
}
}

I solved it by updating the target SDK to 23 and updating all my used libraries. Maybe it helps you too.

Related

Android Studio signs APK only when Build APK is chosen and not when Run button is clicked

Android Studio signs an APK only when I go Build/Build Bundles Apks/Build APK. When the run button to automatically run it on the emulator is clicked the application is not signed. I have verified this by inspecting the application with adb pull from the emulator.
The following is the build gradle I have:
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
signingConfigs {
config {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('/home/pc/.android/debug.keystore')
storePassword 'android'
}
}
defaultConfig {
applicationId "com.example.app"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
custom {
signingConfig signingConfigs.config
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
debuggable true
}
}
}
I am choosing from the build variants the custom one I have created.
I havent touched this app for a while now but a similar project I had was working properly several months ago. Is there some update or something else that is causing this behavior? Am I missing something?
Android Version 3.6.1
Java Version = java-8-openjdk
I know the config is correct as the Build APK actually signs the APK
I know that the APK installed on the emulator when the button run is clicked does not contain the signature as i have inspected the META-INF directory of the apk. But i have also verified it by trying to print the signature programmatically.
According to Android user guide the run button should have the same result as the Build APK!
What could be the issue of the above and how to solve it?
I spent a considerable amount of time trying to solve this and I hope to save some time from anyone else facing this.
Go to Run/Edit Configurations
In the tab General in section Installation Options
In Deploy choose APK from app bundle

React Native installRelease Task 'installRelease' not found in root project 'timeReportTool'. Some candidates are: 'uninstallRelease'

Okay so I am trying to get my react-native into an apk file and install it on a device the assembleRelease works fine but it seems like it doesn't get the signing since I can only install the debug version and not installRelease which gives me the error
Task 'installRelease' not found in root project 'timeReportTool'. Some candidates are: 'uninstallRelease'.
here is the Android block from my build.gradle
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.timereporttool"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release // add this line as well
}
}...
I do get an app-release-unsigned.apk so it is clearly not getting signed in Android studios it can't sync the gradle because of this line that were there from the start
apply from: "../../node_modules/react-native/react.gradle"
in Android Studio the node modules map is empty but it exists in the directory
You have to create a signing key and reference it in your project, as described here: https://facebook.github.io/react-native/docs/signed-apk-android
It's crazy that no one answered this for over a year. There's no way around this issue if you publish a React-Native app to the Play Store.
It's due to unsigned code. You have to follow some sort of steps mentioned in the react native official website for generating a signed apk. Otherwise, even though the apk is created, the user not able to install it on their device.
Refer the following link for generating signed apk.
Publishing to Google Play Store

Android.Gradle: Sign release apk and put on specific folder

Gradle 4.2, Android Studio 2.3.3.
My app/build.gradle
android {
compileSdkVersion 26
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.myproject"
minSdkVersion 16
targetSdkVersion 23
versionCode 3
versionName "1.2.3"
}
signingConfigs {
release {
keyAlias keystoreProperties['KEY_ALIAS_RELEASE']
keyPassword keystoreProperties['KEY_PASSWORD_RELEASE']
storeFile file(keystoreProperties['STORE_FILE_RELEASE'])
storePassword keystoreProperties['STORE_PASSWORD_RELEASE']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
If I want to create sign apk I use the next command:
gradlew assembleRelease
As result I get sign apk in the path = \my_project\app\build\outputs\apk\app-release.apk
OK. It's work fine.
Now I has some custom requirements:
Sign release apk
The resul apk name must be "myproject_xxx.apk", where xxx = versionName. So in this example result apk name = "myproject_1.2.3.apk"
The file "myproject_xxx.apk" must be in the directory: my_project\result_apks\
So to do all of this points I need to write my custom gradle task. I'm right?

Android Studio builds a debug apk but doesn't deploy/run on device

I'm struggling with coming to terms with Andoid Studio after years working with Eclipse. I've imported an existing Eclipse simple project into AStudio 1.1.0 and altough it builds an APK
Directory of
C:\dev\projects\AndroidStudio\DiddyOsmdroid\TinyOsmdroid\build\out
puts\apk
25/02/2015 17:02 176,517 TinyOsmdroid-debug-unaligned.apk
25/02/2015 17:02 176,518 TinyOsmdroid-debug.apk
It doesn't deploy to a tablet connected via USB. (It did the first time I tried it, but not now) I've edited the run configurations to try both 'USB' and 'choose'. I try to deploy and run by double clicking assembleDebug as suggested in the docs. The device is visible in the Android window, in that Log lines are shown.
My gradle file looks like:
apply plugin: 'com.android.application'
android {
compileSdkVersion 7
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "osmdemo.demo"
minSdkVersion 3
targetSdkVersion 3
}
signingConfigs {
release {
storeFile file("c:/users/me/some.keystore")
storePassword "xxxxxxxxxxx"
keyAlias "some_alias"
keyPassword "yyyyyy"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
}
dependencies {
compile files('libs/osmdroid-android-4.1.jar')
compile files('libs/slf4j-android-1.5.8.jar')
}
I'd be grateful to get any suggestions.
Gradle wont excute the app on the emulator/device. It will only build and install. You have to run an adb command to run the app. This is essentially what the Run button on Android Studio does for you.

Zipalign cannot working while using 'gradlew packageRelease'

I'm using Android Studio,But zipalign it's not working for me while I package App via 'gradlew packageRelease'.I've verify the signature is ok by jarsigner.Here is my build.gradle.It's there any mistake?
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 17
}
signingConfigs {
myConfig{
storeFile file("my.keystore")
storePassword "password"
keyAlias "alias"
keyPassword "password"
}
}
buildTypes{
release {
signingConfig signingConfigs.myConfig
runProguard true
proguardFile "proguard.cfg"
}
}
}
Check that Android Studio hasn't removed the ZipAlign file from the tools folder - it does "helpful" things like that when you change build versions (and got me when I upgraded then had to downgrade). If it has, you may be able to find it in an older version on your file-system.
zipalign is in ADT/sdk/build-tools/android4.4W Copy android4.4W folder and paste it in yourproject/platforms/android/build/outputs/apk
Now, copy yourkey.keystore and your project.apk and paste them into android4.4W full path yourproject/platforms/android/build/outputs/apk/android4.4W
then, $ zipalign -v 4 project.apk wowdone.apk. Thats all, hope this answer will help you.

Categories

Resources