locked
[Xamarin Blog] Android Support Library v7: Hello ActionBarCompat RRS feed

  • Question

  • User25759 posted

    Just posted: Android Support Library v7: Hello ActionBarCompat on the Xamarin Blog.

    Read the full article to learn how to use the ActionBarCompat to provide Action Bar backwards compatibility support in you Xamarin.Android app all the back to Android 2.1 with the Android Support Library v7 AppCompat Component.

    Use this thread to discuss or ask question.

    Wednesday, December 11, 2013 12:23 AM

All replies

  • User5087 posted

    Hello,

    because of a problem with ActionBarSherlock and Google Play Services (different support v4 dlls with same content) I changed to this component. After some problems converting my project, I could compile the code and start it on the device. Normal activities work correct, but when I start the first activity derived from ActionBarActivity, I get the following error message, when calling base.OnCreate(bundle):

    java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
    at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:98)
    at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
    at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
    at wf.player.android.CartridgesActivity.n_onCreate(Native Method)
    at wf.player.android.CartridgesActivity.onCreate(CartridgesActivity.java:29)
    at android.app.Activity.performCreate(Activity.java:5104)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2262)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
    at android.app.ActivityThread.access$600(ActivityThread.java:153)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5263)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
    at dalvik.system.NativeStart.main(Native Method)
    }   Java.Lang.NoClassDefFoundError
    

    If I change the base class from ActionBarActivity to Activity, all works perfect.

    Someone out there, who had the same problem with the component?

    Btw. if you use the AppCompat component and the Google Play Service component, you get two entries in References for Xamarin.Android.Support.v4.dll from different places.

    Any help is appreciated.

    Saturday, December 14, 2013 2:56 PM
  • User5087 posted

    Tested it also with Android 2.2 on emulator. There I get

    java.lang.ExceptionInInitializerError
    at android.support.v7.app.ActionBarActivityDelegate.createDelegate(ActionBarActivityDelegate.java:51)
    at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:96)
    at wf.player.android.CartridgesActivity.n_onCreate(Native Method)
    at wf.player.android.CartridgesActivity.onCreate(CartridgesActivity.java:29)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    at android.app.ActivityThread.access$2300(ActivityThread.java:125)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.app.ActivityThread.main(ActivityThread.java:4627)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:521)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$attr
    at android.support.v7.app.ActionBarActivityDelegateBase.<clinit>(ActionBarActivityDelegateBase.java:48)
    ... 17 more
    }   Java.Lang.ExceptionInInitializerError
    
    Saturday, December 14, 2013 3:56 PM
  • User25759 posted

    Do you have a small sample app that I can test out? Which Theme are you attempting to use? Did you try setting it to one of the themes that I specified in the post?

    Saturday, December 14, 2013 4:26 PM
  • User209 posted

    The Google Play Services (Gingerbread) component includes both the Support v4 and Support v7 packages, hence you should not add those yourself. Google Play Services (Froyo) does not include Support v7, as far as I know.

    As soon as you introduce ActionBarSherlock to the mix or vice versa, you will run into problems as both have either a reference to Mono.Android.Support.v4 or Xamarin.Android.Support.v4, which is where you will run into conflicts. In order to fix this for ActionBarSherlock, you could build it from your own binding project and add Xamarin.Android.Support.v4 to it.

    So if you really, really want to use ActionBarSherlock there is either to do the work yourself or wait for Xamarin to make a component using the Xamarin.Support.v4 package instead. Or you could simply go to use the ActionBar Compat from the Support.v7 package, it practically works more or less in the same manner as ABS.

    Saturday, December 14, 2013 5:06 PM
  • User5087 posted

    First of all: thank you for your fast reply!

    @Cheesebaron: That's why I'm in trouble. I moved from ActionBarSherlock to ActionBarCompat and now getting the above mentioned problems.

    I try to use the Theme.AppCompat.Light with the following line of code in AndroidManifest.xml

    <application android:label="WF.Player" android:theme="@style/Theme.AppCompat.Light" android:configChanges="keyboardHidden|orientation|screenSize" android:icon="@drawable/icon">
    

    Hope this is right. But should I insert this theme everywhere in my project? I tried also to add this to the attributes of the ActionBarActivity, which crashes the app:

    Theme="@android:style/Theme.NoTitleBar"
    

    Same behavior as before.

    A small piece of code I don't have, only the whole project. Sorry. I can send it to you, but I think it is a little to big.

    Saturday, December 14, 2013 5:33 PM
  • User25759 posted

    So I took my default example from the post. I removed the Support v7 AppCompat Component and Added in "Google Play Services (Gingerbread)" from the component store and it compiled it (Clean + Rebuild) and it seemed to work great, after changing the heap size to 1G.

    So Look through the Styles that exist for AppCompat: http://developer.android.com/reference/android/support/v7/appcompat/R.style.html Theme.NoTitleBar does not exist which is why you are running into this issue. If you want ToTitleBar that means you wouldn't use an ActionBarActivity and would just use a standard Activity.

    Saturday, December 14, 2013 5:41 PM
  • User209 posted

    I would add the theme in the Activity flags for each of your activities. Also I don't think configChanges should go into the application node in the manifest, but also be declared per Activity.

    My rule of thumb is to almost never touch the manifest manually, but rather use the attributes Xamarin provide, except for when adding permissions or very specialized stuff i.e. for Google Maps etc.

    Saturday, December 14, 2013 5:44 PM
  • User25759 posted

    Also for your styles take a look at how I subclass this theme in my Styles.xml: https://github.com/jamesmontemagno/PlanetXamarin/blob/master/PlanetXamarin.Droid/Resources/Values/Styles.xml

    Then I use is here: https://github.com/jamesmontemagno/PlanetXamarin/blob/master/PlanetXamarin.Droid/MasterActivity.cs

    What you can do is have multiple styles. A BaseTheme and a BaseThemeNoTitle and put customizations. This will allow you to only reference the base @android:style/Theme.AppCompat.Light once in the styles.xml

    Saturday, December 14, 2013 5:45 PM
  • User5087 posted

    Ok, there are more things I don't understand.

    First of all, I don't use NoTitleBar with this activity, only with others, which are working. Only tried, if it than works. But now I have removed it. Don't work again.

    You wrote, that you removed the Support v7 AppCompat component, when you are using Google Play Services component. I want to use both of them. Is this the problem?

    I changed nothing at the heap size. Have I to change something?

    I'm sure, that I missed something when changing to AppCompat. But what could it be? I don't understand the error message with the R$Styable.

    Saturday, December 14, 2013 5:49 PM
  • User5087 posted

    I used the manifest, because I couldn't get the attribute UIOptions for splitting the action bar. But with this nice project from James, I found

    [MetaData ("android.support.UI_OPTIONS", Value = "splitActionBarWhenNarrow")]
    

    for that :)

    So, removed the theme from manifest to the activity. No change, the activity dies at the same position: base.OnCreate(bundle).

    Saturday, December 14, 2013 6:01 PM
  • User25759 posted

    When you add in The Google Play Services (Gingerbread) it adds the App Compat DLL for you automatically, so there is no need to add both of them.

    The problem with R$Styleable is that you are attempting to reference a Theme style that is not available, which is why it crashes. Android attempts to load it, but it is not valid.

    Saturday, December 14, 2013 6:08 PM
  • User5087 posted

    Ok, created a file "Style.xml" in the directory "values" with values from your project. Changed the attributes of the ActionBarActivity to use this theme. Compiled, started the app and go to the problematic activity. Result: the same. Java.Lang.NoClassDefFoundError and R$stylable error (see above).

    Saturday, December 14, 2013 6:10 PM
  • User5087 posted

    I removed the AppCompat component from my project, but with this, the AppCompat.dll is also removed. And than I couldn't compile the project anymore.

    Saturday, December 14, 2013 6:13 PM
  • User5087 posted

    Ok, checked this. Used until now the Google Play Services for Froyo. Removed this and installed the component for Gingerbread. Same result, no change.

    The activity looks now like

    [Activity (Label = "Cartridges", Theme="@style/Theme.AppCompat.Light")]
    public class CartridgesActivity : ActionBarActivity
    {
    
        #region Android Events
    
        /// <summary>
        /// Raised, when the activity is created.
        /// </summary>
        /// <param name="bundle">Bundle with cartridge and restore flag.</param>
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate(bundle);
    

    So, if I understand you right, I had to look, why the app compiles correct, but the style isn't found at runtime. That's hard :(.

    Saturday, December 14, 2013 6:22 PM
  • User5087 posted

    Now changed the theme to "Theme.Light" and get immediatly an error while compiling, that the theme isn't found. Vice versa it says to me, that the theme "Theme.AppCompat.Light" is correct and found by the compiler.

    Saturday, December 14, 2013 6:41 PM
  • User5087 posted

    Now I pressed the start button when getting the error. What I could see for a short time is the activity with the action bar with the right theme (Theme.AppCombat in dark, Theme.AppCompat.Light in white). Than it vanish and I get an SIGSEGV.

    Saturday, December 14, 2013 6:56 PM
  • User25759 posted

    See the attached project. Seems to be working good for me.

    Saturday, December 14, 2013 7:08 PM
  • User5087 posted

    Thank you for your project. I downloaded it, opened it, compiled it and start it. The result: the same as with my project :(. Slightly different error message, but the same as with the emulator. Find attached a screenshot.

    Saturday, December 14, 2013 7:21 PM
  • User25759 posted

    @charlenni so it looks like it build and compiles fine on Xamarin Studio on the Mac, however on Windows I also see this problem (in both xamarin studio and visual studio). I will report this in Bugzilla with this sample project. I don't have a work around currently.

    Here is the bug: https://bugzilla.xamarin.com/show_bug.cgi?id=16801

    Saturday, December 14, 2013 7:49 PM
  • User5087 posted

    Thank you for your help.

    Now I will wait, if there is a solution for the problem.

    Saturday, December 14, 2013 7:53 PM
  • User25759 posted

    For now I would say go ahead and develop using a standard theme (@style/Theme.Holo.Ligh) and derive from Activity, and then it should be a quick change over when it is fixed up.

    Saturday, December 14, 2013 7:56 PM
  • User10006 posted

    I'm having this same problem. Just to test, I created a brand new project, added the play services (gingerbread) component, inherited from ActionBarActivity and deployed. Same error.

    Saturday, December 21, 2013 8:16 PM
  • User5632 posted

    Same here. I spent half a day looking before I found this thread. No work being done on the bug though it would seem :-(

    Saturday, January 4, 2014 9:51 PM
  • User5087 posted

    Is there any timeline, when this bug will be removed?

    Tuesday, January 7, 2014 6:24 PM
  • User209 posted

    Any news on this, @JamesMontemagno?

    Simply using Activity and using a default theme like @style/Theme.Holo.Light won't work well as soon as you use anything that expects a SupportFragmentManager or any other type from Android.Support.V4.

    I.e. a FragmentPagerAdapter expects a SupportFragmentManager or a FragmentManager instance from Android.Support.V4, you cannot get this when using Activity, then the FragmentManager comes from Android.App instead of Android.Support.V4.App.

    So you will have to use FragmentActivity from Android.Support.V4 to get anywhere useful.

    Monday, January 13, 2014 10:08 AM
  • User209 posted

    The Play Service Component just keeps giving me headaches. Since it has issues with all those missing resource, even using the MapView does not work. Inflating it throws a nasty exception.

    Code:

    var view = inflater.Inflate(Resource.Layout.Location, container, false);
    

    Layout:

    <?xml version="1.0" encoding="utf-8"?>
    <com.google.android.gms.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/mapView" />
    

    Exception:

    01-13 17:09:27.186 W/dalvikvm(12006): VFY: unable to resolve static field 3373 (MapAttrs) in Lcom/google/android/gms/R$styleable;
    01-13 17:09:27.186 D/dalvikvm(12006): VFY: replacing opcode 0x62 at 0x000e
    An unhandled exception occured.
    01-13 17:09:33.176 I/MonoDroid(12006): UNHANDLED EXCEPTION: Android.Views.InflateException: Exception of type 'Android.Views.InflateException' was thrown.
    01-13 17:09:33.176 I/MonoDroid(12006): at Android.Runtime.JNIEnv.CallObjectMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00064] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/d23a19bf/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:194
    01-13 17:09:33.176 I/MonoDroid(12006): at Android.Views.LayoutInflater.Inflate (int,Android.Views.ViewGroup,bool) [0x00043] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/d23a19bf/source/monodroid/src/Mono.Android/platforms/android-14/src/generated/Android.Views.LayoutInflater.cs:609
    01-13 17:09:33.176 I/MonoDroid(12006): at SetupCompanion.Droid.Views.Fragments.LocationFragment.OnCreateView (Android.Views.LayoutInflater,Android.Views.ViewGroup,Android.OS.Bundle) [0x00130] in c:\ENM\Main\src\prod\Mobile\SetupCompanion\SetupCompanion.Droid\Views\Fragments\LocationFragment.cs:92
    01-13 17:09:33.176 I/MonoDroid(12006): at Android.Support.V4.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ (intptr,intptr,intptr,intptr,intptr) <IL 0x00026, 0x0019f>
    01-13 17:09:33.176 I/MonoDroid(12006): at (wrapper dynamic-method) object.c10b378f-4e8e-46c9-ad61-81a4199d026c (intptr,intptr,intptr,intptr,intptr) <IL 0x00023, 0x0005f>
    01-13 17:09:33.176 I/MonoDroid(12006): 
    01-13 17:09:33.176 I/MonoDroid(12006):   --- End of managed exception stack trace ---
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.ViewGroup.measureC01-13 17:09:33.176 I/MonoDroid(12006): android.view.InflateException: Binary XML file line #1: Error inflating class com.google.android.gms.maps.MapView
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.LayoutInflater.createView(LayoutInflater.java:620)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
    01-13 17:09:33.176 I/MonoDroid(12006):  at setupcompanion.droid.views.fragments.LocationFragment.n_onCreateView(Native Method)
    01-13 17:09:33.176 I/MonoDroid(12006):  at setupcompanion.droid.views.fragments.LocationFragment.onCreateView(LocationFragment.java:34)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.support.v4.app.Fragment.performCreateView(Fragment.java:1478)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1460)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:472)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.support.v4.view.ViewPager.populate(ViewPager.java:1068)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.support.v4.view.ViewPager.populate(ViewPager.java:914)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1436)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.View.measure(View.java:16497)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:719)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:455)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.View.measure(View.java:16497)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.View.measure(View.java:16497)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
    01-13 17:09:33.176 I/MonoDroid(12006):  at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:327)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.View.measure(View.java:16497)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
    01-13 17:09:33.176 I/MonoDroid(12006):  at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2556)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.View.measure(View.java:16497)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1916)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1113)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1295)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.Choreographer.doCallbacks(Choreographer.java:574)
    01-13 17:09:33.176 I/MonoDroid(12006):  at android.view.Choreographer.doF
    01-13 17:09:33.426 W/dalvikvm(12006): JNI WARNING: JNI function GetMethodID called with exception pending
    In mgmain JNI_OnLoad
    01-13 17:09:33.426 W/dalvikvm(12006):              in Lsetupcompanion/droid/views/fragments/LocationFragment;.n_onCreateView:(Landroid/view/LayoutInflater;Landroid/view/ViewGroup;Landroid/os/Bundle;)Landroid/view/View; (GetMethodID)
    01-13 17:09:33.426 W/dalvikvm(12006): Pending exception is:
    01-13 17:09:33.426 I/dalvikvm(12006): android.view.InflateException: Binary XML file line #1: Error inflating class com.google.android.gms.maps.MapView
    01-13 17:09:33.426 I/dalvikvm(12006):   (raw stack trace not found)
    Unhandled Exception:
    
    Android.Views.InflateException: Loading...
    01-13 17:09:33.426 I/dalvikvm(12006): Caused by:
    01-13 17:09:33.426 I/dalvikvm(12006): java.lang.reflect.InvocationTargetException:
    01-13 17:09:33.466 I/dalvikvm(12006):   at android.support.v4.app.Fragment.performCreateView(F01-13 17:09:33.426 I/dalvikvm(12006):   (raw stack trace not found)
    01-13 17:09:33.426 I/dalvikvm(12006): Caused by:
    01-13 17:09:33.426 I/dalvikvm(12006): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
    01-13 17:09:33.426 I/dalvikvm(12006):   (raw stack trace not found)
    01-13 17:09:33.426 I/dalvikvm(12006): "main" prio=5 tid=1 NATIVE
    01-13 17:09:33.426 I/dalvikvm(12006):   | group="main" sCount=0 dsCount=0 obj=0x41502ca8 self=0x2a00d3e0
    01-13 17:09:33.426 I/dalvikvm(12006):   | sysTid=12006 nice=0 sched=0/0 cgrp=apps handle=1073815892
    01-13 17:09:33.426 I/dalvikvm(12006):   | state=R schedstat=( 0 0 0 ) utm=414 stm=38 core=1
    01-13 17:09:33.456 I/dalvikvm(12006):   #00  pc 0000132e  /system/lib/libcorkscrew.so (unwind_backtrace_thread+29)
    The program 'Mono' has exited with code 0 (0x0).
    

    This needs fixing asap.

    Monday, January 13, 2014 4:16 PM
  • User36 posted

    Are you using a device or an emulator? This type of error is generally because the play SDK version installed on the Android host is not the same you compiled against.

    Add a Play services check in your app as described in http://developer.android.com/google/play-services/setup.html#ensure to make sure it's all good.

    Tuesday, January 14, 2014 3:43 PM
  • User5632 posted

    I tested with Xamarin Studio on my Mac and here it appears to work, except for some quirks that I have found with the options menu on both the ActionBarActivity and the individual Fragments. I have to look into that though.

    Tuesday, January 14, 2014 8:26 PM
  • User5632 posted

    In the end I only found some problems with submenu items not always showing up on my fragment. It will work sporadically when rotating the device.

    I suspect this is a bug in the support package because Google has released a revision 19 and 19.0.1 after Xamarin made their bindings for revision 18 (I believe).

    Tuesday, January 14, 2014 9:16 PM
  • User5632 posted

    I think this is the bug I'm having

    http://gc.codehum.com/p/android/issues/detail?id=59070

    fixed in revision 19.. :-(

    Wednesday, January 15, 2014 4:46 AM
  • User32133 posted

    I also got bit with this bug :( Is there any way to use ActionBarActivity with Google Play Services for Gingerbread in Visual Studio?

    Wednesday, January 22, 2014 9:47 PM
  • User28128 posted

    I'm experiencing a similar situation although I am NOT using Google Play Services. I have an existing project, for which I've taken the following steps:

    1. Add the "Android Support Library v7 AppCompat" component
    2. Add "Theme = "@style/Theme.AppCompat.Light" to the Activity annotation
    3. Let the activity inherit from "ActionBarActivity" instead of "Activity"

    After performing these steps, the app crashes at the first line of my OnCreate() method (which is calling base.OnCreate(bundle)). Letting the activity inherit from Activity again resolves the issue (still referencing the support component, and still using the AppCompat theme).

    I get 2 different crashes, depending on which Android version the app is deployed to. I'm unsure if its relevant, but my project references a java binding project.

    Creating a new project and doing the 3 steps does NOT reproduce the issue.

    On Android 2.3.6: Java.Lang.ExceptionInInitializerError: at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) [0x00084] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/56127394/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:895 at Android.App.Activity.OnCreate (Android.OS.Bundle) [0x00070] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/56127394/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2193 at VifaAndroid.MainActivity.OnCreate (Android.OS.Bundle) [0x00003] in /Users/mgj/Projects/vifa-configurator-android/Vifa/VifaAndroid/MainActivity.cs:42 at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/56127394/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2178 at at (wrapper dynamic-method) object.6cb35e4d-5890-4a14-bfcb-2935e69ae66c (intptr,intptr,intptr) <IL 0x00017, 0x00043> at at --- End of managed exception stack trace --- at java.lang.ExceptionInInitializerError at at android.support.v7.app.ActionBarActivityDelegate.createDelegate(ActionBarActivityDelegate.java:51) at at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:96) at at vifaandroid.MainActivity.n_onCreate(Native Method) at at vifaandroid.MainActivity.onCreate(MainActivity.java:32) at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) at at android.app.ActivityThread.access$1500(ActivityThread.java:117) at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) at at android.os.Handler.dispatchMessage(Handler.java:99) at at android.os.Looper.loop(Looper.java:130) at at android.app.ActivityThread.main(ActivityThread.java:3683) at at java.lang.reflect.Method.invokeNative(Native Method) at at java.lang.reflect.Method.invoke(Method.java:507) at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) at at dalvik.system.NativeStart.main(Native Method) at Caused by: java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$attr at at android.support.v7.app.ActionBarActivityDelegateBase.<clinit>(ActionBarActivityDelegateBase.java:48) at ... 17 more at

    On Android 4.1.1 and 4.1.2: Java.Lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) [0x00084] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/56127394/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:895 at Android.App.Activity.OnCreate (Android.OS.Bundle) [0x00070] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/56127394/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2193 at VifaAndroid.MainActivity.OnCreate (Android.OS.Bundle) [0x00003] in /Users/mgj/Projects/vifa-configurator-android/Vifa/VifaAndroid/MainActivity.cs:37 at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/56127394/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2178 at at (wrapper dynamic-method) object.941abb21-9dc0-4bb3-8779-32c127f8a90f (intptr,intptr,intptr) <IL 0x00017, 0x00043> at at --- End of managed exception stack trace --- at java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable at at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:98) at at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58) at at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98) at at vifaandroid.MainActivity.n_onCreate(Native Method) at at vifaandroid.MainActivity.onCreate(MainActivity.java:32) at at android.app.Activity.performCreate(Activity.java:5206) at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094) at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074) at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135) at at android.app.ActivityThread.access$700(ActivityThread.java:140) at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237) at at android.os.Handler.dispatchMessage(Handler.java:99) at at android.os.Looper.loop(Looper.java:137) at at android.app.ActivityThread.main(ActivityThread.java:4921) at at java.lang.reflect.Method.invokeNative(Native Method) at at java.lang.reflect.Method.invoke(Method.java:511) at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027) at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794) at at dalvik.system.NativeStart.main(Native Method) at

    Friday, January 24, 2014 8:59 AM
  • User209 posted

    Temporary workaround is to use Activity use Theme.Light instead of Theme.AppCompat.Light and use Window.RequestFeature(WindowFeatures.ActionBar); in OnCreate. However that opens up another can of nasty stuff to deal with.

    Friday, January 24, 2014 9:09 AM
  • User28128 posted

    Thanks, but that's not a very useful workaround - It doesn't let you use the ActionBar on pre-3.0 devices.

    Friday, January 24, 2014 9:28 AM
  • User209 posted

    I'd hit up the support and let them know how much you need this. Components on Windows seem to be broken to some extent at the moment, which is really a shame :-(

    Friday, January 24, 2014 10:00 AM
  • User28128 posted

    Im not on Windows, I'm on Mac

    Friday, January 24, 2014 11:17 AM
  • User405 posted

    Yep - there's a big problem with the https://github.com/jamesmontemagno/ActionBarCompatproject (https://github.com/jamesmontemagno/ActionBarCompat) and Google Play Services v.13

    I open the project - builds fine. Add the Google Play Services v.13. component from the Xamarin Component Store and bam ... broken project:

    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(3,3): Error MSB4115: The "exists" function only accepts a scalar value, but its argument "@(AdditionalAndroidResourceManifests)" evaluates to "E:\Work\dev\playground\ActionBarCompat-master\Components\googleplayservices-13.0\lib\android\13\content\google-play-services/libproject/google-play-serviceslib\AndroidManifest.xml;E:\Work\dev\playground\ActionBarCompat-master\Components\xamandroidsupportv7appcompat-7.18.0\lib\android\18\content\support/v7/appcompat\AndroidManifest.xml" which is not a scalar value. (MSB4115) (ActionBarCompat)

    How are we supposed to be able to use the latest Support Library along with Maps?

    Any ideas anyone?

    Cheers

    Saturday, January 25, 2014 9:14 AM
  • User36380 posted

    It's a real trouble, can't develop my application forward, everytime I'm getting java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable any idea how to fix this?

    Monday, January 27, 2014 9:59 PM
  • User36228 posted

    I have the same problem. I haven't been able develop my app. If anybody knows how fix this problem, please post it.

    Thursday, January 30, 2014 7:38 PM
  • User25759 posted

    It looks like it will be put into the 4.12.0 release. Please track the bug for more details on this one: https://bugzilla.xamarin.com/show_bug.cgi?id=16801 Sorry for the inconvenience.

    Friday, January 31, 2014 3:30 AM
  • User35208 posted

    I am trying a very basic test using the V7 App Compat and have been trying to use ActionBarCompat project as a guide. I keep getting a NoClassDefFoundError for android.support.v7.appcompat.R$styleable. I actually have gotten this same error with the ActionBarCompat project if I do a "Clean All" and then run it.

    Looks like the post just above claims this is a bug. Is this the same bug?

    Also, I am on the Alpha stream. Any idea when it will get there?

    Ted

    Java.Lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) [0x00084] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/56127394/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:895 at Android.App.Activity.OnCreate (Android.OS.Bundle) [0x00070] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/56127394/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2193 at ActionBarCompatTest2.MainActivity.OnCreate (Android.OS.Bundle) [0x00010] in /Users/tedrogers/Documents/Xamarin/ActionBarCompatTest2/ActionBarCompatTest2/MainActivity.cs:19 at Android.App.Activity.nOnCreateLandroidosBundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/56127394/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2178 at at (wrapper dynamic-method) object.97b49a9d-9b22-4e46-8f06-a7137d7280c2 (intptr,intptr,intptr) at --- End of managed exception stack trace --- at java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable at at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:98) at at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58) at at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98) at at actionbarcompattest2.MainActivity.n_onCreate(Native Method) at at actionbarcompattest2.MainActivity.onCreate(MainActivity.java:28) at at android.app.Activity.performCreate(Activity.java:5073) at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2081) at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2157) at at android.app.ActivityThread.access$600(ActivityThread.java:139) at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1248) at at android.os.Handler.dispatchMessage(Handler.java:99) at at android.os.Looper.loop(Looper.java:137) at at android.app.ActivityThread.main(ActivityThread.java:5070) at at java.lang.reflect.Method.invokeNative(Native Method) at at java.lang.reflect.Method.invoke(Method.java:511) at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795) at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558) at at dalvik.system.NativeStart.main(Native Method)

    Wednesday, February 5, 2014 12:09 AM
  • User25759 posted

    Ted, what theme are you using for your app? @style/Theme.AppCompat is going to be the default holo theme inherit from.

    Wednesday, February 5, 2014 12:21 AM
  • User35208 posted

    I am using "@style/Theme.AppCompat.Light" just like the ActionBarCompat sample. Also, tried "@style/Theme.AppCompat".

    Ted

    Wednesday, February 5, 2014 12:28 AM
  • User25759 posted

    Ted, would you be able to throw your sample project up somewhere and I will test it out.

    Wednesday, February 5, 2014 12:29 AM
  • User35208 posted

    James,

    Absolutely! Here it is:

    https://drive.google.com/file/d/0B5hM-CTDF46gWW1ZOEVXbldqS1E/edit?usp=sharing

    Let me know if you have any trouble accessing.

    Ted

    Wednesday, February 5, 2014 2:21 AM
  • User25759 posted

    Ted, I gave this a try and was unable to reproduce your issue with it. I tried it on my mac with Xamarin Studio (4.2.3 and X.A 4.10.2), and 2 different windows 8.1 machines with VS 2012(X.A 4.10.02014), and VS 2013 (X.A 4.10.02014). These are the current builds in Stable and Beta.

    Thursday, February 6, 2014 12:05 AM
  • User35208 posted

    James,

    I am runnng Xamarin Studio 4.3.2 (the Alpha stream). Sounds like there is a bug in the Alpha?

    I am very new to Xamarin. Is it easy to switch back to release stream?

    Ted

    Thursday, February 6, 2014 7:31 PM
  • User36228 posted

    When i updated to XS 4.3.2, I solved this problem, but after few hours i had to restart my computer, when i tried to deploy my app, I had the same problem than before. I dont know what happen.

    Tuesday, February 11, 2014 9:17 PM
  • User1327 posted

    I updated to the Alpha channel and I still got this bug:

    Java.Lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable

    Thursday, February 13, 2014 2:48 PM
  • User36228 posted

    It doesn't exist any solution for this problem yet? I have not been able to continue with my project :(

    Friday, February 14, 2014 3:39 PM
  • User35208 posted

    It is my understanding that this works in the "stable" build. I haven't tried it yet as I just used "real" action bar and moved onto other things. I'll try this afternoon and report back.

    Friday, February 14, 2014 3:58 PM
  • User25759 posted

    Remember that is is important to set the Minimum and Target versions when adding the component:

    Your target should be >= 14 Your minimum can be as low as 7

    Friday, February 14, 2014 5:42 PM
  • User35208 posted

    I retried this with the stable build and it works. You cannot currently use V7 ActionBar compat with the Alpha build.

    Friday, February 14, 2014 8:56 PM
  • User25759 posted

    @tmrog thanks for the update on this I will take a look at the Alpha channel.

    Friday, February 14, 2014 9:13 PM
  • User36380 posted

    It was working some time with beta channel, but then it's broken again...I can't understand why it's impossible to run a small smoke test before publishing into the beta channel, it's a base functionality - launching of small application, really..Really sad to see that problem & there is no confidence that tommorrow it would not be broken again..now I'm thinking, may be channel selector in visual studio is broken... :(

    Saturday, February 15, 2014 6:43 PM
  • User28128 posted

    My project behaves similar to @tmrog 's. When i switch to the 'stable' branch, instead of 'alpha', i no longer experience my actionbar issue(s).

    Monday, February 24, 2014 7:41 AM
  • User209 posted

    One thing that bit me, was that the path for my project was a bit long. And since the Support v7 component takes the Java counterpart, unpacks it and compiles it into a jar in the Components folder, it will contain a ridiculous Java folder structure with a shit-ton of sub-folders.

    Hence if you already have a long path to your project, you could get some trouble getting it to work.

    Monday, February 24, 2014 8:22 AM
  • User209 posted

    It could seem that it is broken again in the Beta. It would be appreciated if more effort was put into testing regression, especially in the Google components, which seem to suffer most.

    Monday, February 24, 2014 3:30 PM
  • User15878 posted

    Just updated to the latest 4.12 XS and got the same error, however, I didn't encounter it prior to the upgrade. Running on VS12 win 8.1, updated to the latest stable release and inheriting: <style name="RumbleActionBarTheme" parent="@style/Theme.AppCompat">

    Tuesday, February 25, 2014 9:48 AM
  • User17888 posted

    Same problem here, can't use ActionBarCompat from Support.v7

    Tuesday, February 25, 2014 2:52 PM
  • User12369 posted

    Same problem here. Getting Java.Lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable when launching the ActionBarActivity

    Tuesday, February 25, 2014 3:44 PM
  • User32691 posted

    Xamarin guys! I Hate you! You eat a lot of my time, struggling with YOUR bugs. Thanks, my employer pays for your license, not me. I would never pay a penny for such a product. I just updated to the latest Xamarin Studio and Mono.Android. And my colleagues too. We are on the stable branch, and now our project does not run. I can't work now, until you fix it. I hate Xamarin. Never ever use it again.

    Wednesday, February 26, 2014 9:40 AM
  • User15878 posted

    @DmitryValetin? Have you tryed downgrading to 4.10? you can use the direct link: http://download.xamarin.com/MonoforAndroid/Windows/mono-android-4.10.02014.msi

    it worked for my colleagues, however in my env system still fails to even install. The updates with Xamarin are a catastrophy indeed. Still waiting on the fix, hadn't worked properly for over a day now.

    Wednesday, February 26, 2014 10:04 AM
  • User32691 posted

    @helado, I use Mac environment. Not sure how to deal with msi under Mac...

    Wednesday, February 26, 2014 11:33 AM
  • User15878 posted

    @DmitryValetin? try this link: http://download.xamarin.com/MonoforAndroid/Mac/mono-android-4.10.2-14.pkg

    Wednesday, February 26, 2014 11:38 AM
  • User32691 posted

    Thank you @helado, this fixed at least stylemgr problem.

    Wednesday, February 26, 2014 11:50 AM
  • User32691 posted

    After downgrade I had to make default fragment constructor to be public, not private. Ridiculous tool. Now, everyone can instantiate the class without initialization, which is a potential source of errors in the future.

    Wednesday, February 26, 2014 12:14 PM
  • User40238 posted

    I also got the same problem Java.Lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable launching a ActionBarActivity

    Wednesday, February 26, 2014 1:39 PM
  • User29286 posted

    Same errors for us. I'm able to work after restoring Android Mac 4.10.2-14. Thanks @helado.

    Wednesday, February 26, 2014 3:43 PM
  • User25759 posted

    I updated everything to to the latest stable branches on both my Mac OSX 10.9 and on my Windows 8.1 with VS 2013 and Xamarin Studio to test out my sample project on github: https://github.com/jamesmontemagno/Xamarin.Android-AppCompat/tree/master/ActionBarCompat

    I was unable to get this issue at all on either machines in debug and release. If my folder name was too long then I did get a build error, but I usually keep all of my source in C:/Source so it has never been an issue before. One thing to try is uninstalling all versions of the Mono runtime from your emulator or device you are testing on to see if that helps at all.

    Are there other components that you have included as well? I can test that out also.

    Wednesday, February 26, 2014 5:56 PM
  • User209 posted

    So what version is that? Monday stable was 4.10.2 today it is 4.12.0 build 28 just like it was in Beta and Alpha on monday. 4.10.2 works just fine, the switch to 4.12.0 (28) breaks it again for a lot of us.

    Wednesday, February 26, 2014 7:22 PM
  • User25759 posted

    @Cheesebaron? I am on VS 2013 + Xamarin.Android 4.12.00028

    PC Xamarin Studio: 4.2.3 (build 59)

    on Mac: Xamarin Studio 4.2.3 (build 59) + Xamarin.Android 4.12.0

    Wednesday, February 26, 2014 7:28 PM
  • User15878 posted

    @JamesMontemagno? included the ActionBarActivity, using the ActionBarCompat with Theme.AppCompat as the theme. Activities inherited from: public abstract class MvxActionBarEventSourceActivity : ActionBarActivity , IMvxEventSourceActivity

    Hope this can help, cause it's a huge setback so far

    Wednesday, February 26, 2014 7:32 PM
  • User29286 posted

    Hey James,

    My app is pretty much the same as ActionBarCompat. Turn off Fast assembly deployment. Build & run on a fresh emulator from Studio. Then rebuild and run the app again from Studio to get R$sytyleable failure on a 4.4 emulator.

    I have Use shared Mono runtimes enabled, embed assemblies disabled. My mim api is 7, target is 15, and use latest installed platform is picking 4.3.

    Looks like the support libraries were updated too, but we get the same failure using either. I'm using Intel emulators but we also see this problem on 2.3 and 4.4 hardware.

    Our path names aren't very long, e.g. the root of our project is /Users/sjs/Projects/App/....

    Wednesday, February 26, 2014 7:37 PM
  • User209 posted

    Hmm. Can't reproduce it with your project. However I had to move it to a shorter directory path, otherwise it would complain about Android Support Library not being installed. Really hate the Windows file path length limitation...

    Wednesday, February 26, 2014 7:51 PM
  • User25759 posted

    @helado So I tried this in my Meetup Manager app (open source on github) which is MvvmCross and I got this issues with the styleable. I deleted all of my Mono Android Runtimes and shared support from my device and ran it again and got a different error:

    System.MissingMethodException: Default constructor not found for type Cirrious.CrossCore.IoC.MvxPropertyInjector

    However, if I turn back on fast debug I get the styleable issue, so we will see.

    Still investigating more. @SteveScalpone? are you also using mvvmcross?

    Wednesday, February 26, 2014 8:39 PM
  • User32691 posted

    @JamesMontemagno? that's a usual problem with xamarine: you never ever able to reproduce your customer problem. No reproduce - no fix. My colleague has "HTTP 500 exception" each time he tries to upgrade Xamarin studio. Each time he fills bug report and each time it's rejected due to "unable to reproduce" reason. You want to know the whole list of problems? Here are the most annoying ones: - with xamarine you cannot have an incremental build. It's always full. Even if you don't touch any line in the code and rerun the app - you have to have full build. My project takes over 2 minutes of build time. It's little bit more complicated than "HelloWorld.cs". Each time I have to wait 2 minutes before app arrives on the device... - when you right-click on the project - the menu item is never get highlighted. You need to move mouse cursor up and down several times to make menu item to get highlighted - you cannot share components in the project repository. Each developer must download it's own copy of android-support-v7, google-play-services and so on. Very annoying. - you cannot have google-play-services and android-support and android-support-v7 libraries all together. They will conflict with each other (they use support-v4 with different signatures). I have two instances Xamarin.Android.Support.v4.dll's in my project. I used to manually copy jar files between the components to make them compatible. - you cannot share the code directly. We tried to make a "core" library to share between iOS and Android platforms. We have to have crutches like "project linker add-in" in order to share the code: finally we have core (a real one), android-core and ios-core (replicas). Which means, in case your crutch brakes you will spend days realizing what happened. - your technical support never tries to put some efforts to reproduce the problem. They just tell you: we can't reproduce, sorry, and go away closing ticket. That's all we can get for our 1000 bucks we paid (per seat per platform). They never offered a remote session, they never try to be proactive - just "sorry". Hey, guys. You just mentioned you made an agreement with SAP, targeting enterprise market. I came from enterprise market to mobile development and I must admit, none of the enterprises will pay you for that level of support you provide. Sorry for telling you that, but that's all true. http://std3.ru/87/8d/1378024327-878d7b48912deac702d3420103be0155.gif The last picture is all true about xamarin.

    Wednesday, February 26, 2014 8:54 PM
  • User25759 posted

    @DmitryValetin? I am sorry that you have experienced some issues with some of the Xamarin products and I hope that you have opened some support tickets so our support team can try to figure out what is going on. For product suggestions please do open up UserVoice entries as well as we actively go through them. I have been actively researching this issue with App Compat and as I mentioned above that I have been seeing this now only in my MvvmCross project, but not in any other normal projects. So I am still investigating more to see what I can find.

    Wednesday, February 26, 2014 9:48 PM
  • User209 posted

    Yeah so the problem seems that a regression has snuck in, which was fixed in 4.10.2, where when having multiple binding libraries in a project you would get that NoClassDefError many are getting. When running a single library I.e. Support v7, which you tested on @JamesMontemagno? then all is nice and dandy. Adding another binding library to the mix and it goes boom the same way.

    So when using Google Maps (Gingerbread) you will experience this as it grabs both Support V4 and Google Maps. Other combinations are also hit by this.

    Wednesday, February 26, 2014 10:32 PM
  • User29286 posted

    @JamesMontemagno? My project is not using mvvmcross. The only component is Android Support Library v7 AppCompat, added using "Get More Components...."

    Wednesday, February 26, 2014 10:35 PM
  • User25759 posted

    @SteveScalpone? what happens if you change it from Target v7 to Target v8 and Compile v8?

    Thursday, February 27, 2014 1:44 AM
  • User36878 posted

    @JamesMontemagno I can easily reproduce the error using your sample project in here. Somehow it always works fine if I build and run it the first time, but if I then rebuild the project and run again it will throw the error.

    My environment:
    Windows 8.1
    Xamarin Studio 4.2.3 (Build 59) Stable channel
    Xamarin Android 4.12.0 (Business Edition) Stable channel
    Java SDK 1.6.0

    Thursday, February 27, 2014 8:27 AM
  • User35208 posted

    @Crave_Erik? and @JamesMontemagno? as I mentioned earlier in this thread James' sample project works fine also until you do a clean. So something essential is getting removed in the clean process.

    Thursday, February 27, 2014 1:33 PM
  • User9997 posted

    @tmrog after doing a clean process, how do you get it to work again?

    Thursday, February 27, 2014 9:35 PM
  • User35208 posted

    @AndyW - I got off the alpha channel and back to the stable channel.

    Thursday, February 27, 2014 9:48 PM
  • User9997 posted

    @tmrog - I see, it only happened to me when I upgraded to the latest stable release two days ago. I agree that it is 100% to do with the clean process. I am going to revert back to the release prior to the update. Thank you for your response.

    Thursday, February 27, 2014 10:21 PM
  • User25759 posted

    @tmrog @andyw I was able to reproduce it with that project only after doing a clean. If I manually delete the bin and obj folders and build again it works just fine. (In XS on Mac). I can now also reproduce this with my standard AppCompat without Google Play services as well. We are tracking this actively.

    Thursday, February 27, 2014 10:40 PM
  • User9997 posted

    @JamesMontemagno? - Thanks for the heads up. Deleting both bin and obj folders in VS 2013 worked well for me. Now to see how many times I clean a solution in a day :-)

    Thanks.

    Thursday, February 27, 2014 11:08 PM
  • User41106 posted

    Hello, I use the code in this example

    https://github.com/jamesmontemagno/Xamarin.Android-AppCompat

    but I need to have a menu on the right.

    I changed the file "NavigationDrawer.axml" I change string from

    android:layout_gravity="start"

    to

    android:layout_gravity="end"

    After that the application does not work. Help make the right slide-menu.

    Saturday, March 1, 2014 6:13 PM
  • User209 posted

    @Shuulga please create a new question as it will be more searchable for future reference.

    Saturday, March 1, 2014 8:01 PM
  • User20896 posted

    @JamesMontemagno? - using MVVMCross and getting the error. Manually deleting the bin and obj directories work.

    How do I get access to https://bugzilla.xamarin.com/show_bug.cgi?id=18054 so I can follow progress?

    Monday, March 3, 2014 9:24 PM
  • User25759 posted

    Sorry I didn't see it was an internal bug, but we are working actively on it and I will report status.

    Monday, March 3, 2014 9:31 PM
  • User6500 posted

    Thanks @JamesMontemagno?, I've been struggling with this for a while now and deleting the bin and obj folders fixed it. Thanks again.

    Tuesday, March 4, 2014 2:53 PM
  • User25759 posted

    Latest stable should fix this up 4.12.1

    Thursday, March 6, 2014 12:27 AM
  • User31719 posted

    I've deleted BIN and OBJ folders and republished the app. The solution sounds simple, but worked for me.

    I'm using AppCompatV7 (without Google Play Services) in Visual Studio.

    Thursday, March 6, 2014 5:17 PM
  • User37713 posted

    When I was working with appbarcompat in my project, from one minute to the other, I got the same problem. I tried to clean the project and so on, nothing helped.

    I created a new Xamarin.Android project, imported all files from the other (corrupt) project and everything worked fine again.

    That's pretty annoying when it happens while developing a large project. Any other ideas how to remove this error?

    Friday, March 14, 2014 8:55 AM
  • User28399 posted

    Hello guys any news about this? i'm trying to run the de demo of the xamarin university course Mobile Navigations Patterns, especifically the Flyout demo and still got the same error.

    Thanks before all

    Tuesday, March 18, 2014 1:50 PM
  • User209 posted

    Works fine in latest alpha for me.

    Tuesday, March 18, 2014 3:25 PM
  • User28399 posted

    thanks for the info, will gonna update and try

    Tuesday, March 18, 2014 5:57 PM
  • User28128 posted

    4.12.1 resolved all my issues with the ActionBar in the Support Library.

    Thanks for the keeping us in the loop @JamesMontemagno

    Friday, March 21, 2014 3:13 PM
  • User41005 posted

    Hi I add a submenu on Actionbar and I wanna open it programmatically

        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
    
            if (requestCode == RequestCode.BlueTooth.ActionRequestEnable)
            {
                SupportInvalidateOptionsMenu();
            }
    
        }
    
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            var xBlueToothSubMenu = menu.AddSubMenu("BlueTooth")
                .SetHeaderIcon(Resource.Drawable.BlueTooth_Actionbar)
                .SetHeaderTitle("BlueTooth devices");
    
            if (BlueToothControl.BlueToothAdapter.IsEnabled)
            {
                foreach (string xAdapter in BlueToothControl.PairedDevices)
                {
                    var xIMenuItem = xBlueToothSubMenu.Add(xAdapter)
                        .SetIcon(Resource.Drawable.BlueTooth_Actionbar);
                }
    
                xBlueToothSubMenu.SetIcon(Resource.Drawable.BlueTooth_Active);
    
                // Here I wanna open submenu (xBlueToothSubmenu)
    
            }
            else
            {
                xBlueToothSubMenu.SetIcon(Resource.Drawable.BlueTooth_Passive);
            }
    
            Android.Support.V4.View.MenuItemCompat.SetShowAsAction(xBlueToothSubMenu.Item, Android.Support.V4.View.MenuItemCompat.ShowAsActionIfRoom);
    
            return true;
            //return base.OnCreateOptionsMenu(menu);
        }
    
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (item.TitleFormatted.ToString() == "BlueTooth")
                StartActivityForResult(typeof(BlueToothControl), RequestCode.BlueTooth.ActionRequestEnable);
    
            return base.OnOptionsItemSelected(item);
        }
    
    Friday, May 30, 2014 5:09 AM
  • User54329 posted

    Looks like here is an nine-patch problem in Support.v7, running at API10: http://postimg.org/image/m1tsh7gj7/

    ActionBar background and menu items background is corrupted.

    PS Xamarin Studio 5.5. Application on screenshot is ActionBarCompat demo from github.

    Wednesday, October 15, 2014 8:02 AM
  • User54329 posted

    Temporary(?) fix is to copy the same(!) "nine patch" images from support library to application project.

    Wednesday, October 15, 2014 12:31 PM
  • User71540 posted

    @AndrewNemtsev I'm having a similar problem as shown here: http://forums.xamarin.com/discussion/26486/strange-facebook-login-button-issue#latest

    I've seen this is also happening with the Google SignInButton widget.

    How did you identify which 9 patch images needed to be copied over to your app, or did you just copy them all over?

    Tuesday, October 21, 2014 5:32 PM
  • User54329 posted

    I copied all 9-patch images from suport library, but it's not hard to determine which one is "distorted" visually (black and red pixels help in this detection).

    Wednesday, October 22, 2014 6:09 AM
  • User45152 posted

    Is there an update planned for the Xamarin.Android.Support.v7.AppCompat nuget package? Version 21 has been released and i would really like to use it.

    Wednesday, October 22, 2014 1:41 PM
  • User38410 posted

    Somebody please tell me where 9-patch image is located at? Can I find them from this path android-sdk\extras\android\support\v7\appcompat\?

    Thanks

    Friday, December 12, 2014 9:46 AM
  • User131060 posted

    Hai Everyone, I have a problem with ToolBar Menu. I want the screen as shown below. when we click on Menu the options should show like this. Can anyone plz tell me the code in xamarin forms. Thank you

    Thursday, May 28, 2015 5:48 AM
  • User25759 posted

    You can add toolbar items such as: https://github.com/jamesmontemagno/Hanselman.Forms/blob/master/Hanselman.Portable/Views/BlogDetailsView.cs#L27-L35

    Thursday, May 28, 2015 6:19 AM
  • User211605 posted

    the sharing button is not working on lollipop, any ideas why?

    Monday, April 11, 2016 7:59 AM