androidcordovabuild.gradle

Order of files in outline-apps


After installing JDK 17 and setting variables by this commands:

export ANDROID_HOME=$HOME/Library/Android/sdk
export ANDROID_NDK=$ANDROID_HOME/ndk

curl -o /tmp/commandlinetools.zip https://dl.google.com/android/repository/commandlinetools-mac-13114758_latest.zip
unzip /tmp/commandlinetools.zip -d /tmp
mkdir -p "$ANDROID_HOME/cmdline-tools/latest"
mv /tmp/cmdline-tools/* "$ANDROID_HOME/cmdline-tools/latest/"
export PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin/"

Installing platform and build tools

sdkmanager "platforms;android-34" "build-tools;34.0.0" "ndk;25.1.8937393" 
sdkmanager "sources;android-34" "system-images;android-34;default;arm64-v8a"

cloning outline-app from git hub in order to build the application used this instructions:

cd client
npx cordova requirements android

in order to the line npx cordova requirements android run properly it should be a cordova directory. It needs to have 2 files of config.xml and package.json and a folder name www. the 2 files are located in client folder but folder of www is inside src folder which is a subfolder of client. I tried to move wwwfolder inside client folder to let the command run properly but again after that the build process was not successful.

Does moving this folder cause problem for these files?


Solution

  • The command npx cordova requirements android does not work before a successful build. Therefore, these instructions need to be fixed.

    I guess the use of the command npx cordova requirements android is for when you have built a long time ago, then pull from master, and see that the build fails. Then you can run npx cordova requirements android to see if all the versions are correct, because they might have changed, for example, when you were installing another app/package.

    By the way, npx cordova requirements android is not an essential part of the build. You can skip it and focus on the build instead.

    ~/www-outline-apps/client$ npx cordova requirements android
    Current working directory is not a Cordova-based project.
    ~/www-outline-apps/client$ cd ..
    ~/www-outline-apps$ npm run action client/src/cordova/build android
    
    > action
    > node ./infrastructure/build/run_action.mjs client/src/cordova/build android
    
    ...
      BUILD SUCCESSFUL in 45s
      70 actionable tasks: 70 executed
    ā–¶ action(client/src/cordova/build): šŸŽ‰ Success! (245640ms)
    ~/www-outline-apps$ cd client/
    ~/www-outline-apps/client$ npx cordova requirements android
    
    Requirements check results for android:
    Java JDK: installed 17.0.14
    Android SDK: installed true
    Android target: installed android-34,android-32
    Gradle: installed /opt/gradle-8.7/bin/gradle
    ~/www-outline-apps/client$