Gradle build failing due to keystore.properties file missing - android

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.

Related

Failed to read Firebase options from the app's resources

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

Is it possible to extract google-services.json from the apk file?

New to android development. When we distribute the .apk file, can the receiver extract the google-services.json and use our database or authentication database.
I looked
I have apk file, Is it possible to get android studio project from apk?
and Is google-services.json confidential?
and Is it possible to decompile an Android .apk file?
but don't directly relate
I tried to extract an apk of mine which has google-services.json file and I couldn't find the google-services.json file in extracted folder .
Edit : Here is more info I found
The google-services plugin has two main functions:
1 - Process the google-services.json file and produce Android resources that can be used in your application's code. See Adding the
JSON File more information.
2 - Add dependencies for basic libraries required for the services you have enabled. This step requires that the apply plugin:
'com.google.gms.google-services' line be at the bottom of your
app/build.gradle file so that no dependency collisions are introduced.
You can see the result of this step by running ./gradlew
:app:dependencies.
This means that the google-services.json file will be converted to android resources by google-services plugin during build process .
You can find how google-services.json works over here
can the receiver extract the google-services.json and use our database or authentication database.
Even if the receiver extracts credentials from apk , he cannot access database as the SHA-1 will be different .

Properties file on Travis CI

I am building an Github Android project using Travis-CI however I have some files which have secret data which I don't want to upload it to GitHub (As it is open and anyone can view it).
In my build.gradle I have written code to load the *.properties file and extract values from it and I have not uploaded these properties files onto GitHub but I want that my properties files should be received when Travis-CI build is being made.
Is there any way I can do this?
Thanks for your help.
Encrypt your file(s). The process is explained in https://docs.travis-ci.com/user/encrypting-files

Can't find the gradle.properties file in the react native apk instructions

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

Difficulties setting up Gradle to send ProGuard mapping files to Firebase

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.

Categories

Resources