2

I have an existing Android app and I'm trying to add Rich Push Notifications via the Urban Airship API. I get the following error message after launching the activity:

java.lang.RuntimeException: Binary XML file line #20: You must supply a layout_height attribute.

The stack trace does not mention which XML file has a problem, so I'm kind of stuck. I've looked through all my XML layouts and they all specify a layout_height attribute. Of course I google the problem and I arrived to this: What causes "RuntimeException: Binary XML file line #20: You must supply a layout_height attribute." (ActionBarScherlock is suspected)?

The above is very similar to my problem, but I still can't seem to solve it. I ran through the code in debug mode step by step but I'm still not understanding how to fix it...

Here is my Manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.sandiego.futuretorero"
android:versionCode="100"
android:versionName="1.0.0.0" >

<uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="18" />

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="edu.sandiego.futuretorero.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="edu.sandiego.futuretorero.permission.C2D_MESSAGE" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
    android:name="android.permission.ACCESS_FINE_LOCATION"
    android:required="false" />
<uses-permission
    android:name="android.permission.ACCESS_COARSE_LOCATION"
    android:required="false" />
<uses-permission
    android:name="android.permission.ACCESS_MOCK_LOCATION"
    android:required="false" />
<uses-permission
    android:name="android.permission.VIBRATE"
    android:required="false" />
<uses-permission
    android:name="android.permission.ACCESS_NETWORK_STATE"
    android:required="false" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>

<permission
      android:name="com.ellucian.elluciango.permission.MAPS_RECEIVE"
      android:protectionLevel="signature"/>
<uses-permission android:name="com.ellucian.elluciango.permission.MAPS_RECEIVE"/>

<application
    android:name="com.ellucian.mobile.android.EllucianApplication"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/Theme.Ellucian" 
    android:allowBackup="false"
    android:supportsRtl="true" >
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="KEY"/>

    <provider
        android:name="com.ellucian.mobile.android.provider.EllucianProvider"
        android:authorities="edu.sandiego.futuretorero.contentprovider"
        android:exported="false" />

    <!-- OPTIONAL (for the inbox widget) -->
    <receiver android:name=".urbanairship.RichPushWidgetProvider">
        <intent-filter>
            <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
        </intent-filter>
        <!-- This specifies the widget provider info -->
        <meta-data android:name="android.appwidget.provider"
                android:resource="@xml/widgetinfo" />
    </receiver>

    <!-- The service serving the RemoteViews to the collection widget -->
    <service android:name=".urbanairship.RichPushWidgetService"
        android:permission="android.permission.BIND_REMOTEVIEWS"
        android:exported="false" />

<!-- ACTIVITIES -->

    <!-- Main and Configuration -->
    <activity
        android:name="com.ellucian.mobile.android.MainActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:label="@string/title_activity_main" >
        <intent-filter android:label="@string/app_name">
            <action android:name="android.intent.action.MAIN" />

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

    <activity android:name="edu.sandiego.futuretorero.urbanairship.InboxActivity" />
    <activity android:name="edu.sandiego.futuretorero.urbanairship.PushPreferencesActivity" />
    <activity android:name="edu.sandiego.futuretorero.urbanairship.MessageActivity" />

    <!-- REQUIRED for Urban Airship GCM-->
    <receiver android:name="com.urbanairship.CoreReceiver" />

    <receiver android:name="com.urbanairship.push.GCMPushReceiver" android:permission="com.google.android.c2dm.permission.SEND">        
      <intent-filter>
          <action android:name="com.google.android.c2dm.intent.RECEIVE" />
          <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

          <!-- MODIFICATION REQUIRED - Use your package name as the category -->
          <category android:name="edu.sandiego.futuretorero" />
      </intent-filter>
    </receiver>

    <!-- OPTIONAL, if you want to receive push, push opened and registration completed intents -->
    <!-- Replace the receiver below with your package and class name -->
    <receiver android:name="edu.sandiego.futuretorero.urbanairship.PushReceiver">
    </receiver>

    <!-- REQUIRED for Rich Push -->
    <service android:name="com.urbanairship.richpush.RichPushUpdateService"/>
    <service android:name="com.urbanairship.push.PushService" android:label="Push Notification Service"/>
    <service android:name="com.urbanairship.analytics.EventService" android:label="Event Service"/>

    <!-- This is required for persisting preferences related to push and location -->
    <provider android:name="com.urbanairship.UrbanAirshipProvider"
        android:authorities="edu.sandiego.futuretorero.urbanairship.provider"
        android:exported="false"
        android:multiprocess="true" />

    <!-- OPTIONAL (for segments support) -->
    <service android:name="com.urbanairship.location.LocationService" android:label="Segments Service"/>

    <receiver android:name="edu.sandiego.futuretorero.IntentReceiver" />

    <activity
        android:name="com.ellucian.mobile.android.schoolselector.ConfigurationLoadingActivity"
        android:label="@string/title_activity_configuration_loading"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:noHistory="true" >            
        <intent-filter android:label="@string/app_name">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" android:host="mobile.elluciancloud.com" android:pathPrefix="/mobilecloud/configuration" />
        </intent-filter> 
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.app.SendToSelectionReceiverActivity"
        android:noHistory="true" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.app.ConfigurationUpdateReceiverActivity"
        android:noHistory="true" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.app.OutdatedReceiverActivity"
        android:noHistory="true" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.schoolselector.SchoolSelectionActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:label="@string/title_activity_school_selection"
        android:noHistory="true" >
        <intent-filter android:label="@string/app_name">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" android:host="mobile.elluciancloud.com" android:pathPrefix="/mobilecloud/cloud" />
        </intent-filter>
    </activity>

    <!-- Default -->
    <activity
        android:name="com.ellucian.mobile.android.app.EllucianDefaultDetailActivity"
        android:label="@string/title_activity_default_detail" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>
    </activity>


    <!-- About -->
    <activity
        android:name="com.ellucian.mobile.android.about.AboutActivity"
        android:label="@string/title_activity_about" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>
    </activity>


    <!-- Courses -->
    <activity
        android:name="com.ellucian.mobile.android.courses.overview.CourseOverviewActivity"
        android:label="@string/title_activity_course_overview" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.courses.assignments.CourseAssignmentsActivity"
        android:label="@string/title_activity_course_assignments" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.courses.assignments.CourseAssignmentsDetailActivity"
        android:label="@string/title_activity_course_assignments_detail" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.courses.announcements.CourseAnnouncementsActivity"
        android:label="@string/title_activity_course_announcements" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.courses.announcements.CourseAnnouncementsDetailActivity"
        android:label="@string/title_activity_course_announcements_detail" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.courses.events.CourseEventsActivity"
        android:label="@string/title_activity_course_events" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.courses.events.CourseEventsDetailActivity"
        android:label="@string/title_activity_course_events_detail" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>


    <activity
        android:name="com.ellucian.mobile.android.courses.daily.CoursesDailyScheduleActivity"
        android:label="@string/title_activity_courses_daily_schedule" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.courses.full.CoursesFullScheduleActivity"
        android:label="@string/title_activity_courses_full_schedule" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <!-- Directory -->
    <activity
        android:name="com.ellucian.mobile.android.directory.DirectoryActivity"
        android:label="@string/title_activity_directory" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.directory.DirectoryListActivity"
        android:label="@string/title_activity_directory_list_all" 
        android:launchMode="singleTop" android:exported="false" >
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
               android:resource="@xml/searchable_directory"/>
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.directory.DirectoryDetailActivity"
        android:label="@string/title_activity_directory_detail" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <!-- Events -->
    <activity
        android:name="com.ellucian.mobile.android.events.EventsActivity"
        android:label="@string/title_activity_events"
        android:configChanges="keyboard|keyboardHidden|screenSize"
        android:launchMode="singleTop" android:exported="false" >
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
               android:resource="@xml/searchable_events"/>
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.events.EventsDetailActivity"
        android:label="@string/title_activity_events_detail" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>


    <!-- Grades -->
    <activity
        android:name="com.ellucian.mobile.android.grades.GradesActivity"
        android:label="@string/title_activity_grades" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>            
    </activity>


    <!-- Maps -->
    <activity
        android:name="com.ellucian.mobile.android.maps.MapsActivity"
        android:configChanges="orientation|keyboardHidden"
        android:label="@string/title_activity_maps" >
        <meta-data
            android:name="android.app.default_searchable"
            android:value="com.ellucian.mobile.android.maps.BuildingListActivity" />
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>            
    </activity>
    <activity
        android:name="com.ellucian.mobile.android.maps.LegalNoticesActivity"
        android:label="@string/title_activity_maps" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>
    </activity>

    <activity 
        android:name="com.ellucian.mobile.android.maps.BuildingDetailActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity 
        android:name="com.ellucian.mobile.android.maps.BuildingInfoDetailActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.maps.MapsSingleLocationActivity"
         >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>
    </activity>

    <activity
        android:label="@string/maps_building_list_label"
        android:name="com.ellucian.mobile.android.maps.BuildingListActivity"
        android:configChanges="orientation|keyboardHidden"
        android:launchMode="singleTop"
        android:exported="false" >
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>

        <meta-data
            android:name="android.app.searchable"
            android:resource="@xml/searchable_buildings" />
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <!-- Multimedia -->

    <activity
        android:name="com.ellucian.mobile.android.multimedia.VideoActivity"
        android:label="@string/title_activity_video">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.multimedia.AudioActivity"
        android:label="@string/title_activity_audio">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <!-- News -->
    <activity
        android:name="com.ellucian.mobile.android.news.NewsActivity"
        android:label="@string/title_activity_news"
        android:configChanges="keyboard|keyboardHidden|screenSize"
        android:launchMode="singleTop" android:exported="false" >
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
               android:resource="@xml/searchable_news"/>
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity
        android:name="com.ellucian.mobile.android.news.NewsDetailActivity"
        android:label="@string/title_activity_news_detail" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <!-- About -->
    <activity
        android:name="edu.sandiego.futuretorero.urbanairship.MessagesActivity"
        android:label="@string/title_activity_messages" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>
    </activity>

    <!-- Notifications -->
    <activity
        android:name="com.ellucian.mobile.android.notifications.NotificationsActivity"
        android:label="@string/title_activity_notifications" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <activity 
        android:name="com.ellucian.mobile.android.notifications.NotificationsDetailActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>


    <!-- Numbers -->
    <activity
        android:name="com.ellucian.mobile.android.numbers.NumberListActivity"
        android:label="@string/title_number_list" 
        android:configChanges="keyboard|keyboardHidden|screenSize"
        android:launchMode="singleTop" android:exported="false" >
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
               android:resource="@xml/searchable_numbers"/>
        <meta-data
    android:name="android.support.PARENT_ACTIVITY"
    android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>
    <activity 
        android:name="com.ellucian.mobile.android.numbers.NumbersDetailActivity" 
        android:label="@string/title_number_detail" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>

    <!-- Webframe -->
    <activity
        android:name="com.ellucian.mobile.android.webframe.WebframeActivity"
        android:label="Webframe" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.ellucian.mobile.android.MainActivity"/>  
    </activity>


<!-- SERVICES -->
    <service android:name="com.ellucian.mobile.android.client.services.AuthenticateUserIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.ConfigurationUpdateService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.CourseDetailsIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.CourseGradesIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.CourseRosterIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.CourseAssignmentsIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.CourseAnnouncementsIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.CourseEventsIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.CoursesFullScheduleIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.EventsIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.GradesIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.ImageLoaderService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.MapsIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.NewsIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.NotificationsIntentService" ></service>
    <service android:name="com.ellucian.mobile.android.client.services.NumbersIntentService" ></service>


</application>

I can post my Activity, Styles, and Layouts, but it exceeds the character limit. Like the question above, I am confident it's an issue with ActionBarSherlock, but I don't know how to fix it.

Edit: Adding full stack trace: https://gist.github.com/RommelTJ/8246805

Community
  • 1
  • 1
RommelTJ
  • 701
  • 1
  • 7
  • 20
  • Please post the full stack trace. BTW, there is no `android:required` attribute for ``. – CommonsWare Dec 14 '13 at 00:01
  • Thank you. Posted the full stack trace as a link at the bottom of my OP. Also, here is the code I'm trying to use: https://github.com/urbanairship/android-samples/tree/master/RichPushSample – RommelTJ Jan 03 '14 at 21:22
  • You appear to be adding a `Spinner` to the action bar, perhaps via drop-down list navigation, and there is a problem with the `ArrayAdapter` being used for that `Spinner`. – CommonsWare Jan 03 '14 at 21:27

1 Answers1

2

I also faced the same issue, while working on multiple screen support, this issue came raise if the attribute is not available in default dimension file

for more info, I will attach the screenshot,

Problem -

enter image description here

Solution -

enter image description here

Vivek Hande
  • 929
  • 9
  • 11