Řešení problémů s Android Studiem

Ztráta úložiště klíčů

If you use the same keystore when updating AAPS you do not have to uninstall the previous version on your smartphone. That’s why it is recommended to store the keystore in a safe place.

If you try to install the apk, signed with a different keystore than before, you will get an error message explaining that the installation failed!

In the event that you cannot trace your old keystore or password, proceed as follows:

  1. Export settings on your phone.

  2. Copy or upload the settings file from your phone to an external location (i.e. your computer, cloud storage service…).

  3. Generate a new version of the signed apk as described on the Update guide and transfer it to your phone.

  4. Uninstall previous AAPS version on your phone.

  5. Install new AAPS version on your phone.

  6. Import settings to restore your objectives and configuration.

    If you can’t find these on your phone, copy them from the external storage to your phone.

  7. Check your battery optimization options and disable them again.

  8. Smyčku pak můžete dále používat.

Error „on demand“ Configuration

Gradle Sync can fail for various reasons. When you receive a message saying that ‚gradle sync failed‘, open the „Build“ tab (1) at the bottom of Android Studio and check what error message (2) is displayed.

Gradle Failed

Likely reasons for gradle sync failures are:

Important: After you have followed the instructions for your specific problem, you need to trigger the gradle sync again.

Neprovedené změny

If you receive a failure message like this one:

Gradle Uncommited Changes

Step 1 - Check git installation

  • Open the terminal tab (1) at the bottom of Android Studio and copy the following text and paste or type into the terminal.

    git --version
    

    Gradle Git Version

    Note: There is a space and two hyphens between Git and version!

  • You must receive a message saying what Git version is installed, as you can see in the screenshot above. In this case, go to Step 2.

  • In case you get an message saying

    Git: command not found
    

    your Git installation is not right.

  • Check git installation

  • if on Windows and the Git was just installed, you should restart your computer to make Git globally available after the installation

  • If Git is installed, you have restarted (if on windows), and Git still couldn’t found:

  • Search your computer for a file „git.exe“.

    Note for yourself, which directory it is saved in.

  • Go to the Environment variables in windows, select the variable „PATH“ and click edit. Add the directory where you have found your Git installation.

  • Save and close.

  • Restart Android Studio.

Step 2: Check for uncommitted changes.

  • In Android Studio, open the ‚Commit‘ tab (1) on the left-hand side. Commit Tab: Uncommitted changes

  • You can see either a „Default changeset“ (2) or „Unversioned files“ (3):

    • For „Default changeset“, you probably updated ‚Gradle‘ or changed some of the file contents by mistake.

    • Right click on „Default Changeset“ and select „Rollback“

      Commit Tab: Rollback changes

    • The files are fetched again from the Git server. If there are no other changes in the commit tab, go to Step 3.

  • If you can see „Unversioned Files“, you might have stored files in your source code directory by mistake. Maybe they are important files: like your keystore file, that should be moved elsewhere. If you don’t know what those files are and you have not created them yourself, you can delete them.

    • Use your regular file explorer on your computer to move or cut and paste that file to a safe place.

    • Go back to Android Studio and click the Refresh button (4) within the Commit tab to make sure the file is not stored in the AAPS directory anymore.

      If there are no other changes in the Commit tab, go to Step 3.

Step 3: Resync Gradle (again)

Follow the instructions at Gradle Resync.

Git Pull Failed - Please tell me who you are

If you see this message, Git needs you to identify yourself.

Git identification

Open the terminal and type the following two commands, one after the other.

git config --global user.name "Your name here"
git config --global user.email your.email@here.com

Your name needs to be written between quotation marks.

Git identification fix

Incompatible Gradle JVM

Incompatible Gradle JVM If you experience the above error message, you need to download a correct JVM version before you can try rebuild again:

  1. Check in the requirement table which JVM version you need for the AAPS version you are building, and make a note of it.

  2. Open the Gradle view by clicking on the elephant (1) on the right side of Android Studio and open the settings (2) and select Gradle Settings (3):

Open Gradle Settings

  1. **In Gradle JDK field, check if the appropriate version is selected (1) If not, click on the field, and see if it is already available in the list. The example below shows JVM 21 is labeled as “jbr-21”. If you find it, just select it, and you are done. If not available, then select ‚Download JDK‘.

Select Download JDK

  1. In Version (1), select the JDK required for your AAPS version (the one you made a note of when you checked the requirement table). In Vendor (2) select ‚JetBrains Runtime‘. Location (3): do not change.

Select JDK 17

  1. Close the Settings dialog with OK.

  2. You now need to restart the Gradle Sync. Follow the instructions at Gradle Resync.

Incompatible version of Android Gradle plugin

If you experience the following error message

Incompatible version of Android Gradle plugin

You are using an outdated version of Android Studio. In the menu, go to Help > Check for updates and install any updates of Android Studio and its plugins that are found.

Možnost 3 – Zkuste stáhnout aktualizace

You might get this error message:

Could not resolve... No cached version

  • Zkopírujte ‘git checkout –’ do schránky (bez uvozovek)

    Make sure the button shown at (2) is NOT selected.

    Gradle Offline Mode

  • Now you need to trigger a Gradle Resync

Unable to start daemon process

Pokud vidíte zmíněnou chybovou zprávu, pravděpodobně používáte 32bitový systém Windows 10. This is not supported by Android Studio 3.5.1 and above and unfortunately there is nothing that the AAPS developers can do about this!

There is information on the internet about how to determine wether you have a 32-bit or 64-bit OS - i.e. this one.

Screenshot Unable to start daemon process

Gradle Resync

If you can still see the message that the gradle sync failed, now select the Link „Try again“. Gradle Sync Failed Mode

If you don’t see the message anymore, you can still trigger this manually:

  • Open the Gradle tab (1) on the right border of Android Studio.

    Gradle Reload

  • Right-click on AAPS (2)

  • Click on „Reload Gradle Project“ (3)

Varování kompilátoru Kotlin

When you generate the signed apk, you might get the notification that generation was successfully but are told that this is with ‚0 build variants‘ were generated:

APK generated with 0 build variants

This is a false warning. Check the directory for your selected „Destination folder“ for generation (step Generate Signed APK) and you will find the generated apk there!

Klíč byl vytvořen s chybami

If your build completed successfully but you get compiler or kotlin warnings (indicated by a yellow or blue exclamation mark) then you can just ignore these warnings.

Gradle finished with warnings

Your apk was built successfully and can be transferred to your phone!

Key was created with errors

When creating a new keystore for building the signed apk, on Windows the following error message might appear

Key was created with errors

Zdá se, že se jedná o chybu Android Studia 3.5.1 a jeho prostředí Java ve Windows. Klíč je správně vytvořen, ale doporučení je nesprávně zobrazeno jako chyba. To lze nyní ignorovat.

No CGM data is received by AAPS

  • If you are using patched Dexcom G6 app: this app is outdated. Use the BYODA app instead.

  • If you are using xDrip+: identify receiver as described on xDrip+ settings page.

Apk not installed

poznámka o nainstalované aplikaci v telefonu

  • Ujistěte se, že jste do telefonu přenesli soubor „app-full-release.apk“.

  • Pokud se na telefonu zobrazí „Aplikace není nainstalována“, postupujte následovně:

  1. Export settings (in AAPS version already installed on your phone)

  2. Uninstall AAPS on your phone.

  3. Změňte cílovou složku APK (jiné umístění).

  4. Nainstalujte novou verzi (“app-full-release.apk”)

  5. Importujte nastavení

  6. Znovu zapněte bluetooth a vypněte režim letadlo

Apk installed but old version

If you built the app successfully, transferred it to your phone and installed it successfully but the version number stays the same then you might have missed to update your local copy

Neprovedené změny

If none of the above tips helped you might consider building the apk from scratch:

  1. Export settings (in AAPS version already installed on your phone)

  2. Zálohujte si úložiště klíčů a heslo k němu. In case you have forgotten passwords you can try to find them in project files as described here.

    Nebo můžete vytvořit a použít nové úložiště klíčů.

  3. Build the apk from scratch as described here.

  4. When you have built the apk successfully delete the existing apk on your phone, transfer the new apk to your phone and install.

  5. Import settings again to restore your objectives and settings.

  6. Znovu zapněte bluetooth a vypněte režim letadlo

Aplikace není nainstalována

If the above does not solve your build issue you may wish to try to uninstall Android Studio completely and rebuild from scratch. Some users find that this can resolve their build problem. When deleting Android Studio, do not delete Android user settings and Make sure to uninstall all files associated with Android Studio. If you do not completely remove Android Studio with all hidden files, uninstalling may cause new problems instead of solving your existing one(s). manuály pro kompletní odinstalaci můžete najít na internetu, například

https://stackoverflow.com/questions/39953495/how-to-completely-uninstall-android-studio-from-windowsv10.

Install Android Studio from scratch as described here.