You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "sebastianjnuwu (via GitHub)" <gi...@apache.org> on 2023/09/12 20:52:14 UTC

[GitHub] [cordova] sebastianjnuwu created a discussion: Trying to build app on a vps

GitHub user sebastianjnuwu created a discussion: Trying to build app on a vps

Hello, I'm trying to build an Android application using just one Ubuntu VPS per command line but I'm having problems, see below the error I receive; I was following the documentation

```bash
root@website:~/hello# cordova requirements

Requirements check results for android:
Java JDK: installed 19.0.2
Android SDK: installed true
Android target: not installed
Command failed with ENOENT: avdmanager list target
spawn avdmanager ENOENT
Gradle: installed /usr/share/gradle/bin/gradle
Some of requirements check failed
root@website:~/hello# cordova build
Checking Java JDK and Android SDK versions
ANDROID_HOME=/root/android-sdk (recommended setting)
ANDROID_SDK_ROOT=undefined (DEPRECATED)
Using Android SDK: /usr/lib/android-sdk
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().

* 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 20s
Command failed with exit code 1: /usr/share/gradle/bin/gradle -p /root/hello/platforms/android wrapper -b /root/hello/platforms/android/wrapper.gradle
root@website:~/hello#
```

GitHub link: https://github.com/apache/cordova/discussions/432

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscribe@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova] breautek edited a comment on the discussion: Trying to build app on a vps

Posted by "breautek (via GitHub)" <gi...@apache.org>.
GitHub user breautek edited a comment on the discussion: Trying to build app on a vps

I don't think JDK 19 will work, JDK 11 is what is required by the AGP 7, which is what cordova-android@12 currently uses. That *might* be the cause of the gradle failure.

Since you're operating on a VPS, I assume you're operating headless.

The fact that you have no android targets installed, nor `avdmanager` is on your `PATH` might also be the reason. If android cmdline-tools is on your path, often it will just download/install the requirements needed to build the project, otherwise you'll need to install them yourself.

See the [docs](https://cordova.apache.org/docs/en/11.x/guide/platforms/android/index.html#setting-environment-variables) for what is recommended to set to your `PATH` environment variable.

Some of these will require using the SDK Manager tool to install the packages, which I'm honestly not sure how to do since the SDKManager itself comes from `cmdline-tools`, which is normally installed through the SDK Manager. You may need to consult the android studio documentation for that.

GitHub link: https://github.com/apache/cordova/discussions/432#discussioncomment-6983216

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscribe@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova] sebastianjnuwu added a comment to the discussion: Trying to build app on a vps

Posted by "sebastianjnuwu (via GitHub)" <gi...@apache.org>.
GitHub user sebastianjnuwu added a comment to the discussion: Trying to build app on a vps

Ok, thanks for your information, later, I'll try again, I noticed that the ubuntu android-sdk package doesn't have cmdlines with `avdmanager` I think I'll have to install it manually in the end...


Is there some kind of GitHub action that builds the app? 

GitHub link: https://github.com/apache/cordova/discussions/432#discussioncomment-6984225

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscribe@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova] breautek added a comment to the discussion: Trying to build app on a vps

Posted by "breautek (via GitHub)" <gi...@apache.org>.
GitHub user breautek added a comment to the discussion: Trying to build app on a vps

I don't think JDK 19 will work, JDK 11 is what is required by the AGP 7, which is what cordova-android@12 currently uses. That *might* be the cause of the gradle failure.

Since you're operating on a VPS, I assume you're operating headless.

The fact that you have no android targets installed, nor `avdmanager` is on your `PATH` might also be the reason. If android cmdline-tools is on your path, often it will just download/install the requirements needed to build the project, otherwise you'll need to install them yourself.

See the [docs](https://cordova.apache.org/docs/en/11.x/guide/platforms/android/index.html#setting-environment-variables) for what is recommended to set to your `PATH` environment variable.

Some of these will require using the SDK Manager tool to install the packages, which I'm honestly not sure how to do since the SDKManager itself comes from `cmdline-tools`, which is normally installed through the SDK Manager. You may need to consult the android documentation for that.

GitHub link: https://github.com/apache/cordova/discussions/432#discussioncomment-6983216

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscribe@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org