Des*_*DAI 4 android android-appcompat android-support-library android-studio android-design-library
在我的应用程序中build.gradle,依赖项是:
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:recyclerview-v7:22.0.0'
compile 'com.android.support:cardview-v7:22.0.0'
compile 'com.android.support:support-v13:22.0.0'
compile 'com.android.support:palette-v7:22.0.0'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:percent:22.2.0'
compile 'com.google.android.gms:play-services:7.0.0'
Run Code Online (Sandbox Code Playgroud)
没有compile 'com.android.support:appcompat-v7:22.0.0',我仍然可以使用AppCompatActivity,ActionBar这是来自支持v7库.任何解释背后原因的答案将不胜感激:)
您正在使用
compile 'com.android.support:design:22.2.1'
Run Code Online (Sandbox Code Playgroud)
它有依赖性 'com.android.support:appcompat-v7:22.2.1'
这意味着你的项目也有appcompat库,如果你还没有添加它build.gradle,那么你可以使用AppCompatActivity和ActionBar
这里的pom文件:
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.android.support</groupId>
<artifactId>design</artifactId>
<version>22.2.1</version>
<packaging>aar</packaging>
<dependencies>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>22.2.1</version>
<type>aar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>support-v4</artifactId>
<version>22.2.1</version>
<type>aar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)
您还可以使用该命令显示依赖关系树gradle dependencies.
您可以在这里阅读更多信息.(src:使用gradle查找依赖树)