Closed scottdangelo closed 6 years ago
Note that the manual install instructions are targeting: Android 6.0 (Marshmallow) (API Level 23)
I have tried re-building the image with the Dockerfile containing:
# Install Android SDK.
RUN sdkmanager --update \
&& yes | sdkmanager \
"build-tools;23.0.3" \
"platforms;android-23"
But I get the same error.
I deleted my Docker image and my mobile/ dir, re-checked out the /mobile dir and still see android-26
targeted when I do the Cordova platform add android
:
Scotts-MBP:mobile scottda$ docker run --volume=/Users/scottda/GitRepos/Forkscottdangelo/watson-calorie-counter/mobile:/mobile calorie-counter cordova platform add android
Using cordova-fetch for cordova-android@~6.3.0
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.watson.caloriecounter
Name: Calorie_Counter
Activity: MainActivity
Android target: android-26
Interesting. According to https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html (which is pointed to by the requirements for manual install)
Cordova's latest Android package supports up to Android API Level 25.
So, looks like Cordova cannot currently support API 26 anyway...
@scottdangelo Cordova Android 6.3.0 which was released on 27th September 2017 targets the latest Android API level of API 26 and has fixed issues related to the Android SDK Tools 26.0.2 release. https://cordova.apache.org/announcements/2017/09/27/android-release.html I was able to deploy with API 26 through manual install. For Docker, copying @dolph !
Did we still want to target Marshmallow 6.0 (api 23), so that more phones could actually use this? According to androidauthority.com:
For all non-Google devices, you’ll be in for a bit of a wait to see Android 8.0 Oreo
on your smartphone.
As of October 2, 2017, the last version of Android, Android Nougat,
is running on only 17.8% of devices — more than a year after the software first launched.
You can expect to see similar numbers for Oreo next year too.
@scottdangelo Probably, we should leave that to the developers choice(In the documentation step we may want to just guide them and let developers choose their Android SDK API level!).However, this app is compatible with latest Android API level of API 26. Deployed and tested through manual install! Thoughts/inputs/suggestions are most welcome! :-) 👍
yes, I think it's fine to allow the dev to choose the api level. But this should be documented, and we shouldn't expect the dev to be at all familiar with any of this. The target audience for journeys (soon to be patterns) is very broad, and the expectation is that anyone can follow the instructions and be up and running without any prior knowledge.
@scottdangelo Sure thing! We will document that input! 👍
PR #54 hopefully takes a step in the right direction by getting the Dockerfile working.
From the mobile/
directory in a "dirty" repository, I got the Dockerfile to work with this patch by first discarding Cordova artifacts:
$ git checkout -- config.xml package.json plugins/fetch.json
$ sudo rm -rf platforms/android/ plugins/android.json plugins/cordova-plugin-camera/ plugins/cordova-plugin-file-transfer/ plugins/cordova-plugin-file/
And then building with Docker:
$ docker build -t calorie-counter .
$ docker run --volume "`pwd`:/mobile" calorie-counter cordova platforms add android
$ docker run --volume "`pwd`:/mobile" calorie-counter cordova requirements
$ docker run --volume "`pwd`:/mobile" calorie-counter cordova plugin add cordova-plugin-camera
$ docker run --volume "`pwd`:/mobile" calorie-counter cordova plugin add cordova-plugin-file-transfer
$ docker run --volume "`pwd`:/mobile" calorie-counter cordova build android
However, I wasn't able to successfully use any Android API version besides v26. It seems there's something else in this repository that results in a requirement for v26 specifically (which would need to change to support v23)? If there is, I haven't been able to find it.
Cordova requirements fail: