John Schwartz February 2016

Android Studio (1.5.1) -- Error: cannot find symbol class / App won't run

I'm working on my first Android application. It's a very simple farenheit/celsius converter, and all of my IDs, methods, and buttons/text fields are perfectly copied out. I triple checked. (I'm following instructions from a video my professor posted.) However, I'm having difficulty trying to get Android Studio to run the application.

I've found plenty of questions similar to this one and many of them suggest synchronizing the gradle files. So I did. I'm still getting these same error messages:

enter image description here


Here is the app information:

enter image description here

Code from app/res/layout/content_test.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="john.testapplication.TestActivity"
    tools:showIn="@layout/activity_test">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="numberDecimal"
        android:ems="10"
        android:id="@+id/temperatureEditText"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout        

Answers


John Schwartz February 2016

Okay, with some help from someone on this site, I found a solution. Apparently in TestActivity.xml, I forgot to import these:

import android.widget.EditText;
import android.widget.RadioButton;

Fixed everything. I had assumed it was already all imported. Thanks to Eugen Pechanec for the helpful tips.

Post Status

Asked in February 2016
Viewed 3,127 times
Voted 8
Answered 1 times

Search




Leave an answer