Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

<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"> 
like image 551
Argus Avatar asked Sep 21 '13 01:09

Argus


People also ask

How do I change AndroidManifest XML?

Open your Android project and go to <AppProjectFolder>/app/src/main/. Open the app manifest file AndroidManifest. xml and add the following lines to the file as child elements of the <manifest> element. Note: You must include the QUERY_ALL_PACKAGES permission if your app targets Android 11 (API Level 30) or higher.

How do I access AndroidManifest XML?

xml file is created in the app's corresponding dist folder. The file is located at WorkspaceName>/temp/<AppName>/build/luaandroid/dist. The manifest file provides essential information about your app to the Android operating system, and Google Play store.

Where does AndroidManifest XML go?

Every project in Android includes a manifest file, which is AndroidManifest. xml, stored in the root directory of its project hierarchy. The manifest file is an important part of our app because it defines the structure and metadata of our application, its components, and its requirements.

What is the Android versionCode attribute in the AndroidManifest XML file?

The versionCode attribute holds the significant version number used internally. The default install location for the app. The app must be installed on the internal device storage only. If this is set, the app will never be installed on the external storage.


2 Answers

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

This cleared the errors for me.

like image 96
Mohamed Avatar answered Sep 22 '22 10:09

Mohamed


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

like image 32
Trikaldarshiii Avatar answered Sep 23 '22 10:09

Trikaldarshiii