Firebase Dynamic Links Don't Work in Release APK - android

I recently started using Firebase Dynamic Links in my Android app. Everything works great when I run my app with a debug APK. When I click on a dynamic link, it opens my app on the correct screen with the intent filter I set up in my manifest.
Here's what it looks like in the debug version:
Correct result
However, I have noticed that the dynamic link doesn't work when I generate a release APK and try to click the same link. Instead the link opens in a browser first before opening my app at the launcher activity which isn't the activity I specified with my intent filter.
Here's the same test in the release version:
Incorrect result
I'm assuming this is a problem with my build settings but it could be something else. I haven't been able to identify it. I tried disabling proguard in my app's build.gradle file but that had no effect.
For reference, here's the buildTypes snippet of my build.gradle file:
buildTypes {
debug{
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Also the proguard-rules.pro file is currently empty. Any help would be appreciated!

Have you created a SHA256 key based on your production keystore? You have to add it to your project inside the Firebase console in order to have app links enabled.
Reference to documentation: https://firebase.google.com/docs/dynamic-links/android/receive#app_links

Related

How to disable proguard in release build in android

HI I have develop one app which is working perfectly in debug . but same code base when i trying to run code in release build some API is not firing because proguard . i dont know its because of proguard or minifyEnabled true or shrinkResources true then i made both false as below .
buildTypes {
release {
minifyEnabled false
shrinkResources false
crunchPngs false // Paste this line
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
using above code its working fine but when i try to upload build in play store release build with signed bundle file then its showing below error :
You uploaded a debuggable APK or Android App Bundle. For security reasons you need to disable debugging before it can be published in Google Play. Learn more about debuggable APKs and Android App Bundles.
please help me how to fix this issue .can we disable proguard for release build if not then how to fix this issue .

Firebase Authentication failed in release mode

In my debug android app I made a sign in into firebase with google and facebook and it worked well, but after generating signed APK it's not working, I updated SHA1 in firebase project with release SHA and updated key hash in facebook for developers also but it still not working what can I do.
Most of the times things like this happens because of proguard, it removes some of the files when building apk. Check if it works when proguard is disabled. if it works then try to configure proguard to keep all required files.
To disable proguard set minifyEnabled false in build.gradle
after changing it will look somewhat like
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
To further configure proguard you can easily find tutorial on google.
Some helpful links:-
https://stackoverflow.com/a/26274623/5176343
https://stackoverflow.com/a/15761408/5176343
It's tough to say without seeing the code, but one thing that has worked for me in the past was turning off proguard and/or minify in build.gradle. Those things were changing property names in the release apk for me which then caused de-serialization to fail for me because the names didn't match what was in the json.
Have you selected a build version to release and than generate singed apk i hope this will work for you.

How secure Web services in android Studio?

i have search many time to how secure my web service in my android project but always got a single answer set ProGuard in Gradle file.
But i don't have idea about ProGuard.
Please any one can idea about ProGuard so help me and explain with example step by step.
I have already read ProGuard rules on developer site (https://developer.android.com/)
Below code inside my Gradle file
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
above code through not secure my web services.
I have find a solution...
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
We can update above code build.gradle file and sync your project
Proguard can help you in minifying and code obfuscation
Details here
https://developer.android.com/google/play/billing/billing_best_practices.html
However to secure the webservice, you need to implement SSL authentication. You will get great details here,
https://developer.android.com/training/articles/security-ssl.html
In case you are stuck with any specific problem during implementation then post it here.
Regards
AShish

How to obfuscate whole code even manifest file in android?

Am developing android application with some confidential data.I need to obfuscate code.I have searched for a solution long time, still am not getting solution.
You have several ways of doing this. The one you can easily integrate inside your application is to use proguard rules and gradle.
Define your proguard-rules.pro with the specifications you see fit. Below there is a link which explains the usage of most of them
http://proguard.sourceforge.net/manual/usage.html
After that, in the build gradle of your top application module, in case you have a tree of dependencies, add:
BuildTypes{
release{
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
In this case, every time you run a release version of your application, it will run your proguard file configuration. Have in consideration that proguard does not obfuscate the name of the activities.
Use minifyEnabled true in your app level build.gradle

Can't generate signed APK in Android Studio, because proguard-rules.txt is missing

I have a problem with generating signed APK in Android Studio. After fixing all the warnings I am stuck on this one:
Error:Execution failed for task ':app:proguardRelease'.
java.io.FileNotFoundException: /Users/franek/Documents/Android_Studio_Melange/app/proguard-rules.txt (No such file or directory)
I don't want to change minifyEnabled to false, because I want to keep Proguard working. How can I fix this error?
A fragment of build.gradle:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
should work ok, as long as you don't need any special ProGuard configuration. If you do, use your original proguardFiles entry and create the file
/Users/franek/Documents/Android_Studio_Melange/app/proguard-rules.txt
Then put your custom rules in this file.
Delete folder build inside app folder, then regenerate.
You can try delete folder build inside app folder.
Then regenerate.
you need to disable the proguard
you can follow these steps: (to disable the proguard)
https://stackoverflow.com/a/72272882/10340870
it works for me. After disable the pro guards I'm able to generate the signed aab file
I realise this question has been long answered, but I had the same problem and have been trying for hours to fix it. None of the solutions on here worked for me, so I'm adding this to save others the trouble.
I solved the issue just by completely getting rid of the proguardFiles line, so my code looks like:
buildTypes {
release {
minifyEnabled true
}
}
Of course this doesn't help if you need a specific proguard file, but I thought I had to specify one and it turned out I didn't. I hope this helps!

Categories

Resources