1

This is the first time of using Xamarin.

I couldn't open Main.axml, in the content tab, in order to modify the application view.

I am able only to display it in source tab.

The error message is "The layout could not be loaded: The operation failed due to an internal error: com.android.ide.common.rendering.api.SessionParams.(Lcom/android...

Does anyone know how to fix it.

Thanks all for your help,

AOS
  • 15
  • 1
  • 7

2 Answers2

1

Think the format was just slightly off, try this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <Button
        android:id="@+id/myButton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />
</LinearLayout>

steps to change:

  1. Remove the semi colon at the end of xmlns:android="schemas.android.com/apk/res/android"
  2. change xmlns:android="schemas.android.com/apk/res/android" to xmlns:android="http://schemas.android.com/apk/res/android" - Think the removal of the 'http://' might just be the the formatting of StackOverflow comments
  3. finally change "fill_parent" to "match_parent" in both the layout_width and layout_height little info on the difference here
Community
  • 1
  • 1
Iain Smith
  • 9,230
  • 4
  • 50
  • 61
  • Sorry Iain, but it didn't work Even when i leave Main.axml source code blank, the content tab stills gives me this error message. Thanks again for your help – AOS Jun 20 '15 at 14:43
  • Yes, and it is still the same. This is the current source file ; – AOS Jun 20 '15 at 14:57
  • if you remove the semicolon at the end of xmlns:android="schemas.android.com/apk/res/android" does it work? – Iain Smith Jun 20 '15 at 14:59
0

It appears that your Android SDK install is incomplete/corrupt/mis-matched.

If you run the Android SDK manager (or Android Studio), are any errors reported? Use the manager to update to SDK 24.3+

If you still have problems, post the entire log as a gist.github.com (or similar) so we can have a look at the entire trace from XS.

Also are you on Windows or OS-X?

Xamarin Studio
Version 5.9.4 (build 5)
Installation UUID: c9eca622-356f-4681-a1d2-069016cc404f
Runtime:
    Mono 4.0.2 ((detached/198235d)
    GTK+ 2.24.23 (Raleigh theme)
    Package version: 400020004
Xamarin.Android
Version: 5.1.4.8
Android SDK: /Users/administrator/Library/Developer/Xamarin/android-sdk-mac_x86
    Supported Android versions:
        2.3   (API level 10)
        4.0.3 (API level 15)
        4.4   (API level 19)
Java SDK: /usr
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
SushiHangover
  • 73,120
  • 10
  • 106
  • 165
  • 1
    FYI: The AXML that Iain listed is correct and loads/displays properly in XS. – SushiHangover Jun 21 '15 at 20:46
  • Thanks Robert, Yes it seems there were some issues while installing Xamarin. I had to uninstall it, and install all Android SKD, and other tools, before installing Xamarin, and everything is fixed now. Thanks alot for your help, – AOS Jun 25 '15 at 13:11
  • Nice to hear, happy coding – SushiHangover Jun 25 '15 at 14:07