Troubleshooting Android Studio

Varování kompilátoru Kotlin

Pokud sestavení proběhne úspěšně, ale objeví se varování kompilátoru Kotlin, prostě je ignorujte.

Sestavení aplikace bylo úspěšné a můžete ji přenést do telefonu.

ignore Kotline compiler warning

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

This seems to be a bug with Android Studio 3.5.1 and its shipped Java environment in Windows. The key is created correctly but a recommendation is falsely displayed as an error. This can currently be ignored.

Nelze stáhnout… / Práce Offline

Pokud se zobrazí podobná chybová zpráva,

Warning could not download

ujistěte se, že položka ‘Offline work’ je deaktivována.

File -> Settings

Settings offline work

Error: buildOutput.apkData must not be null

Sometimes you might get an error message when building the apk saying

Errors while building APK.

Cause: buildOutput.apkData must not be null

This is a known bug in Android Studio 3.5 and will probably not be fixed before Android Studio 3.6. Three options:

  1. Manually delete the three build folders (normal “build”, build folder in “app” and build folder in “wear”) and generate signed apk again.
  2. Set destination folder to project folder instead of app folder as described in this video.
  3. Change apk destination folder (different location).

No CGM data

Uncommitted changes

If you receive failure message like

Failure uncommitted changes

Option 1 - Check git installation

  • git might be not installed correctly (must be globally available)
  • when on Windows and git was just installed, you should restart your computer or at least log out and re-login once, to make git globally available after the installation
  • Check git installation
  • If no git version is shown in check but git is installed on your computer, make sure Android Studio knows where git is located on your computer.

Option 2 - Reload source code

  • In Android Studio select VCS -> GIT -> Reset HEAD
Reset HEAD

Option 3 - Check for updates

  • Copy ‘git checkout –’ to clipboard (without quote signs)

  • Switch to Terminal in Android Studio (lower left side of Android Studio window)

    ../../../_images/GIT_TerminalCheckOut11.PNG
    alt:Android Studio Terminal
  • Paste copied text and press return

    GIT checkout success

App not installed

phone app note installed
  • Make sure you have transferred the “app-full-release.apk” file to your phone.
  • If “App not installed” is displayed on your phone follow these steps:
  1. Export settings (in AAPS version already installed on your phone)
  2. Odinstalujte aplikaci AAPS ze svého telefonu
  3. Enable airplane mode & turn off bluetooth.
  4. Nainstalujte novou verzi (“app-full-release.apk”)
  5. Import settings
  6. Znovu zapněte bluetooth a vypněte režim letadlo

App installed but old version

If you build 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 <../Update-to-new-version.html#update-your-local-copy>.

None of the above worked

If non of the above tips helped you might consider building the app from scratch:

  1. Export settings (in AAPS version already installed on your phone)
  2. Have your key password and key store password ready
    In case you have forgotten passwords you can try to find them in project files as described here. Or you just use a new keystore.
  3. Build app from scratch as described here.
  4. Jestliže jste úspěšně sestavili APK, odstraňte stávající aplikaci z telefonu a přeneste do něj a nainstalujte nový soubor apk.
  5. Import settings

Worst case scenario

In case even building the app from scratch does not solve your problem you might want to try to uninstall Android Studio completely. Some Users reported that this solved their problem.

Make sure to uninstall all files associated with Android Studio. Manuals can be found online i.e. https://stackoverflow.com/questions/39953495/how-to-completely-uninstall-android-studio-from-windowsv10.

Install Android Studio from scratch as described here and do not update gradle.