我在模塊設置中具有所有必需的依賴關係。我還使用sdk管理器安裝了所有支持庫。在構建Project時,出現以下錯誤:app:compileDebugJava。它說錯誤:軟件包android.support.v7.app不存在
我從搖籃控制檯
Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature.
:app:preBuild
:app:compileDebugNdk
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72103Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42103Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices6587Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/LoginConfim.java:4: error: package android.support.v7.app does not exist
import android.support.v7.app.ActionBarActivity;
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/LoginConfim.java:11: error: cannot find symbol
public class LoginConfim extends ActionBarActivity {
^
symbol: class ActionBarActivity
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/RegistrationScreen.java:4: error: package android.support.v7.app does not exist
import android.support.v7.app.ActionBarActivity;
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/RegistrationScreen.java:11: error: cannot find symbol
public class RegistrationScreen extends ActionBarActivity {
^
symbol: class ActionBarActivity
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:4: error: package android.support.v7.app does not exist
import android.support.v7.app.ActionBarActivity;
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:11: error: cannot find symbol
public class WelcomeScreen extends ActionBarActivity {
^
symbol: class ActionBarActivity
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/LoginConfim.java:13: error: method does not override or implement a method from a supertype
@Override
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/LoginConfim.java:15: error: cannot find symbol
super.onCreate(savedInstanceState);
^
symbol: variable super
location: class LoginConfim
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/LoginConfim.java:16: error: cannot find symbol
setContentView(R.layout.activity_login_confim);
^
symbol: method setContentView(int)
location: class LoginConfim
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/LoginConfim.java:20: error: method does not override or implement a method from a supertype
@Override
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/LoginConfim.java:23: error: cannot find symbol
getMenuInflater().inflate(R.menu.menu_login_confim, menu);
^
symbol: method getMenuInflater()
location: class LoginConfim
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/LoginConfim.java:27: error: method does not override or implement a method from a supertype
@Override
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/LoginConfim.java:39: error: cannot find symbol
return super.onOptionsItemSelected(item);
^
symbol: variable super
location: class LoginConfim
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/LoginConfim.java:43: error: cannot find symbol
startActivity(new Intent(getApplicationContext(), WelcomeScreen.class));
^
symbol: method getApplicationContext()
location: class LoginConfim
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/LoginConfim.java:43: error: cannot find symbol
startActivity(new Intent(getApplicationContext(), WelcomeScreen.class));
^
symbol: method startActivity(Intent)
location: class LoginConfim
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/RegistrationScreen.java:13: error: method does not override or implement a method from a supertype
@Override
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/RegistrationScreen.java:15: error: cannot find symbol
super.onCreate(savedInstanceState);
^
symbol: variable super
location: class RegistrationScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/RegistrationScreen.java:16: error: cannot find symbol
setContentView(R.layout.activity_registration_screen);
^
symbol: method setContentView(int)
location: class RegistrationScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/RegistrationScreen.java:20: error: method does not override or implement a method from a supertype
@Override
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/RegistrationScreen.java:23: error: cannot find symbol
getMenuInflater().inflate(R.menu.menu_registration_screen, menu);
^
symbol: method getMenuInflater()
location: class RegistrationScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/RegistrationScreen.java:27: error: method does not override or implement a method from a supertype
@Override
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/RegistrationScreen.java:39: error: cannot find symbol
return super.onOptionsItemSelected(item);
^
symbol: variable super
location: class RegistrationScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/RegistrationScreen.java:42: error: cannot find symbol
startActivity(new Intent(getApplicationContext(), WelcomeScreen.class));
^
symbol: method getApplicationContext()
location: class RegistrationScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/RegistrationScreen.java:42: error: cannot find symbol
startActivity(new Intent(getApplicationContext(), WelcomeScreen.class));
^
symbol: method startActivity(Intent)
location: class RegistrationScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:13: error: method does not override or implement a method from a supertype
@Override
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:15: error: cannot find symbol
super.onCreate(savedInstanceState);
^
symbol: variable super
location: class WelcomeScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:16: error: cannot find symbol
setContentView(R.layout.activity_welcome_screen);
^
symbol: method setContentView(int)
location: class WelcomeScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:20: error: method does not override or implement a method from a supertype
@Override
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:23: error: cannot find symbol
getMenuInflater().inflate(R.menu.menu_welcome_screen, menu);
^
symbol: method getMenuInflater()
location: class WelcomeScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:27: error: method does not override or implement a method from a supertype
@Override
^
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:39: error: cannot find symbol
return super.onOptionsItemSelected(item);
^
symbol: variable super
location: class WelcomeScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:43: error: cannot find symbol
startActivity(new Intent(getApplicationContext(), ShoppingWithFriendsLogin.class));
^
symbol: method getApplicationContext()
location: class WelcomeScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:43: error: cannot find symbol
startActivity(new Intent(getApplicationContext(), ShoppingWithFriendsLogin.class));
^
symbol: method startActivity(Intent)
location: class WelcomeScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:47: error: cannot find symbol
startActivity(new Intent(getApplicationContext(), RegistrationScreen.class));
^
symbol: method getApplicationContext()
location: class WelcomeScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:47: error: cannot find symbol
startActivity(new Intent(getApplicationContext(), RegistrationScreen.class));
^
symbol: method startActivity(Intent)
location: class WelcomeScreen
/Users/AMTAGRWL/Downloads/Dropbox/GT:CLASSES/Spring 2015/CS 2340/git/TrueProjectUnicorn/ShoppingWithFriends/app/src/main/java/com/projectunicorn/shoppingwithfriends/WelcomeScreen.java:50: error: method does not override or implement a method from a supertype
@Override
^
36 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.692 secs
我試圖對此多個現有職位,但都未能找到有效的解決方案如下輸出。
編輯:我的build.gradle文件。
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.projectunicorn.shoppingwithfriends"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:6.5.87'
compile ('com.android.support:appcompat-v7:21.0.3')
compile ('com.android.support:support-v4:21.0.+')
}
我在OS X Yosemite上使用Android Studio 1.0.2。
你想'支持'v4和'appcompat' v7。 – 2015-02-11 00:03:05