I am getting error in android:icon="#drawable/ic_launcher"
what to do ??
I am new to android development.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ledonoff"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".Led_bluetooth"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
</manifest>
I have seen various answers online, but not helped anyone.
Change it to:
android:icon="#mipmap/ic_launcher"
mipmap vs drawable folders
Change it as
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ledonoff"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<application
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".Led_bluetooth"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
</manifest>
Replacing Drwable with mipmap will solve your issue
<Application
...
android:icon="#drawable/ic_launcher" >
<!-- change ic_launcher to whatever your png is named --
you need to do a clean (eclipse -> project -> clean), but you'll know it was successful if a line like this appears in your /gen/R.java file:
public static final int ic_launcher = 0x...;
If it isn't, you can delete the R.java file and the ADT will immediately panic and rebuild it from scratch, incorporating your new drawables.
you have a issue with your drawable,some cases are:
1) image is not existing in drawable.
2) image name is not according to image naming conventions in android.
3) you can check if any issue with images by restarting your eclipse/studio then in console it shows the image having problem..
Related
This is first time I developing an Android App with Bluetooth device and I have no idea what I'm doing wrong.
Please help, thanks!
The Android Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ilovemii.myapplicationblue"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<application
android:name="com.android.tools.fd.runtime.BootstrapApplication"
android:icon="#drawable/icon"
android:label="#string/app_name" >
<activity
android:name="lhu.stevenpon.f713.com.hotlifebluetoothspp"
android:configChanges="orientation|keyboardHidden"
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="lhu.stevenpon.f713.com.DeviceListActivity"
android:configChanges="orientation|keyboardHidden"
android:label="#string/select_device"
android:theme="#android:style/Theme.Dialog" />
<activity
android:name="lhu.stevenpon.f713.com.DeviceListActivity01"
android:configChanges="orientation|keyboardHidden"
android:label="#string/select_device"
android:theme="#android:style/Theme.Dialog" />
</application>
</manifest>
Screenshot of Android Studio
Change it to:
android:icon="#mipmap/ic_launcher"
Since, based on your sceenshot (and the recommended way now) you have icons in mipmap folders.
place your app icon in mipmap folder and
change
<application
android:name="com.android.tools.fd.runtime.BootstrapApplication"
android:icon="#drawable/icon"
android:label="#string/app_name" >
to
<application
android:name="com.android.tools.fd.runtime.BootstrapApplication"
android:icon="#mipmap/your_icon"
android:label="#string/app_name" >
I am trying to import an Eclipse project into Android Studio but this error shows up:
Invalid XML file: C:manifestlocation\AndroidManifest.xml: Content is
not allowed in prolog.
Now this of course means that somehow my AndroidManifest file of the project I want to import is corrupt and has content before the first XML statement. But this is not the case. Here is my full manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.timkranen.flikrboard"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="14" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<service
android:name="com.timkranen.extra.FetchAdressIntentService"
android:enabled="true"
android:exported="false" />
</application>
</manifest>
There is no content before the <?xml version="1.0" encoding="utf-8"?> line. The project is valid and works in Eclipse. But importing it into Android Studio is giving me this problems.
Any solutions? Is there a way to avoid this error?
I have followed several threads on stack overflow but this is the error still shown:
No Launcher activity found!
The launch will only sync the application package on the device!
Here is my android manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="transapps.android_bluetooth_host"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="transapps.android_bluetooth_host.BluetoothHost"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.inent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
It's just a typo. Your intent filter category says "android.inent" which will not match the category name expected by the launcher.
I'm trying to configure my app to program Chromecast featured button.
I'm reading all chromecast SDK and it says that i have to install Google Play Services.
I linked the library to my project, at the same workspace. I did it well because I have a new Android Dependencies library called google_play_services.jar
When I reach this point, I want to test if googlePlayServices are available, so I want to use:
GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
and print a Log with the result.
But the problem appeared here. When I run my app, it says that is not in my Android Manifest.
My Android Manifest has these lines already:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.chromecastAPP"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.chromecastAPP.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Any different solution?
Thank you
Meta-data must be in application tags.
"Edit your application's AndroidManifest.xml file, and add the following declaration within the <application> element. This embeds the version of Google Play services that the app was compiled with." Look this link.
Try this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.chromecastAPP"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.chromecastAPP.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
I also Faced this problem. I just updated my SDK Google Play Service with its update Version and it worked for me...
Try it may be it works for you also..
My manifest.xml is,
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pilot.clicker"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<!-- Required -->
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Light.NoTitleBar" >
<meta-data android:name="com.revmob.app.id" android:value="52eb635c38a33"/>
<activity android:name="com.revmob.ads.fullscreen.FullscreenActivity"
android:theme="#android:style/Theme.Translucent"
android:configChanges="keyboardHidden|orientation">
</activity>
<activity
android:name="com.pilot.clicker.Splash"
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="com.pilot.clicker.Main"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.pilot.clicker.MAINSCREEN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="com.pilot.clicker.List"/>
</application>
</manifest>
The error is being displayed after the first line.
I'm attempting to integrate an ad-service 'Revmob' to my android-application. I've looked for an answer all over the internet..but just can't find a solution. Please help.
Thank you.
Put your uses-permission line after uses-sdk that is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pilot.clicker"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<!-- Required -->
<uses-permission android:name="android.permission.INTERNET"/>
Also try to clean your project go to project menu (if you are using eclipse) and clean your project and re-run it. Might be this will resolve your issue.