Android app apk not getting installed from file filemanager - android

When I share my apk through Google Drive or any means App is not getting installed on some phones. But when I install it through ADB it is getting installed. What could be the problem?

there are many reason , maybe you use native code , or issue with signing.
try to install though ADB in release variant and check the error .
in android section at your app level gradle file "build.gradle module app add your signing config
.........
android {
signingConfigs {
config {
storeFile file('path to your keystore file')
storePassword 'keystorePassword'
keyAlias 'alias'
keyPassword 'aliesPassword'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
.......
then from the left side click build variant and choose release
now run your app and you should get the same result as install the APK from file manager or what ever .

If you are using Android studio 3.0 above version and trying to build an APK then go to
Go to build
2: Build bundles
3: Build APK(s)
and then share the build. It will surely get installed in any devices.
Just make sure Device has allowed APK install from other resources.

Related

"Uploaded a Debuggable APK" to Google Play

I am trying to upload the latest version bundle of an app that is already in the Google Play Console and I received this message:
You uploaded a debuggable APK or Android App Bundle.
I have not defined android:debuggable in AndroidManifest.xml.
If I try to define android:debuggable = "false" I get an error telling me that I should avoid hardcoding the debug mode as the system now assigns that as required.
How can I please both Android Studio and Google Play Console in their seemingly mixed messages?
It seems like you are uploading the debug variant of the app instead of the release one. Since the app you are uploading already has a previous version on Google Play, you will need to upload a release variant signed with the same key as the previous one.
Check if you have the following in your app level build.gradle
signingConfigs {
release {
storeFile file("...")
storePassword "..."
keyAlias "..."
keyPassword "..."
}
}
If it does, you can build the release variant by the command
./gradlew assembleRelease
If your build.gradle does not have the release signing config, then it must have been signed using Android Studio's "Generate Signed Build" option, and you will have to get the keystore file from the person who generated it in the first place.
You can read more about app signing here
The answer from #basilisk led me towards the solution by referring to the build.gradle file where debuggable true had been set for me. I changed this to debuggable false and the Console would now accept my app bundle without any warnings.
So in short check if debuggable is set in build.gradle as well as in AndroidManifest.xml.

Google Play Upload Failed 'You uploaded a debuggable APK'

I am running into the following message when attempting to upload my APK as an alpha release on Google Play.
'You uploaded a debuggable APK. For security reasons you need to disable debugging before it can be published in Google Play.'
In my gradle I have configured the signing config and build type(s) as follows:
signingConfigs {
release {
storeFile file("PATH TO KEY STORE")
storePassword "STORE PASSWORD"
keyAlias "ALIAS"
keyPassword "PASSWORD"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
testCoverageEnabled true
debuggable false
}
debug { testCoverageEnabled true }
}
Furthermore, I've verified using jarsigner that my APK was signed and that the CN does not contain CN=Android Debug.
The manifest for the APK does not contain the attribute android:debuggable.
The application I've built is a Kotlin application with the following dependencies:
Android Support v13 27.0.2
Android Support Annotations 27.0.2
Android Support Constraint Layout 1.0.2
Junit 4.12
Mockito 2.15.0
Robolectric 3.7
Android Support Test Runner 1.0.1
Android Support Test Espresso Core 3.0.1
I've attempted to upload the APK generated via gradle command line (i.e., gradle build) as well as the APK generated from the IDE using Build, Generate
Signed APK, and I've ensured that the release variant is selected when building from the IDE and gradle before attempting to upload to Google Play.
Finally, I've attempted this with multiple keystores (creating a new one thinking that perhaps my first one was invalid), and still I cannot upload my APK. To clarify, this is the first apk upload. No prior version exists on Google Play.
Is one of the support libraries leading to this issue, or is there something I have missed?
I discovered the issue.
It seems an APK with test coverage enabled is considered debuggable.
After removing the line
testCoverageEnabled true
from my release build type, I was able to upload my APK.

Can't get release apk to run on Android Studio

I've migrated from Eclipse on one Windows machine to Android Studio on a new Ubuntu machine. I'm struggling with AS. I've managed to copy a project across with ftp and have managed to run the debug version on an emulator on the Ubuntu machine. The release version which I have signed exists in the same place as the debug apk. When I select release as the build variant it wo't run saying:
The apk for your currently selected variant (app-release-unsigned.apk) is not signed. Please specify a signing configuration for ..
There is no such file below my project home directory, yet both the signed apks do exist
/home/nick/AndroidStudioProjects/GridMaps2.8/app/app-release.apk
/home/nick/AndroidStudioProjects/GridMaps2.8/app/app-debug.apk
My app gradle file is
apply plugin: 'com.android.application'
android {
signingConfigs {
debugFromAdventPC {
keyAlias 'androiddebugkey'
keyPassword 'android'
storePassword 'android'
storeFile file('/home/nick/AndroidStudioKeystores/FromAdventPC/debug.keystore')
}
releaseFromAdventPC {
keyAlias 'release_alias'
keyPassword 'deleted'
storeFile file('/home/nick/AndroidStudioKeystores/FromAdventPC/my-release-key.keystore')
storePassword 'deleted'
}
}
compileSdkVersion 'Google Inc.:Google APIs:18'
//compileSdkVersion 15
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "deleted"
minSdkVersion 9
targetSdkVersion 15
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
}
android {
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
compile files('libs/osmdroid-android-4.1.jar')
compile files('libs/slf4j-android-1.5.8.jar')
}
Any help will be appreciated
It sounds like you are clicking on the green 'run' button in Android Studio. AS then dutifully tries to build and create a program to run. Which isn't really what you want. You want to test your release APK? Right?
To test your release APK:
Connect a phone to your computer with a USB cable.
Go to whatever file explorer software you are using on your Ubuntu machine.
Drag and drop your release APK to the phone, or ftp it over if your software can't handle that. Or you can try doing a command line move.
Use file manager software on your phone to locate the release APK file and click on it. It will unpack and install itself. Answer any questions as needed.
If you make changes you will have to uninstall the app from your phone, build the signed release APK again and do the copying and installation stuff all over again.
If you just wanted to edit your app on the Ubuntu machine in Android Studio, you need to move over all the original files. Eclipse should have an export function to help with that.
Hope that helps.

Android studio - release APK for flavor

I'm new to Android Studio and running a debug build on a device is working fine, however to test in app purchasing (and obviously to release) I need a release build signed with the normal key. I can make an APK using Build -> Generate signed APK, however the package name seems to be incorrect. Here's my build file:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 8
targetSdkVersion 9
testPackageName "com.company.common.common"
testInstrumentationRunner "android.common.InstrumentationTestRunner"
}
signingConfigs {
releaseConfig {
storeFile file("filname")
storePassword "password"
keyAlias "alias"
keyPassword "password"
}
}
buildTypes {
debug {
packageNameSuffix ".debug"
}
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.releaseConfig
}
}
productFlavors {
Flavor1 {
packageName "com.company.test"
}
}
}
dependencies {
// some dependencies
}
Note the package name overridden in the flavor. That flavor has no manifest; the only manifest is under main, and specifies a package of com.company.common. If I use Android to create a com.company.test APK and install it on a device, then generate an APK from Android Studio and install it, I end up with two apps on the device rather than the second replacing the first. This indicates that the package names are different, I assume because Android Studio is producing an APK with a package of com.company.common. Not sure how to verify that though.
When I just build the project, I get a debug APK but no release APK. How do I get a release APK with the correct package name? I just ran the app from Android Studio and it says it's installing com.company.test.debug, and that it needs to uninstall the app before installing. So now I'm thinking the generate signed APK generated a build with the debug package.
So far this is the issue that's preventing me from moving to Android Studio and gradle. Once I get past this I think I'm clear to move everything over so I'm hoping someone can help me figure it out!
Before you choose the Generate Signed APK option, go into the Build Variants window and choose the Release build variant. The Generate Signed APK command takes whatever the current build type is selected there and signs it. This obviously isn't what you want in this case; bug https://code.google.com/p/android/issues/detail?id=56532 is requesting improvements there.

Android Studio: Signing issue after upgrade

I recently upgraded my android studio from 0.2.6 to 0.2.11. The Build - > "generate signed apk" wizard which was opening up in 0.2.6 is not coming up here. Instead it shows a dialog like :
For Gradle-based projects, the signing configuration should be specified in the Gradle build scripts.
See the Gradle User Guide for more info.
I even added the below lines in build.gradle file:
signingConfigs {
debug {
storeFile file("debug.keystore")
}
myConfig {
storeFile file("other.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
buildTypes {
foo {
debuggable true
jniDebugBuild true
signingConfig signingConfigs.myConfig
}
}
Could anyone please tell me what could be the issue?
Or also could you please let me know how to downgrade my studio?
Thanks
A temporary fix for your issue is to restart Android Studio. After a cold start, Android Studio will let you access the "generate signed apk" wizard once before again warning you that you have to change your build.gradle.
As Shai mentioned, this will be fixed in a future release. Please see the links in his post.
This issue is got fixed in Android Studio v 0.2.13 as expected.
Bug fixed by Android Studio Developer Team
Google Android Thread
I copied gradlew from the android studio to my project root directory
Then I added this to my build.gradle
android {
...
signingConfigs {
release {
storeFile file("mykeystore")
storePassword "mypassword"
keyAlias "my alias"
keyPassword "mypassword"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
Then I did
gradlew assembleRelease
from my project root directory
This way I got the signed apk in build/apk
Too bad I wasn't able to do the same via IDE
I ended up just using "gradle installRelease" and coping the release APK from build/apk folder.
I am not sure why we are getting this, I do have my signingConfigs setup properly in build.gradle.

Categories

Resources