IDE:Android工作室
创建新项目
将appcompat的.jar复制到by/lib/
在项目集合中设置依赖项
将compile“com.android.support:appcompat-v7:18.0.+”添加到build.gradle
添加以下代码:
公共类mainActivity扩展了actionBarActivity{

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setTitle("hello");
}

还有…没有什么。获取下一个错误:
"Gradle: A problem occurred configuring project ':MyApplication'.
> Failed to notify project evaluation listener.   > Could not resolve all dependencies for configuration ':MyApplication:_DebugCompile'.
  > Could not find any version that matches com.android.support:appcompat-v7:18.0.+.
    Required by:
        MyApplicationProject:MyApplication:unspecified"

如何修复?我忘了做什么?

最佳答案

您需要安装支持存储库
3.选择Android支持库项。
注意:如果您使用android studio进行开发,请选择并安装
Android支持存储库项。
http://developer.android.com/tools/support-library/setup.html

07-24 19:05
查看更多