I'm struggling to get my development environment set up for Apache Cordova. I'd like to target an Amazon Fire HD 7 running Fire OS 5.3.6.4 (626532920).
Wikipedia tells me that:
The releases are chronologically sorted and categorized based on the underlying version of their Android codebase.
So I'm assuming that this is built on Android 5.1.1 Lollipop?
Project setup
I first installed Cordova using
yarn global add cordova
I then generated a new project using
cordova create hello_world com.mycompany.hello_world HelloWorld
I added Android as the intended platform using
cordova platform add android
(which installed cordova-android@~7.1.1)
Requirements
After running cordova requirements
I received the following:
Requirements check results for android:
Java JDK: not installed
Failed to find 'JAVA_HOME' environment variable. Try setting it manually.
Android SDK: not installed
Failed to find 'ANDROID_HOME' environment variable. Try setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
Android target: not installed
android: Command failed with exit code ENOENT
Gradle: not installed
Could not find gradle wrapper within Android SDK. Could not find Android SDK directory.
Might need to install Android SDK or set up 'ANDROID_HOME' env variable.
Some of requirements check failed
I resolved (most of) these issues as follows:
Java JDK
I installed Java 8 using brew cask (as later versions of Java don't seem to be compatible)
brew tap caskroom/versions
brew cask install java8
Android SDK
You first need to create the empty repositories config, otherwise the later steps will fail
touch ~/.android/repositories.cfg
This then left things looking a lot healthier as far as cordova requirements
is concerned:
Android Studio project detected
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
No android targets (SDKs) installed!
Gradle: installed /usr/local/Cellar/gradle/4.10.2/bin/gradle
Some of requirements check failed
However I'm struggling with how to set up an Android target for this device.
I think I need to run something like
sdkmanager "platforms;android-27"
But I'm not sure which version of Android I should be using. There is a handy table on the Cordova site but it doesn't make a whole lot of sense to me...