watson-vehicle-damage-analyzer icon indicating copy to clipboard operation
watson-vehicle-damage-analyzer copied to clipboard

Docker Cordova build fails due to Android SDK license issues.

Open scottdangelo opened this issue 5 years ago • 0 comments

Currently, the cordova build android command fails:

BUILD FAILED in 1m 9s                                                                                        
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /mobile/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Build-Tools 26.0.2].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
  Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

Attempts to change the Dockerfile are also failing. Dockerfile:

diff --git a/mobile/Dockerfile b/mobile/Dockerfile
index eabdb20..256a64f 100644
--- a/mobile/Dockerfile
+++ b/mobile/Dockerfile
@@ -27,9 +27,13 @@ ENV PATH ${PATH}:/opt/android/tools/bin
 
 # Install Android SDK.
 RUN sdkmanager --update \
-    && yes | sdkmanager \
+    && yes | sdkmanager --licenses \
     "build-tools;26.0.1" \
-    "platforms;android-26"
+    "platforms;android-26"\
+    "patcher;v4"\
+    "emulator"\
+    "platform-tools"\
+    "tools"

Still results in error.

scottdangelo avatar Apr 30 '19 16:04 scottdangelo