2

I have tried nearly everything to get the R.java file to reappear and nothing has worked yet. The src folder and the AndroidManifest.xml file both have an error icons next to them.

I get the following error from the Manifest file...

"error: No resource identifier found for attribute 'installLocation' in package 'android'"

I get the following errors from some .java files in the src folder...

"R cannot be resolved to a variable"

In these .java files the "R" is underlined with a red squiggle.

I have tried the following and none of these methods have worked...

  • Cleaning & Rebuilding the project
  • Removing the "import Android.R" statement
  • Renaming the project and changing it in the Manifest file
  • Checking to ensure that the res/drawable files are lowercase
  • Check that my package declaration in your AndroidManifest.xml matches package name
  • Restarting Eclipse
  • Ticking Android Version Checkbox in the Java Build Path
  • Installing the correct SDK Platform

Any suggestions??

EDIT:

Here's the manifest file...

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.jfedor.frozenbubbleupdate"
    android:installLocation="preferExternal"
    android:versionCode="8"
    android:versionName="1.7" >

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true" />

    <uses-sdk android:minSdkVersion="2" />

    <application
        android:icon="@drawable/app_frozen_bubble"
        android:label="@string/app_name" >
        <activity
            android:name="org.jfedor.frozenbubbleupdate.FrozenBubble"
            android:alwaysRetainTaskState="true"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/app_name"
            android:launchMode="singleInstance" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="org.jfedor.frozenbubble.GAME" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>

</manifest>
4
  • 1
    It sounds like R is not building due to the error in your Manifest. Can you post the manifest? Commented Jul 22, 2013 at 21:03
  • certainly, here's the manifest file attached Commented Jul 22, 2013 at 21:09
  • Check my answer below. It might have something to do with setting your minSdkversion to 2, and setting your targetSdk to something 8 or higher Commented Jul 22, 2013 at 21:14
  • +1 Very clear question with a list of everything you have tried. I hope all new members of SO will take note. Commented Jul 23, 2013 at 0:10

2 Answers 2

1

What value do you have in the minSDK in your AndroidManifest? This problem can be due to having a sdk version lower than API 8: http://developer.android.com/guide/topics/data/install-location.html.
Also, if you could post your Manifest would be usefull. Your R file is not being generated because some error in your project, in your Manifest from what you said. You will need something like this:

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />
Sign up to request clarification or add additional context in comments.

1 Comment

AitorTheRed you are a saint... By changing the minSdkVersion from 2 to 8 and altering the Build Path accordingly removed the errors. Thank you for you help
0

You should add android:targetSdkVersion="17" to your <uses-sdk> tag. The target SDK should always be set to the highest SDK version currently available.

As the android:installLocation attribute wasn't introduced until API version 8, it is likely that not specifying the target SDK is causing the compiler to compile against the wrong API version.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.