我在我的Main.axml
;當使用ImageView時,Monodroid不會部署
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
>
<Button
android:id="@+id/MyButton"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="@string/Hello"/>
<ImageView
android:src="@drawable/samplebackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/MyButton"/>
</RelativeLayout>
它建立良好,sampleBackground是一個jpg已包含在我的項目中。
但是當我嘗試部署時出現錯誤;
Object reference not set to an instance of an object
而且有行指出<filename unknown>
如果我從應用程序部署精細的標記去掉ImageView的一堆。
有什麼想法?
完整的堆棧
------構建開始:項目:MonoAndroidApplication1,配置:調試任何CPU ------ MonoAndroidApplication1 - > C:\開發\ MonoAndroidApplication1 \ MonoAndroidApplication1 \ BIN \ Debug \ MonoAndroidApplication1.dll Microsoft(R)Build Engine版本4.0.30319.1 [Microsoft .NET Framework,版本4.0.30319.225] 版權所有(C)Microsoft Corporation 2007.保留所有權利。
開始建造8/06/2011 8:37:40 AM。 節點1(SignAndroidPackage目標)上的項目「C:\ Development \ MonoAndroidApplication1 \ MonoAndroidApplication1 \ MonoAndroidApplication1.csproj」。 _GenerateAndroidAssetsDir: 跳過目標「_GenerateAndroidAssetsDir」,因爲它沒有輸出。 _ResolveMonoAndroidSdks: 正在尋找Android SDK .. 未找到鑰匙HKCU \ SOFTWARE \ Android SDK Tools \ Path。 Key \ HKLM \ SOFTWARE \ Android SDK Tools \ Path found: 路徑包含\ platform-tools(C:\ Program Files \ Android \ android-sdk)中的adb.exe。 尋找Java SDK .. Key HKLM \ SOFTWARE \ JavaSoft \ Java Development Kit \ CurrentVersion found:1.6。 Key HKLM \ SOFTWARE \ JavaSoft \ Java Development Kit \ 1.6 \ JavaHome found: Path在\ bin(C:\ Program Files \ Java \ jdk1.6.0_25)中包含jarsigner.exe。 MonoAndroid工具:C:\ Program Files \ MSBuild \ Novell \ MonoAndroid Framework:C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v2.2 \; C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ 1.0 \ Android SDK中:C:\ Program Files文件\的Android \ Android的SDK \ 的Java SDK:C:\ Program Files文件\的Java \ jdk1.6.0_25 \ _ValidateAndroidPackageProperties: GetAndroidPackageName任務 manifest資源配置文件: 程序集名稱:MonoAndroidApplication1 程序包名稱:MonoAndroidApplication1.MonoAndroidApplication1 _UpdateAndroidResgen: 跳過目標「_UpdateAndroidResgen」,因爲所有輸出文件相對於輸入文件都是最新的。 GenerateTargetFrameworkMonikerAttribute: 跳過目標「GenerateTargetFrameworkMonikerAttribute」,因爲所有輸出文件都是關於輸入文件的最新版本。 CoreCompile: 跳過目標「CoreCompile」,因爲所有輸出文件都是關於輸入文件的最新版本。 _CopyOutOfDateSourceItemsToOutputDirectoryAlways: 從「C:\ Development \ MonoAndroidApplication1 \ MonoAndroidApplication1 \ Resources \ Drawable-land \ Icon」複製文件。PNG 「到 」斌\調試\資源\可繪製土地\的icon.png「 CopyFilesToOutputDirectory: MonoAndroidApplication1 - > C:\開發\ MonoAndroidApplication1 \ MonoAndroidApplication1 \ BIN \調試\ MonoAndroidApplication1.dll ContractDeclarativeAssemblyCS: 跳過目標」 ContractDeclarativeAssemblyCS 「因爲所有的輸出文件都是最新的輸入文件 _ConvertDebuggingFiles: 跳過目標」_ConvertDebuggingFiles「,因爲所有輸出文件相對於輸入文件是最新的 _CompileAndroidPackage: Mandroid Task 程序集:C:\ Development \ MonoAndroidApplication1 \ MonoAndroidApplication1 \ bin \ Debug \ MonoAndroidApplication1.dll; C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ M onoAndroid \ V2.2 \ Mono.Android.dll; C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0 \ mscorlib.dll; C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0 \ System.Core.dll; C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0 \ System.dll; C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0 \ System.Xml.dll; C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0 \ System.Xml.Linq.dll I18nAssemblies: BuildDirectory:C:\ Development \ MonoAndroidApplication1 \ MonoAndroidApplication1 \ obj \ Debug \ ReferenceAssembliesDirectory:C: \ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v2.2 \; C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0 \ ;;; AndroidSdkDirectory:C:\ Program Files文件\的Android \ Android的SDK \ JavaSdkDirectory:C:\ Program Files文件\的Java \ jdk1.6.0_25 \ AssetDirectory:C:\開發\ MonoAndroidApplication1 \ MonoAndroidApplication1 \ OBJ \調試\資產\ AndroidSdkPlatform:8 MonoAndroidToolsDirectory:C:\ Program Files文件\的MSBuild \ Novell公司\ ResourceDirectory:C:\開發\ MonoAndroidApplication1 \ MonoAndroidApplication1 \ OBJ \調試\ \ RES ManifestTemplate: 包裝:MonoAndroidApplication1.MonoAndroidApplication1 NativeLibrary: 的JavaSource: 調試:True UseSharedRuntime:True SupportedAbis:armeabi LinkMode:無 ExtraArgs:
C:\ Program Files \ MSBuild \ Novell \ mandroid.exe -v --nosign --sdk-dir =「C:\ Program Files \ Android \ android-sdk」--builddir = 「C:\ Development \ MonoAndroidApplication1 \ MonoAndroidApplication1 \ obj \ Debug \ android」--framework-dir =「C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v2.2」--framework-dir =「C :\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0「-S =」C:\ Development \ MonoAndroidApplication1 \ MonoAndroidApplication1 \ obj \ Debug \ res「--package =」MonoAndroidApplication1.MonoAndroidApplication1「--nolink - -abi =「armeabi」--java-sdk-dir =「C:\ Program Files \ Java \ jdk1.6.0_25」--debug --sdk-platform =「8」-A =「C:\ Development \ MonoAndroidApplication1 \ MonoAndroidApplication1 \ obj \ Debug \ assets「」C:\ Development \ MonoAndroidApplication1 \ MonoAndroidApplication1 \ bin \ Debug \ MonoAndroidApplication1.dll「」C:\ Program Files \ Reference Assemblies \ Microsoft \ Fr amework \ MonoAndroid \ v2.2 \ Mono.Android.dll「」C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0 \ mscorlib.dll「」C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0 \ System.Core.dll「」C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0 \ System.dll「」C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0 \ System.Xml.dll「」C:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ MonoAndroid \ v1.0 \ System.Xml.Linq.dll「 monodroid:error 1:System。 NullReferenceException:未將對象引用設置爲對象的實例[Monoroid.Utils.ProcessRocks + C__Iterator5.MoveNext()[0x00000]中的 [MonoAndroidApplication1 \ MonoAndroidApplication1 \ .InvokeCommand(IEnumerable 1 commandLine) [0x00000] in <filename unknown>:0 at Monodroid.Toolbox.InvokeAapt (System.String packageName) [0x00000] in <filename unknown>:0 at Monodroid.Droidinator.CreatePackagedResources (System.Collections.Generic.List
1 javaTypes)[0x00000] in:0Monodroid.MainClass中的Monodroid.Droidinator.CreateApk()[0x00000]中的:0,的。Main(System.String [] argv)[0x00000] in:0 完成構建項目「C:\ Development \ MonoAndroidApplication1 \ MonoAndroidApplication1 \ MonoAndroidApplication1.csproj」(SignAndroidPackage target(s)) - FAILED。
構建失敗。
「C:\發展\ MonoAndroidApplication1 \ MonoAndroidApplication1 \ MonoAndroidApplication1.csproj」(SignAndroidPackage目標)(1) - > (_CompileAndroidPackage目標) - > MonoDroid的:錯誤1:System.NullReferenceException:對象未設置爲一個對象的實例[C:\ Development \ MonoAndroidApplication1 \ MonoAndroidApplication1 \ MonoAndroidApplication1.csproj]
你能從logcat的 – 2011-06-07 06:36:12