Building and installing an android app
Gradle plugin is able to build (but not run or install) an android app:
Text viewer for Amazfit Stratos smartwatch:
git clone https://github.com/domcorvasce/AmazfitTXTViewer cd AmazfitTXTViewer gradle installDebug #which implies all our existing steps like build
All it needs is to know where Android sdk is:
that you just need to download from google: https://developer.android.com/studio/index.html#downloads
gradle itself can warn you on missing targets:
Checking the license for package Android SDK Build-Tools 27.0.3 in /home/alberto/bin/android/sdk/licenses Warning: License for package Android SDK Build-Tools 27.0.3 not accepted. Checking the license for package Android SDK Platform 27 in /home/alberto/bin/android/sdk/licenses Warning: License for package Android SDK Platform 27 not accepted. FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > Failed to install the following Android SDK packages as some licences have not been accepted. platforms;android-27 Android SDK Platform 27 build-tools;27.0.3 Android SDK Build-Tools 27.0.3 To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager. Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html Using Android SDK: /home/alberto/bin/android/sdk * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 1s
which you can install with:
$ANDROID_SDK/tools/sdkmanager "platforms;android-27" $ANDROID_SDK/tools/sdkmanager "build-tools;27.0.3"
Wonder if we:
- Want to support android SDK as we support flatpak sdk (through sdkmanager cli tool)
- Want to support avaliable targets on gradle (now we have multiple targets avaliable on run menu)
NOTE: This can be another example for !183 as java-language-server supports gradle too (as maven, bazel and custom settings) NOTE2: We can abstract this even more for other device development.
Maybe related with #344