Android Studio: Generated Release APK not working - android

Im trying to install an app that i ensure that is working (installation via play button on Android Studio works perfectly fine) however I got an error if I try to install via Play Store or straight via an APK file: "App not installed". This error happened on a Xiaomi Redmi note 5 and not 7 (one of them never had this app installed before).
This happens when I try to install directly through the generated APK release using Android Studio.
Build -> Generate Signed Bundle/APK -> APK -> Insert my passwords -> Select Release and check both checkboxes (V1 and V2), I've tried only V1 and only V2 and none of them worked...
Now I've tried to go to Build -> Build bundle/APK -> Build APK and it worked to install using the debug file. However I cant upload this file to Play Store.
So the problem is on a RELEASE version of the APK file. How can I fix it so I can upload it to Play Store?
PS: After tried this debug file on a third device, it didn't work either.
All 3 devices worked if I install directly from Android Studio play button though.
Here is my build.gradle (Module:app) file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.appdidier.hospitalar"
minSdkVersion 16
targetSdkVersion 28
versionCode 5
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.android.support:design:28.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.google.firebase:firebase-storage:19.1.0'
implementation 'com.google.firebase:firebase-auth:19.1.0'
//// implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
// implementation 'com.google.android.gms:play-services:12.0.1'
// implementation 'com.google.android.gms:play-services-maps:15.0.1'
// implementation 'com.google.android.gms:play-services-location:11.6.0'
implementation 'com.itextpdf:itextg:5.5.10'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.github.barteksc:android-pdf-viewer:2.8.1'
implementation "com.squareup.picasso:picasso:2.71828"
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
// implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.github.sundeepk:compact-calendar-view:1.9.1'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
}

Ive ended up solving my problem by removing this line of code on the manifest file:
android:protectionLevel="signature"
So sad that Google dont have a report to debug this problem... I had a lot of trouble to find it.
Too hard to find a solution when the problem is just: "App not installed"

Related

How do I fix the version after adding Facebook Sharing SDK?

My application had been working fine. I want the user to share the last activity EdiText displayed text in the app on Facebook. To do so, I followed this tutorial.
https://developers.facebook.com/docs/android/getting-started/
The topic: Share and Send dialogs.
I followed the steps:
Added mavenCentral() to repositories.
Added the below line to dependencies.
compile 'com.facebook.android:facebook-share:[5,6)'
After this, I received the error :
implementation 'com.android.support:support-v7:28.0.0'
So, here I changed v7 to v4
implementation 'com.android.support:support-v4:28.0.0'
After this step's rebuilding, there were no errors.
I ran the app, but the app shows "App not responding, Close or Wait"
I tried it again, but the app looks froze then closes itself.
The below code is build.gradle : Module app
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.dumdum.newapp"
minSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.facebook.android:facebook-share:[5,6)'
}
I want to remove the error here.
implementation 'com.android.support:support-v7:28.0.0'
Althought I changed it to
implementation 'com.android.support:support-v4:28.0.0'
Still, the same error exists.
The eventlog is error-free.
But when clicked on this below line, the error box is shown next to it:
implementation 'com.android.support:support-v7:28.0.0'
OR
implementation 'com.android.support:support-v4:28.0.0'
I could not add error box because Stackoverflow considering that part as spam.

why upgrading firestore version to 17.1.0 makes a problem in the Multidex?

my app was working fine while i was using firestore version 11.8.0 but there was always a warning regarding the firestore version it asks me to upgrade the latest version 17.1.0
after upgrading the version,the application show errors, and the android studio keeps telling me
//Cannot fit requested classes in a single dex file. Try supplying a main-dexlist.
I don't know why is the version of firebase storage has to do with the Multidex?
here is my build gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.moham.trial"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:recyclerview-v7:28.0.0-rc02'
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.android.support:cardview-v7:28.0.0-rc02'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
}
apply plugin: 'com.google.gms.google-services'
Building an android app compiles the app into bytecode (executable code) in the form of a DEX file. The compiled bytecode files (DEX files) only support 64K (65,536) methods before having to split into DEX files.
Adding the firestore library adds a lot of methods and causes this limit to be exceeded and so multiDexEnabled true is required to allow it to split into multiple files.
You can find more information at: https://developer.android.com/studio/build/multidex

Failed to resolve: com.android.support after building gradle but my app can still be installed

I have gone through all stackoverflow examples but couldn't find a solution for my problem. I tried to downgrade mz sdk vesrion and android:support but it didn't work.
I am having the following code in build.gradle. However, whenever I try to build my gradle it shows an error: Failed to resolve: com.android.support... Anyway I am able to successfully install apk to my devices and it runs perfectly. I just don't want that his dependency will cause some error in the future.
Thanks!
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.feecollector.android.feecollector"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.navigation_menu.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.1-alpha1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'de.hdodenhof:circleimageview:1.3.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.navigation_menu:runner:1.0.2'
androidTestImplementation 'com.android.support.navigation_menu.espresso:espresso-core:3.0.2'
implementation 'com.facebook.android:facebook-android-sdk:4.36.0'
}
You are using different versions of com.android.support.
this is your code:
implementation 'com.android.support:appcompat-v7:27.0.1-alpha1'
implementation 'com.android.support:design:27.1.1'
it should be like this:
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
You have issue with gradle local setting. You can try to Invalidate and Restart cache. Click File -> Invalidate caches.
Sometimes you might even other issues with updating to new Gradle level. For this case, remove .idea and .gradle folders from Project Room and Import it again from Idea start screen.

Android: Failed to resolve: com.android.support:appcompat-v7:28.1.1

Error : Sync failed. Unresolved Android dependencies. Failed to resolve: com.android.support:appcompat-v7:28.1.1
Config:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.ercess.ercess_app1"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:appcompat-v7:28.1.1'
implementation 'com.squareup.picasso:picasso:2.71828'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
How to resolve this?
Replace
implementation 'com.android.support:appcompat-v7:28.1.1
with
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
Currently, the most recent available release for appCompat is 28.0.0-rc01, you are trying to pull an unavailable version of appcompat library.
Root cause: The version 28.1.1 is not exist.
Solution: Use the latest stable version
implementation 'com.android.support:appcompat-v7:27.1.1'
or use latest unstable version
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
Many answers already on this one but I feel like noone explaines how to keep it up to date, just how to fix this specific version. So here it is
The com.android.support:appcompat version must match the compileSdkVersion
It is preferable to use stable versions if you release to production
Look on the android website to find the lastest stable version that correspond to your compile version (even is this link gets broken, the info will be available somewhere on the official website)
Example, as of today (end of january 2019), the lastest stable support library version is 28.0.0 (according to android website), so the correct implementation is
implementation 'com.android.support:appcompat-v7:28.0.0'
you'd have to use api "com.android.support:appcompat-v7:27.1.1" -
or the later (future) api "androidx.appcompat:appcompat:1.0.2"
from androidx.
using "release candidates" and "alpha versions" is discouraged, because these are not well tested.
just see the official documentation ...it recommends 27.1.1.
I solved this by trial and error and using some of the answers above.
I changed the appcompat to a lower version "com.android.support:appcompat-v7:27.1.0"
along with changing
compileSdkVersion 27
and
targetSdkVersion 27
I'm still getting warnings but Picasso should now run.
You need also add: implementation 'com.android.support:support-v4:28.0.0' in your gradle file like this:
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
and this is a full implementation:
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
Please add these below dependencies to solve the issue, try it:
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-v13:27.1.1'
implementation 'com.android.support:design:27.1.1'
also change the version of AppCompat as:
implementation 'com.android.support:appcompat-v7:27.1.1'
AppCompat Sometimes doesn't work alone. Adding these might solve your issue.
replace
implementation 'com.android.support:appcompat-v7:28.1.1'
with
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'

Updating Google Firebase dependencies in Android project build.gradle file

I have been working on a project where I am trying to build a messaging application in Android Studio using Google Firebase. I previously had to restart the project due to an error after reaching this stage of the tutorial I have been following which requires you to add an implementation of the 'com.firebaseui:firebase-ui-database:4.1.0' (Or whatever the most recent version is) in my project gradle file and update the existing dependencies I am using accordingly.
I am still relatively new to app dev and as such don't want to mess up this project and start from scratch again by screwing up my gradle file. So could somebody show me what my build.gradle file should look like with the new dependency added and the existing dependencies correctly updated before syncing?
Info on adding the dependency can be found under this link, mainly under the 'Installation' and 'Dependencies' headings. https://github.com/firebase/FirebaseUI-Android
My current gradle file looks like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.conormcadorey.chatbox"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
implementation 'com.android.support:design:28.0.0-beta01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.android.support:support-v4:28.0.0-beta01'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//creates a rounded user profile image
implementation 'de.hdodenhof:circleimageview:2.2.0'
//ArthurHub - allows user to crop their profile image
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
//Picasso - image uploader
implementation 'com.squareup.picasso:picasso:2.71828'
}
apply plugin: 'com.google.gms.google-services'
ps - I appreciate that this may be a simple or obvious question, however when I attempted this myself I ended up having to rebuild the project from scratch so any help would be greatly appreciated.
Using Android Studio v3.1.3
According to the docs:
As of version 4.1.0, FirebaseUI has the following dependency versions:
Library Version
firebase-auth 16.0.1
play-services-auth 15.0.1
firebase-database 16.0.1
firebase-firestore 17.0.1
firebase-storage 16.0.1
Therfore change the following libraries:
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
into this:
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
Also add the firebase-core:
implementation 'com.google.firebase:firebase-core:16.0.1'
Your app gradle file now has to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.

Categories

Resources