Cordova Android-无法使用DependencyManagementBuildSessionServices.createTransformedFileCache()创建类型为TransformedFileCache的服务

时间:2018-10-11 13:52:46

标签: android cordova gradle cordova-android cordova-8.0.0

最近在Windows 10上升级了Cordova,Gradle和Android SDK。

现在收到此构建错误:

Could not create service of type TransformedFileCache using DependencyManagementBuildSessionServices.createTransformedFileCache().

重新安装Node,Android Studio和Gradle之后的CLI:

C:\WINDOWS\system32>npm install -g cordova
C:\Users\[[USERNAME]]\AppData\Roaming\npm\cordova -> 
C:\Users\[[USERNAME]]\AppData\Roaming\npm\node_modules\cordova\bin\cordova
+ cordova@8.1.2
added 594 packages from 523 contributors in 157.447s

C:\WINDOWS\system32>cd C:\[[FOLDER]]

C:\[[FOLDER]]>cordova create app [[APP ID]] [[APP NAME]]
Creating a new cordova project.

C:\[[FOLDER]]>cd app

C:\[[FOLDER]]\app>cordova platform add android
Using cordova-fetch for cordova-android@~7.1.1
Adding android project...
Creating Cordova project for the Android platform:
    Path: platforms\android
    Package: [[APP ID]]
    Name: [[APP NAME]]
    Activity: MainActivity
    Android target: android-27
Android project created with cordova-android@7.1.1
Android Studio project detected
Android Studio project detected
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android

           This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving android@~7.1.1 into config.xml file ...

C:\[[FOLDER]]\app>cordova build android
Android Studio project detected
ANDROID_HOME=C:\Users\[[USERNAME]]\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_181
studio
Starting a Gradle Daemon (subsequent builds will be faster)

BUILD SUCCESSFUL in 2m 31s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\[[FOLDER]]\app\platforms\android\build.gradle' line: 28

* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not create service of type TransformedFileCache using 
DependencyManagementBuildSessionServices.createTransformedFileCache().

* 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 8s
cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Build file 'C:\[[FOLDER]]\app\platforms\android\build.gradle' line: 28

* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not create service of type TransformedFileCache using 
DependencyManagementBuildSessionServices.createTransformedFileCache().

* 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 8s

已经尝试完全解开并重新安装Cordova,Gradle,Android Studio和Node。如果有人有任何想法,将不胜感激。

0 个答案:

没有答案