0

I have just installed the latest Android Studio 1.4.1 on OS X (10.10.5). When I create a blank activity, I receive an error caused by the source code generated by Android Studio on its own.

The error can be seen in the attached screenshot:

enter image description here

May be there is a conflict between the AppCompatActivity and other stuff.

This is the Activity generated by AS:

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class ScanActivity extends AppCompatActivity {

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

with the following XML for the layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context="it.informagica.mywings.ScanActivity">

</RelativeLayout>

The compilation settings are the following ones:

enter image description here

enter image description here

And the dependencies are these:

enter image description here

I think I have installed all the SDK Platforms and SDK tools I need. However, I have this error and I have no clue on how to solve it.

Any help?

Antonio Sesto
  • 2,868
  • 5
  • 33
  • 51
  • Could this be the same question: http://stackoverflow.com/questions/33742114/rendering-problems-the-following-classes-could-not-be-found-android-support-v7 – Jim W Nov 19 '15 at 16:37
  • For information, the latest android studio is 2.0 preview 2 http://tools.android.com/download/studio/builds/2-0-preview-2 – Context Dec 06 '15 at 10:42

2 Answers2

2

in style.xml change

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

to

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
birigy
  • 912
  • 6
  • 3
0

I had this exception for the android studio version 1.5. All i did is to change in style.xml

Just change the Style Parent into parent="Theme.AppCompat.Light.NoActionBar"

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

to

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

I haven't find any other better options, if you any one of you have better options to resolve the issue please let us know.

Pranob
  • 641
  • 6
  • 11