Answer the question
In order to leave comments, you need to log in
Unable to find method 'org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;?
If anything, this is a build of the Nuxt + Cordova project. Then I opened the platform in AS IDE and gives this error in the build tab.
Unable to find method 'org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
[email protected]:~/Bash$ gradle -v
------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------
Build time: 2020-03-24 19:52:07 UTC
Revision: bacd40b727b0130eeac8855ae3f9fd9a0b207c60
Kotlin: 1.3.70
Groovy: 2.5.10
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 1.8.0_252 (Oracle Corporation 25.252-b09)
OS: Linux 4.9.0-8-amd64 amd64
[email protected]:/var/www/test/cordova$ cordova platform ls
Installed platforms:
android 8.1.0
[email protected]:~/Bash$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~deb9u1-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
[email protected]:~/Bash$ ls -l ~/.gradle/
total 20
drwxr-xr-x 7 bonbon bonbon 4096 Jul 30 20:10 caches
drwxr-xr-x 3 bonbon bonbon 4096 Jul 30 20:10 daemon
drwxr-xr-x 5 bonbon bonbon 4096 Jul 30 20:10 native
drwxr-xr-x 3 bonbon bonbon 4096 Jun 15 10:43 notifications
drwxr-xr-x 3 bonbon bonbon 4096 Jul 30 20:10 wrapper
Answer the question
In order to leave comments, you need to log in
This is very strange, but in order to fix the gradle, you had to specify the paths in /etc/environment
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java"
ANDROID_HOME=$HOME/Android/Sdk
ANDROID_SDK_ROOT=$HOME/Android/Sdk
source /etc/environment
./sdkmanager --licenses
npm platform remove android
npm platform add android
npm build android
Task :app:assembleDebug
> Task :app:cdvBuildDebug
BUILD SUCCESSFUL in 18s
42 actionable tasks: 42 executed
Built the following apk(s):
/var/www/test/cordova/platforms/android/app/build/outputs/apk/debug/app-debug.apk
[email protected]:/var/www/test/cordova$
Android target: not installed
' this is here Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question