App not installed after upgrading to Android - P - android

App is installing while connecting via USB to mobile, but while sending .apk file to others it saying "App not Installed"(both debug and release).I have tried different solutions from stackoverflow but none worked for me.
1.How to overcome app not installed error when building from Android Studio 3.0?
2.Cannot install signed apk to device manually, got error "App not installed"
3.Android Studio 3.0 Unsigned Apk Not Installing
Below is my build.gradle(app level)
android {
compileSdkVersion 'android-P'
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "XXXXXXX"
minSdkVersion 15
targetSdkVersion 26
versionCode 51
versionName "1.51"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions{
disable 'MissingTranslation'
}
}
Please help me on this.Thanks in Advance.

You can override testOnly flag adding following line to gradle.properties:
android.injected.testOnly=false

Android P preview SDK is a preview and you should not be distributing APKs built with it. Use a non-preview SDK for compiling APKs that are meant for other people to use.
Technically, the installation limitation is that the APKs have testOnly flag set to true. To work around that, see ADB Install Fails With INSTALL_FAILED_TEST_ONLY

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

why when I try to install the application via USB there is an error , the error says : session 'app' did not installed , i used android studio 3.5

I want to install an APK via USB in android studio 3.5 but I get the following error: Session 'app' did not installed.
I also, try to install the APK via USB in my friend phone's, when I do this there are no issues or errors.
Why when I try to install APK via USB on my phone do I get an error?
My Build Gradle Code
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

Google Play Store is missing in Android Things

Did anyone successfully build location service into Android Things? I am trying to use LocationServices, but it cannot connect with Google Play.
It complains "W/GooglePlayServicesUtil: Google Play Store is missing." and ConnectionResult is {statusCode=SERVICE_INVALID, resolution=null, message=null}
I have setup wifi on Android Things (Intel Edison) and it can fetch a webpage successfully.
The following is my gradle file.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.example.androidthings.myproject"
minSdkVersion 24
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.google.android.gms:play-services:10.2.6'
provided 'com.google.android.things:androidthings:0.4-devpreview'
}
My first ever question on stackoverflow. Many thinks for your help!
compile 'com.google.android.gms:play-services:10.2.6'
Android Things Developer Preview 4 does not support 10.2.6. It supports 10.0.0, as is noted in the release notes. My guess is that your Java code (which is not shown in your question) is going through a code path that is trying to upgrade Play Services to match your 10.2.6, and that is where you are getting your error.
Android Things does not include the Google Play Store, which is responsible for automatically updating Play Services on the device. Because the Play Services version on the device is static, apps cannot target a client SDK greater than the version bundled with the target release. Source :- https://developer.android.com/things/sdk/index.html

APK isn't installing on single devices

I have a problem is with installing my application on random devices. The app works on my phone (Android 6.0) and on emulator (7.1.1), but it can't be installed on friends' phones with e.g. same Android version or 5.0 probably. Is there any IDE-side reason (IntelliJ IDEA, earlier Android Studio with same error)?
There is fragment of build.gradle in my project. Maybe it'll help somehow...
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.pkgname"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "Pre-release"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
pre_release {
minifyEnabled true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Greetings!
Just you make debug-version your .apk. Look at - https://techtuts.info/2014/05/build-release-apk-android-studio/
Will you please let us know whether you're trying to use the build apk generated at the time of installing app directly to your know or you are creating a fresh build.
Note: if you want to support all devices as per your build config then you must have you create a clean build and then try to install app within your required devices.Hope it will help.

Unable to zipalign apk android android studio 2.2

I am publishing my app using android studio 2.2 preview 3 and generating signed apk. But when i am uploading apk to google play i am getting error
You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again.
Also i tried to used zipalign tool manually but i am getting error verification failed.
Here is my build.gradle file
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "blackdogs.newaomsi"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
zipAlignEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}}
Got it. Error was due to gradle version i was using.
Downgraded gradle version to
'com.android.tools.build:gradle:2.1.2'
This is a known issue with Android Studio 2.2 Preview 3, as explained in this blog post and this issue.
You have to download Preview 2 or use the stable version of Android Studio.
solved in the next release
classpath 'com.android.tools.build:gradle:2.2.0-alpha4'
reference link:https://code.google.com/p/android/issues/detail?id=212591

Categories

Resources