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

<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">

Go to File > Invalidate Caches / Restart and Invalidate and Restart.
This cleared the errors for me.

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

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

try to add debuggable to true in application tag in manifest
<application android:allowBackup="true"
android:debuggable="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
I hope it,s work for you.

Related

Android Studio 3.1.3 android:roundIcon

I have a Compile Error telling me to remove android:roundIcon from AndroidManifest.xml, similar to this other post:
No resource identifier found for attribute 'roundIcon' in package 'android'
I have targeted API 15 and only have that version installed, but Android Studio keeps re-adding that line and breaking compilation. How do I stop/fix this?
My build.gradle has:
minSdkVersion 15
targetSdkVersion 15
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testapplication"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="15" />
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity android:name="com.example.testapplication.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
It just keeps re-adding android:roundIcon="#mipmap/ic_launcher_round" if I delete it. How do I stop that behaviour?
Thanks.
Just remove all the "#mipmap/ic_launcher" for round icons. You'll be done. Also, if it doesn't solve, try adding your own icon for the same using an image asset and setting it as "ic_launcher" icon.

Manifest error while implementing MaterialNavigationDrawer

I am trying to integrate this Material Drawer to my project, however i am facing a Manifest error. I have tried changing the minSdk and targetSdk as it is suggested on some similar questions but with no success.
Here is the error i get:
Error:Execution failed for task ':app:processDebugManifest'.
> Error: [project_path\build\intermediates\exploded-aar\it.neokree\MaterialNavigationDrawer\1.2.9\AndroidManifest.xml:8] Invalid instruction 'overrideLibrary', valid instructions are : REMOVE,REPLACE,STRICT
Here is my app manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.package.name">
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".activities.SplashScreenActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:theme="#style/NavigationDrawer" />
</application>
</manifest>
I am using Android Studio (Beta) 0.8.0.
What is causing this error?
I solved the error by going to the MaterialDrawer library Manifest and removing the uses-sdk:
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="21"
tools:overrideLibrary="at.markushi.ui" >
</uses-sdk>
I am not sure if that will bring up any error later on but at least it solve the problem i had

Android Manifest file messed up after rebuild

I'm a bit new at this, so please forgive me:
In Android Studio, I went to the Build menu and rebuilt my project (mostly out of curiosity, since I'm still new and want to learn what everything does). However, this had the unintended side effect of completely screwing over my Android Manifest file, which is shown:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.jeffv.shakesperianinsultkit">
<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="com.jeffv.shakesperianinsultkit.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Android Studio is giving me 'unable to resolve' errors on #string/app_name, MainActivity, #style/AppTheme, and #drawable/ic_launcher.
So, I ask you all: What did I screw up, and how do I fix it?

Export Problems - to .apk

App works fine when tested from Eclipse on phone via USB/Sync, when I try and Export it to an .apk, the Manifest.xml looses track of 2 activities under the parent "MasterActvity". Then even the USB/Sync stops working because it can't locate the activities. No memory storage is used, just text displays.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.theoreferenceguide"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.theoreferenceguide.MasterActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="TipActivity"></activity> This keeps getting kicked out during .apk
<activity android:name="UccActivity"></activity> This keeps getting kicked out during .apk
</application>
</manifest>
I agree with nicopico. It looks like you are missing the . infront of the activity which tells the manifest that the activity is in the local namespace. Alternatively if TipActivity is in the same namespace as MasterActivity you can also do android:name="com.example.theoreferenceguide.TipActivity"

android manifest is no well formed

Since i upgraded to ADT 20, i've been trying to create new Android project, but the same thing happen every time : The markup in the document preceding the root element must be well-formed. And i've got another error in my main activity. R is not generated.
<<<<<<< Original
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="15" />
<application android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme">
</application>
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="15" />
<application android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme">
</application>
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Test"
android:label="#string/title_activity_test" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.testphonegap.MainActivity" />
</activity>
</application>
<application>
<activity android:name=".Test"
android:label="#string/title_activity_test">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
=======
<application>
<activity android:name=".Test"
android:label="#string/title_activity_test">
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="android.app.ListActivity" />
</activity>
</application>
Added
Okay, i think i know what happen. So the first time i wanted to create this new project, i missed something, so i deleted it from Eclipse, and from my computer, i started again, without exiting Eclipse, so it build in top of the former AndroidManifest.xml (even if it was deleted). So i deleted all, made a clean, and reboot Eclipse, and know it's working fine.
As my knowledge you have to upgrade to ADT 20.0.1

Categories

Resources