SVG not supported in Xamarin?

choidlchoidl ATMember
edited September 2015 in Xamarin.Android

Hello,

I'm having a simple app, where i want to have an svg-path as background for an ImageView.
Always when i want to debug the app on my phone or an emulator, the following exception occurs:

09-09 17:57:26.124 I/MonoDroid( 7651): at Android.App.Activity.SetContentView (int) [0x00070] in /Users/builder/data/lanes/1978/f98871a9/source/monodroid/src/Mono.Android/platforms/android-22/src/generated/Android.App.Activity.cs:5500
An unhandled exception occured.

09-09 17:57:26.124 I/MonoDroid( 7651): at App1asdfasdf.MainActivity.OnCreate (Android.OS.Bundle) [0x00016] in c:\users\michi\documents\visual studio 2015\Projects\App1asdfasdf\App1asdfasdf\MainActivity.cs:22
09-09 17:57:26.124 I/MonoDroid( 7651): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/1978/f98871a9/source/monodroid/src/Mono.Android/platforms/android-22/src/generated/Android.App.Activity.cs:2741
09-09 17:57:26.124 I/MonoDroid( 7651): at (wrapper dynamic-method) object.723be9d1-ac6b-40c0-a298-0697a3336b46 (intptr,intptr,intptr)
09-09 17:57:26.124 I/MonoDroid( 7651): --- End of managed exception stack trace ---
09-09 17:57:26.128 I/MonoDroid( 7651): Caused by: android.content.res.Resources$NotFoundExceptio09-09 17:57:26.128 I/MonoDroid( 7651): android.view.InflateException: Binary XML file line #1: Error inflating class
09-09 17:57:26.128 I/MonoDroid( 7651): at android.view.LayoutInflater.createView(LayoutInflater.java:620)
09-09 17:57:26.128 I/MonoDroid( 7651): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
09-09 17:57:26.128 I/MonoDroid( 7651): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.app.Activity.setContentView(Activity.java:1929)
09-09 17:57:26.128 I/MonoDroid( 7651): at md59fd1313acdf6e7706b1bf7fe502c7c2a.MainActivity.n_onCreate(Native Method)
09-09 17:57:26.128 I/MonoDroid( 7651): at md59fd1313acdf6e7706b1bf7fe502c7c2a.MainActivity.onCreate(MainActivity.java:28)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.app.Activity.performCreate(Activity.java:5231)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.app.ActivityThread.access$800(ActivityThread.java:135)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.os.Handler.dispatchMessage(Handler.java:102)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.os.Looper.loop(Looper.java:136)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.app.ActivityThread.main(ActivityThread.java:5001)
09-09 17:57:26.128 I/MonoDroid( 7651): at java.lang.reflect.Method.invokeNative(Native Method)
09-09 17:57:26.128 I/MonoDroid( 7651): at java.lang.reflect.Method.invoke(Method.java:515)
09-09 17:57:26.128 I/MonoDroid( 7651): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
09-09 17:57:26.128 I/MonoDroid( 7651): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
09-09 17:57:26.128 I/MonoDroid( 7651): at dalvik.system.NativeStart.main(Native Method)
09-09 17:57:26.128 I/MonoDroid( 7651): Caused by: java.lang.reflect.InvocationTargetException
09-09 17:57:26.128 I/MonoDroid( 7651): at java.lang.reflect.Constructor.constructNative(Native Method)
09-09 17:57:26.128 I/MonoDroid( 7651): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.view.LayoutInflater.createView(LayoutInflater.java:594)
09-09 17:57:26.128 I/MonoDroid( 7651): ... 25 more
09-09 17:57:26.128 I/MonoDroid( 7651): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/forest.xml from drawable resource ID #0x7f020000
09-09 17:57:26.128 I/MonoDroid( 7651): at android.content.res.Resources.loadDrawable(Resources.java:2096)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.widget.ImageView.(ImageView.java:129)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.widget.ImageView.(ImageView.java:119)
09-09 17:57:26.128 I/MonoDroid( 7651): ... 28 more
09-09 17:57:26.128 I/MonoDroid( 7651): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector
09-09 17:57:26.128 I/MonoDroid( 7651): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877)
09-09 17:57:26.128 I/MonoDroid( 7651): at android.content.res.Resources.loadDrawable(Resources.java:2092)
09-09 17:57:26.128 I/MonoDroid( 7651): ... 31 more
09-09 17:57:26.128 D/AndroidRuntime( 7651): Shutting down VM
09-09 17:57:26.128 W/dalvikvm( 7651): threadid=1: thread exiting with uncaught exception (group=0xb2d30b20)

My file forest.xml is an svg-file which looks like:
<?xml version="1.0" encoding="utf-8"?>


And my main.axml looks like:
<?xml version="1.0" encoding="utf-8"?>



I would be very grateful for any help, because I already tried a lot to get this work.

Yours,
Michael

Answers

Sign In or Register to comment.