Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
747 views
in Technique[技术] by (71.8m points)

cordova - Unable to run Ionic app after update to Android Studio 3.0

Here's my Ionic Info

cli packages: (/Users/billb/dev/customer-mkt-app/node_modules)

@ionic/cli-utils  : 1.15.2
ionic (Ionic CLI) : 3.15.2

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 3.0.1
Cordova Platforms  : android 6.2.3 ios 4.4.0
Ionic Framework    : ionic-angular 3.3.0

System:

Android SDK Tools : 26.1.1
ios-deploy        : 1.9.2
Node              : v6.11.5
npm               : 3.10.10
OS                : macOS Sierra
Xcode             : Xcode 9.0.1 Build version 9A1004

Environment Variables:

ANDROID_HOME : /Users/billb/Library/Android/sdk

Misc:

backend : pro

I can successfully build the app. When I try to open it in Android Studio, I get a handful of errors, mostly around a gradle sync failure. Here's the 5 errors in the Messages console.

Unable to resolve dependency for ':@debug/compileClasspath': Could not resolve project :CordovaLib. Could not resolve project :CordovaLib.

Required by: project :

Project : declares a dependency from configuration 'debugCompile' to configuration 'debug' which is not declared in the descriptor for project >:CordovaLib.


Unable to resolve dependency for ':@debugAndroidTest/compileClasspath': Could not resolve project :CordovaLib. Could not resolve project :CordovaLib.

Required by: project :

Project : declares a dependency from configuration 'debugCompile' to configuration 'debug' which is not declared in the descriptor for project >:CordovaLib.


Unable to resolve dependency for ':@debugUnitTest/compileClasspath': Could not resolve project :CordovaLib. Could not resolve project :CordovaLib.

Required by: project :

Project : declares a dependency from configuration 'debugCompile' to configuration 'debug' which is not declared in the descriptor for project > :CordovaLib.


Unable to resolve dependency for ':@release/compileClasspath': Could not resolve project :CordovaLib.

Could not resolve project :CordovaLib. Required by: project :

Project : declares a dependency from configuration 'releaseCompile' to configuration 'release' which is not declared in the descriptor for project :CordovaLib.


Unable to resolve dependency for ':@releaseUnitTest/compileClasspath': Could not resolve project :CordovaLib.

Could not resolve project :CordovaLib. Required by: project :

Project : declares a dependency from configuration 'releaseCompile' to configuration 'release' which is not declared in the descriptor for project :CordovaLib.

I really don't know what this means and Google hasn't turned up anything of any real help. What do I need to do here?

Note: discovered this after posting this. Relaying it here in case it will help someone else.

Don't upgrade to Android Studio 3

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I commented the lines below in the build.gradle file:

//debugCompile project(path: 'CordovaLib', configuration: 'debug') 

//releaseCompile project(path: 'CordovaLib', configuration: 'release')

and added:

compile project(':CordovaLib')

This worked for me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...