V
V
vitaly_742021-01-22 16:24:16
android studio
vitaly_74, 2021-01-22 16:24:16

Why can't I compile android application?

got the code from the repository (it was compiled by my colleague who quit). but you won't get it from me. because I'm a php developer, android is not a boom boom. What we have:
error while synchronizing gradle

Build file 'путь_до_проекта\app\build.gradle' line: 41
A problem occurred evaluating project ':app'.
> path may not be null or empty string. path='null'

this line is written:
storeFile file(properties.getProperty('STORE_FILE'))

Here is the block of code related to this line:
Properties properties = new Properties()
        properties.load(new FileInputStream("${rootDir}/local.properties"))
        debug {
            // это сделано для того, чтоб не прибивать приложение вместе с базой
            // при установке release версии приложения
            storeFile file(properties.getProperty('STORE_FILE'))
            storePassword properties.getProperty('STORE_PASSWORD')
            keyAlias properties.getProperty('KEY_ALIAS')
            keyPassword properties.getProperty('KEY_PASSWORD')
        }
        release {
            storeFile file(properties.getProperty('STORE_FILE'))
            storePassword properties.getProperty('STORE_PASSWORD')
            keyAlias properties.getProperty('KEY_ALIAS')
            keyPassword properties.getProperty('KEY_PASSWORD')
        }

in local properties (in the file that lies at the root of the project it is written:
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Thu Jan 21 18:32:52 YEKT 2021
sdk.dir=C\:\\Users\\user\\AppData\\Local\\Android\\Sdk


Googling for a day, I realized that there were problems with keystore files. they are not.
today generated debug keystore with this command
keytool -genkey -v -keystore C:\Users\user\AppData\Local\Android\Sdk\debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"

but I don't understand how to attach it to the project. and how in the end it is already easy to compile the application in android studio. thanks in advance for the replies.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2021-01-23
@vitaly_74

What do you mean by "attach"? You have a block of code that you showed yourself:

storeFile file(properties.getProperty('STORE_FILE'))
            storePassword properties.getProperty('STORE_PASSWORD')
            keyAlias properties.getProperty('KEY_ALIAS')
            keyPassword properties.getProperty('KEY_PASSWORD')

Replace STORE_FILE, STORE_PASSWORD, KEY_ALIAS, KEY_PASSWORD with the data from your generated .keystore file, specify the path to it, passwords, alias.
Either delete this piece of code or comment it out. Next, in Android Studio, in the Build tab , select Generate Signed Bundle / APK , select the APK item , and create a key there by clicking Create New .
If your application is on PlayMarket, then in order to update it, you will need the key that your "colleague" has. The new key you generated will not pass validation there, but it will do for local builds and debugging.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question