I am trying to follow this documentation tutorial by Firebase to setup Android Studio to automatically send my ProGuard mappings file when building a release APK for my Android application.
However, I couldn't seem to understand steps 4 and 5 in the "Uploading ProGuard mapping files with Gradle" part, mainly because I didn't find any gradle.properties file in my project root or home path and because I wish to automate the execution of the app:firebaseUploadReleaseProguardMapping task in Android Studio, which I don't know how to do.
This is the contents of the gradle.properties file I've created in my project root directory:
FirebaseServiceAccountFilePath = /app/firebase-crash-reporting.json
The firebase-crash-reporting.json file is my Firebase crash reporting private key. My mappings file is generated in the /app/build/outputs/mapping/release/ directory, if that helps.
Please assist me in completing those 2 steps and automatizing the process in Android Studio.
Just add
afterEvaluate {
assembleRelease.doLast {
firebaseUploadReleaseProguardMapping.execute()
}
}
In the android section of build.gradle file.
This will automatically upload the ProGuard mappings file to Firebase as well as run/deploy the APK to the device using ADB.
gradle.properties is owned and managed completely by you. You have to create it if it doesn't already exist. This means you should probably read the Gradle documentation on it to best understand how it provides properties to your builds, and which location is best for your properties.
You are not even obliged to use gradle.properties. You can also specify all the properties for the Crash Reporting plugin via the command line.
When you specify a path for the service account file, you should specify the full, unambiguous path to the file. In your example, it looks like you're assuming that it will look under the app directory in your project. If you want to do that, you still have to give the full path to the file.
Related
I get the error Failed to read Firebase options from the app's resources. Either make sure google-services.json is included in your build or specify options explicitly.
When building the unity game to android, even though it works in the editor.
I have tried all the solutions of previous questions. Notably, I don't have a mainTemplate.gradle file, and inside /Plugins/Android I don't have a firebase folder. I am using the .net framework, and I enabled arm64. I also have the googleservices.json both in the assets folder and streamingassets folder. Are there any other solutions? Thanks!
When you want to build to an android project, you need to have a keystore file and I didn't have one. Here is a link to explain how to create the keystore file:
https://github.com/firebase/quickstart-unity/tree/master/database/testapp
I tried to apply for app bundle but I failed.
I can build apk with spilit option but I couldn't make aab.
I put the following gradle option.
bundle {
abi {
enableSplit = true
}
}
The error message in the console is below.
File 'root/lib/META-INF/MANIFEST.MF' uses reserved file or directory name 'lib'.
The file structure that was built is like below.
I heard I have to add the below library, but I didn't.
Actually, there is no difference either I add the play core library or not.
implementation "com.google.android.play:core:$play_version"
I wanna change some options to avoid alias problem but I don't have any idea about that.
Anyone who can handle this problem simply?
Make sure you don't have a directory called "lib/" in your project, since this directory name is reserved in the APK format for storing native libraries.
If not in your project, one your library dependencies must have it and is being copied into the APK.
The reason it works for APKs but not AABs is that the AAB format is more strict and will prevent you from embedding unnecessary files in your app.
I'm trying to use this alarm app on Android Studio - https://github.com/philliphsu/ClockPlus . However, gradle build is failing (error message below). Please let me know what needs to be fixed for this to work.
Error:/Users/***/Documents/Apps/ClockPlus-master/keystore.properties (No such file or directory). Let me know what exactly is this keystore.properties and is it possible to create this file as it's not available in the github repo files.
what exactly is this keystore.properties?
When you want to publish your app in the google play, you need to sign your app. When you create a signing configuration,Android Studio ,by default, adds your signing information in plain text to the module's build.gradle files. If you are working with a team or open-sourcing your code, you should move this sensitive information out of the build files so it is not easily accessible to others. To do this, you should create a separate properties file to store secure information and refer to that file in your build files. That file is the keystore properties file.
Read more about this
Is it possible to create this file as it's not available in the github
repo files?
Create a file named keystore.properties in the root directory of your project. This file should contain your signing information, as follows:
storePassword=myStorePassword
keyPassword=mykeyPassword
keyAlias=myKeyAlias
storeFile=myStoreFileLocation
If you do not have store password, key password etc. you should sign your app.
Read more about this
The whole information about this is in the Android Developer documentation, in the link I provided above.
I'm following the instructions for a signed apk with react native https://facebook.github.io/react-native/docs/signed-apk-android.html
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****
However, in the step for setting up gradle variables, I can't find the ~/.gradle/gradle.properties file on my mac. I see a ~/.gradle folder but I don't see the gradle.properties file there, should I create one? Alternatively, I see a /android/gradle.properties file in my project folder - should I update the gradle variables there instead?
Also, should I replace the MYAPP keyword with my app's name? If so, where do I find the key to replace that with - is that based on some sort of setting? e.g. FOOAPP_RELEASE_STORE_FILE ...
Go ahead and create one in your user folder ~/.gradle/gradle.properties. Gradle can work with global (user variables) or with project ones.
The names of your variables doesn't matter either, but you have to remember to use them correctly when storing & reading values.
Also you have to create keystore for your app as described in React Native - Generating Signed Apk
I am using Eclipse to build my Android Application. When I export the project as an Android Application I can use my keystore and key to sign the apk just fine. Before exporting I also added the Proguard config location to the properties file, I also changed my Android SDK file path to one without spaces, and I have debuggable set to false in my manifest.
With all of those done, the proguard folder in my project that is created does not contain any files and the Android documentation claims it will contain several.
http://developer.android.com/guide/developing/tools/proguard.html
What have I missed?
Stupid error on my part. It looked like it was succeeding because it was. Its just the proguard files weren't imported into eclipse so they didn't show up in package explorer. Manually entering workspace I found them.
That is indeed a little embarrassing. Oh well.