在Android Studio中检索项目的父项时出错

时间:2015-08-31 06:22:47

标签: java android

Android开发新手。我创建了一个" Hello World" Android Studio中的项目(版本1.3.1)。我正在尝试如何显示日志并查看应用程序如何运行。以下是我在MainActivity.java中的内容,它是由Android Studio自动创建的,我只添加了Log标记。

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MjMessageFromActivities"
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.i(TAG, "onCreate");
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {

        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        int id = item.getItemId();

        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

当我运行应用程序以查看DDMS中的日志时,我收到以下三个错误:

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'

Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\smart\AppData\Local\Android\sdk\build-tools\23.0.0\aapt.exe'' finished with non-zero exit value 1

这是build.gradle内容:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

请您指导我如何修复上述错误以查看日志?

0 个答案:

没有答案