My debug AndroidManifest.xml is giving me "cannot resolve symbol errors"

53,102

Solution 1

Go to File > Invalidate Caches / Restart and Invalidate and Restart.

This cleared the errors for me.

Solution 2

There is no issue with your Manifest code this will work fine

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="ac.tec.oop.ahorcado.android"
          android:versionCode="1" 
          android:versionName="1.0">

    <uses-sdk android:minSdkVersion="7" 
              android:targetSdkVersion="16"/>

    <application android:allowBackup="true" 
                    android:icon="@drawable/ic_launcher" 
                    android:label="@string/app_name" 
                    android:theme="@style/AppTheme">
        <activity android:label="@string/app_name"
                  android:name="ac.tec.oop.ahorcado.android.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

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

</manifest>

Some times Eclipse shows unexpected behavior you can cut and paste again the code to Manifest or just restart the IDE it will recompile and remove the error

Solution 3

I tried all mentioned Answer but non of above worked for me
The only Solution worked for me was
Go to Gradle(App)> in the repositories {}> make sure that mavenCentral() is on top>and now remove compile 'which you recently added>sync > Now add again compile "again add the dependencies" > and final sync again
This worked for me

Share:
53,102

Related videos on Youtube

Argus
Author by

Argus

Updated on August 29, 2020

Comments

  • Argus
    Argus over 3 years
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
              package="ac.tec.oop.ahorcado.android"
              android:versionCode="1" 
              android:versionName="1.0">
    
        <uses-sdk android:minSdkVersion="7" 
                  android:targetSdkVersion="16"/>
    
        <application android:allowBackup="true" 
                        android:icon="@drawable/ic_launcher" 
                        android:label="@string/app_name" 
                        android:theme="@style/AppTheme">
            <activity android:label="@string/app_name"
                      android:name="ac.tec.oop.ahorcado.android.MainActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
    
                    <category android:name="android.intent.category.LAUNCHER"/>
                </intent-filter>
            </activity>
        </application>
    
    </manifest>
    

    These lines are giving me "cannot resolve symbol errors", even though the packages from which they need to be referenced is clearly written. I've trying to fix this for hours but I don't know what else to do. I'm using Android Studio, and it has caused me a great number of problems.

    android:icon="@drawable/ic_launcher 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme">
    android:name="ac.tec.oop.ahorcado.android.MainActivity">
    
  • Argus
    Argus over 10 years
    not yet, but I did notice that the resource files for those things are missing, nonetheless, if I add it, there will be another problem, its going to start telling me that there are two packages with the same name. Should I just put my resources and packages into the debug folder?
  • Argus
    Argus over 10 years
    Not using eclipse, although if I weren't so close to finishing this project I would switch. Android Studio hasn't left beta and it has given me so much grief that it just isn't worth all the hassle. I'm starting to think it probably doesn't get along very well with Windows, but what does anyway, aside from Visual Studio. I'll try your suggestion but this is in my debug folder that this manifest is at, not in my main folder, that one is working fine.
  • Trikaldarshiii
    Trikaldarshiii over 10 years
    @Argus I sometimes have faced very weird behavior of eclipse; some times it doesn't show file content just move content to upper and lower lines then i just restart the IDE which resolves the problem
  • Trikaldarshiii
    Trikaldarshiii over 10 years
    @Argus This may be because some the Memory used by IDE grow to peak level and then it start showing weird behavior
  • Etienne Lawlor
    Etienne Lawlor over 10 years
    This worked for me as well. I just wish there was some kind of indication in the IDE to restart the IDE. This is not very obvious.
  • marienke
    marienke about 10 years
    Worked for me too! Thanks.
  • zipzit
    zipzit about 9 years
    Er no to DB:true. (extract from Android Studio...) It's best to leave out the android:debuggable attribute from the manifest. If you do, then the tools will automatically insert android:debuggable=true when building an APK to debug on an emulator or device. And when you perform a release build, such as Exporting APK, it will automatically set it to false. If on the other hand you specify a specific value in the manifest file, then the tools will always use it. This can lead to accidentally publishing your app with debug information.
  • amstegraf
    amstegraf almost 9 years
    I always asked myself how come some know, how did you know? Are you an expert in Android Studio? I'm just curious!
  • Sandeep Londhe
    Sandeep Londhe over 7 years
    Not Working in Android Studio 2.2.0
  • LarsH
    LarsH over 7 years
    I'm sure this is/was a good idea, but in Android Studio 2.2.2 it's not clearing the errors.