-1

I cannot see why I'm getting this error? I'm certain my Gradle file and java class are up to par. Class and gradle file posted below. Also, I have no errors in my XML files.

What I have done already:

File > Invalid Caches/Restart

Build > Clean Project

Build > Rebuild Project Restart computer

These are the things that were suggested to do throughout the web but none of them worked.

SplashActivity.java

package com.apress.gerber.currencies;

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

public class SplashActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
 // Letter "R" is red 
    setContentView(R.layout.activity_splash2); 
   }
}

build.gradle

apply plugin: 'com.android.application'

android {
       compileSdkVersion 25
       buildToolsVersion '25.0.1'
       useLibrary 'org.apache.http.legacy' // newly added
  defaultConfig {
    applicationId "com.apress.gerber.currencies"
    minSdkVersion 9
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
       }
     }
  }

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// newly added
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
// newly added
provided 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:<version number>'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
testCompile 'junit:junit:4.12'
}
Azzabi Haythem
  • 2,318
  • 7
  • 26
  • 32
nanoSecond24
  • 15
  • 1
  • 5

1 Answers1

0

Import those classes

import android.view.Window;
import com.apress.gerber.currencies.R;

If the R still cannot resolve, then you do have an error within your resources, not just the XML.

Lots of answers here "cannot resolve symbol R" in Android Studio

Community
  • 1
  • 1
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245