Android StackWidget unable to bind - android

I am currently trying to add a widget to my application and have been basing my implementation on this code http://developer.android.com/resources/samples/StackWidget/index.html
I have put all my stack widget related classes in their own package within my main package.
When I try to add the widget it is unable to bind and hence the cards are not displayed (it just states the default text "This is the empty view")
Below is my manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bencallis.dealpad" android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="14" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:icon="#drawable/ic_launcher"
android:logo="#drawable/logo" android:theme="#style/DealPadTheme"
android:hardwareAccelerated="true" android:uiOptions="splitActionBarWhenNarrow">
<activity android:label="#string/app_name" android:name=".DealPadActivity"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SettingsActivity" />
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<!-- Widgets -->
<receiver android:name=".stackwidget.StackWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="#xml/stackwidgetinfo" />
</receiver>
<service android:name="stackwidget.StackWidgetService"
android:permission="android.permission.BIND_REMOTEVIEWS"
android:exported="false" />
</application>
</manifest>
Error message:
E/RemoteViewsAdapterServiceConnection(474): bind(): Unknown component ComponentInfo{com.bencallis.dealpad/com.bencallis.dealpad.stackwidget.StackWidgetService}
I am sure there is a simple mistake somewhere which is making the component info repeat com.bencallis.dealpad.
Any ideas?

It turned out it was to do with my manifest and a problem locating the service. I was missing a . in the name (which gives it the path).
Silly mistake!

Related

Library installed as application Android

I have two android projects, one of them I'm using as library. I've created .aar file to use it as library in project. And it's working :). But I've a problem. It installs two apps with the same name in device. Any suggestion?
Application Manifest
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name="package"
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" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key" />
<activity
android:name="net.riinvest.riinvest.Harta"
android:label="#string/title_activity_maps" >
</activity>
<activity
android:name="package"
android:label="#string/title_activity_kontakti" >
</activity>
</application>
</manifest>
Application that I use as library Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package=""
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="12" android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET"/><!--For connection to server-->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/><!--For RiProfService broadcasting-->
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true"
/>
<application
android:allowBackup="true"
android:icon="#drawable/riiprof_logo"
android:label="#string/app_name"
android:theme="#style/DeviceDefault">
<activity
android:name=""
android:label="#string/app_name"
android:windowSoftInputMode="stateHidden|adjustResize"
android:configChanges="locale|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks in advance.
Best Regards
Remove this part from your library's AndroidManifest:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Its showing 2 launcher icons as both your library manifest and application manifest have following:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
This instructs to enable the activity to be launched by a launcher icon directly. If you remove this from your library manifest. That should fix it. Hope it helps.

"No Launcher activity " found error in eclipse while running android app

I have wrote a simple code in eclipse.when I tried to run it from emulator I got a message:"Unfortunatlly App is stopped"..And logcat message is "No launcher activity found"..
This is my Android-Manifest.xml file..
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.prolific.pl2303hxdsimpletest"
android:versionCode="11"
android:versionName="2.0.2.11" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="15" />
<uses-feature android:name="android.hardware.usb.host"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="com.prolific.pl2303hxdsimpletest.PL2303HXDSimpleTest"
android:label="#string/title_activity_pl2303_hxdsimple_test"
android:screenOrientation="landscape"
android:launchMode="singleTop"
android:theme="#style/AppTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
<!-- action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" /> -->
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="#xml/device_filter" />
</activity>
</application>
</manifest>
I don't know why this error is coming..Anyone have idea why this error is coming??
Thank you,
Laxmi
Try to change activity name to
android:name=".PL2303HXDSimpleTest"
Also, it is a good practice to end the name of the activity with Activity suffix, i.e. MailActivity or MyActivity.
Try to remove this line:
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
Reason:
Multiple action tags in a single intent-filter tag will cause the error.

Widget : No Launcher activity found

I already see the questions about "No Launcher activity found!".
I developped a widget which worked well and suddenly I have this error.
I have a configure activity declared with an intent filter APPWIDGET_CONFIGURE.
Here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tina.prime"
android:versionCode="5"
android:versionName="1.3.2">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<receiver android:name="tina.prime.TheWidget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/config" />
</receiver>
<service android:name="tina.prime.UpdateWidgetService"></service>
<activity android:name=".ConfigureActivity">
<intent-filter>
<action android:name="android.app.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
</application>
</manifest>
The error tells you everything: No Launcher activity found
This means that you haven't declared any activity in your manifest as a launcher, in order to fix this, pick the activity you want to use for starting the app, and add the following attribute to it:
<category android:name="android.intent.category.LAUNCHER" />

AndroidManifest.xml The markup in the document following the root element must be well formed

I have got Eclipse to generate a Basic android Hello World app, But it has 2 errors: first, in my AndroidManifest.xml on these two lines:
I get The markup in the document following the root element must be well formed, Also My R.java Will not generate, no matter how many times I clean my project. Any Answers?
the manifest is here: http://jsfiddle.net/NHDU6/
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
<!--
Declare the contents of this Android application. The namespace
attribute brings in the Android platform namespace, and the package
supplies a unique name for the application. When writing your
own application, the package name must be changed from "com.example.*"
to come from a domain that you own or have control over.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin" >
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<application
android:icon="#drawable/ic_launcher_home"
android:label="#string/home_title" >
<activity
android:name="Home"
android:launchMode="singleInstance"
android:stateNotNeeded="true"
android:theme="#style/Theme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="Wallpaper"
android:icon="#drawable/bg_android_icon"
android:label="Wallpaper" >
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks, Jonathan
Here is your manifest,
You should not specify more than one Manifest and You should not specify more than one <application> tags.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<application
android:icon="#drawable/ic_launcher"
android:label="h" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="Home"
android:launchMode="singleInstance"
android:stateNotNeeded="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="Wallpaper"
android:icon="#drawable/ic_launcher"
android:label="Wallpaper" >
<intent-filter>
<action android:name="android.intent.action.SET_WALLPAPER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
It may be that you are missing something, but sometimes doing a simple re-format of code: CTRL+SHIFT+F, clears the problem.
I looked at your manifest file. The error is caused because you have 2 declarations of <manifest /> tag.
It begins with:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin"
android:versionCode="1"
android:versionName="1.0" >
Then some comments follow and another declaration starts:
<!--
Declare the contents of this Android application. The namespace
attribute brings in the Android platform namespace, and the package
supplies a unique name for the application. When writing your
own application, the package name must be changed from "com.example.*"
to come from a domain that you own or have control over.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jfkingsley.maclogin" >
<uses-permission android:name="android.permission.CALL_PHONE" />
Your either forgot to comment one of the manifests tag, confused something, or following a wrong tutorial. The AndroidManifest file should have only one <manifest /> tag
The Auto-generated AndroidManifest.xml file has some problem by itself. There is two manifest tag and two uses-sdk tag inside it. That is the problem. Do as follows:
1- Delete the closing tag of first manifest tag which is:
</manifest>
2- Delete definition tag of the second manifest tag which is:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="net.learn2develop.fragments"
android:versionCode="1"
android:versionName="1.0" >
3- If there is two uses-sdk tag, also delete the second uses-sdk tag.
I added a new activity to my app, and it gave this error after. The manifest disappeared from android-studio completely.
I had to edit the manifest with a text editor. It seems that when I added a new activity, Android Studio created a new tag then added the new activity tag inside in the manifest file, rather than just adding the tag with the new activity in the manifest.
After you update the manifest, the project worked fine.
<?xml version="1.0" encoding="utf-8"?>
< xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.groofy">
<activity
android:allowBackup="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=".MainActivity"
android:label="#string/title_activity_main"
android:theme="#style/AppTheme.NoActionBar"/>
<activity
android:name=".SignUp"
android:label="#string/title_activity_sign_up"
android:theme="#style/AppTheme.NoActionBar"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
/> should not be at the end of the file I had the same issue the error means the xml file is not correctly formatted you should try removing the / in front of the > or simply reformat

Android error "The application icon is not valid. Use a 48x48 PNG file." in google play

hello I tried to upload an update of my app to Google Play and I found this error, looking on it in google I found multiple solutions but none seem to work.
-I looking for "/n" on my strings.xml.
-Icon files on drawable-hdpi, drawable-mdpi, drawable-ldpi and drawable folders have the correct size. Respectively 72x72, 48x48, 36x36 and 48x48 .png files.
-In my manifest i dont have android:debuggable label.
I stick my manifest in case anyone sees any errors.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="es.gleb" android:versionCode="1" android:versionName="201204041800">
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-sdk android:minSdkVersion="7" />
<application android:icon="#drawable/icon"
android:label="#string/app_name"
android:name="es.gleb.GlebApplication"
>
<activity android:name="es.gleb.ui.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>
<activity android:name="es.gleb.ui.EventsListActivity" android:label="#string/app_name" android:launchMode="singleTop">
</activity>
<activity android:name="es.gleb.ui.EventActivity" android:label="#string/app_name">
</activity>
<activity android:name="es.gleb.ui.LocationsActivity" android:label="#string/app_name">
</activity>
<activity android:name="es.gleb.ui.ExecutionActivity" android:label="#string/app_name">
</activity>
<activity android:name="es.gleb.ui.ExecutionsActivity" android:label="#string/app_name">
</activity>
<activity android:name="es.gleb.ui.OptionsActivity" android:label="#string/app_name">
</activity>
<activity android:name="es.gleb.ui.StationsListActivity" android:label="#string/app_name">
</activity>
<activity android:name="es.gleb.ui.WebViewActivity" android:configChanges="orientation|keyboardHidden"
android:label="#string/app_name">
</activity>
<service android:name="es.gleb.ui.ForegroundService" />
<!-- android:process=":remote"-->
<provider android:name="es.gleb.provider.ZenerLanProvider"
android:authorities="es.gleb.provider.ZenerLanProvider">
</provider>
<receiver android:name="es.gleb.poller.OnAlarmReceiver" />
<service android:name="es.gleb.poller.PollerService" />
<service android:name="es.gleb.service.QueueService"/>
<receiver android:name="es.gleb.poller.OnBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
</manifest>
Sorry for several answers... they were deleted, but i want to say about solution in my case: "\n" at the end of app_name string caused this problem.

Categories

Resources