当我尝试在 Xamrin Android 应用程序中执行以下代码行时遇到错误:
EntityEditor ee = new EntityEditor();
EntityEditor 类是一个 DialogFragment,其代码如下所示:
namespace Storyvoque
{
public class EntityEditor : DialogFragment
{
EditText entityId;
EditText entityType;
EditText entityName;
EditText entityDescription;
EditText containerEntityId;
AutoCompleteTextView containerEntityName;
EditText targetEntityId;
AutoCompleteTextView targetEntityName;
EditText destinationEntityId;
AutoCompleteTextView destinationEntityName;
EditText entityOwner;
EditText entityDate;
CheckBox syncPending;
public StoryEntity editData;
public override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Create your fragment here
}
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
return inflater.Inflate(Resource.Layout.EntityEditor, container, false);
}
public override void OnViewCreated(View view, Bundle savedInstanceState)
{
entityId = (EditText)View.FindViewById(Resource.Id.entityId);
entityType = (EditText)View.FindViewById(Resource.Id.entityType);
entityName = (EditText)View.FindViewById(Resource.Id.entityName);
entityDescription = (EditText)View.FindViewById(Resource.Id.entityDescription);
containerEntityId = (EditText)View.FindViewById(Resource.Id.containerEntityId);
containerEntityName = (AutoCompleteTextView)View.FindViewById(Resource.Id.containerEntityName);
targetEntityId = (EditText)View.FindViewById(Resource.Id.targetEntityId);
targetEntityName = (AutoCompleteTextView)View.FindViewById(Resource.Id.targetEntityName);
destinationEntityId = (EditText)View.FindViewById(Resource.Id.destinationEntityId);
destinationEntityName = (AutoCompleteTextView)View.FindViewById(Resource.Id.destinationEntityName);
entityOwner = (EditText)View.FindViewById(Resource.Id.entityOwner);
entityDate = (EditText)View.FindViewById(Resource.Id.entityDate);
syncPending = (CheckBox)View.FindViewById(Resource.Id.syncPending);
base.OnViewCreated(view, savedInstanceState);
}
public void LoadData(StoryData source, UserData users, StoryEntity data)
{
entityId.Text = data.EntityId.ToString();
entityType.Text = data.EntityType.ToString();
entityName.Text = data.Name;
entityDescription.Text = data.Text;
containerEntityId.Text = data.Container.ToString();
containerEntityName.Text = source.GetWrapper(data.Container)?.Name ?? string.Empty;
targetEntityId.Text = data.Target.ToString();
targetEntityName.Text = source.GetWrapper(data.Target)?.Name ?? string.Empty;
destinationEntityId.Text = data.Destination.ToString();
destinationEntityName.Text = source.GetWrapper(data.Destination)?.Name ?? string.Empty;
entityOwner.Text = users[data.UserNum]?.DisplayName ?? data.UserNum.ToString();
entityDate.Text = data.Date.ToLocalTime().ToString("G");
syncPending.Checked = data.SyncRequired;
}
public void StoreData(StoryEntity data)
{
data.EntityId = Int32.Parse(entityId.Text);
data.Name = entityName.Text;
data.Text = entityDescription.Text;
data.Container = Int32.Parse(containerEntityId.Text);
data.Target = Int32.Parse(targetEntityId.Text);
data.Destination = Int32.Parse(destinationEntityId.Text);
}
public override void OnDismiss(IDialogInterface dialog)
{
StoreData(editData);
base.OnDismiss(dialog);
}
}
}
我假设我们不需要查看 AXML 文件,因为它在错误发生之前从未到达 OnCreatedView 函数。错误的调用堆栈如下所示:
Java.Lang.ClassNotFoundException: Didn't find class "md59096a9123c571e4f030e303e8372967e.EntityEditor" on path: DexPathList[[zip file "/data/app/com.enigmadream.storyvoque-1/base.apk"],nativeLibraryDirectories=[/data/app/com.enigmadream.storyvoque-1/lib/x86, /data/app/com.enigmadream.storyvoque-1/base.apk!/lib/x86, /vendor/lib, /system/lib]]
at Java.Interop.JniEnvironment+Types.FindClass (System.String classname) [0x00114] in <54816278eed9488eb28d3597fecd78f8>:0
at Java.Interop.JniType..ctor (System.String classname) [0x00006] in <54816278eed9488eb28d3597fecd78f8>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods..ctor (System.Type declaringType) [0x00064] in <54816278eed9488eb28d3597fecd78f8>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.GetConstructorsForType (System.Type declaringType) [0x0002c] in <54816278eed9488eb28d3597fecd78f8>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.StartCreateInstance (System.String constructorSignature, System.Type declaringType, Java.Interop.JniArgumentValue* parameters) [0x00032] in <54816278eed9488eb28d3597fecd78f8>:0
at Android.App.DialogFragment..ctor () [0x00034] in <28e323a707a2414f8b493f6d4bb27c8d>:0
at Storyvoque.EntityEditor..ctor () <0x97e236a0 + 0x0002b> in <c813259d00bd4c8dafdb14124c1c8a19>:0
at Storyvoque.CommandProcessor.ProcessCommand (Storyvoque.Parser.Command command, Storyvoque.UserData users, Storyvoque.StoryData storyData, System.Boolean activePlayer) [0x00091] in C:\Users\bluem\Documents\Visual Studio 2017\Projects\Storyvoque\Storyvoque\CommandProcessor.cs:29
at Storyvoque.MainActivity.SendCommand (Android.Views.View view) [0x000fb] in C:\Users\bluem\Documents\Visual Studio 2017\Projects\Storyvoque\Storyvoque\MainActivity.cs:146
--- End of managed Java.Lang.ClassNotFoundException stack trace ---
java.lang.ClassNotFoundException: Didn't find class "md59096a9123c571e4f030e303e8372967e.EntityEditor" on path: DexPathList[[zip file "/data/app/com.enigmadream.storyvoque-1/base.apk"],nativeLibraryDirectories=[/data/app/com.enigmadream.storyvoque-1/lib/x86, /data/app/com.enigmadream.storyvoque-1/base.apk!/lib/x86, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at md59096a9123c571e4f030e303e8372967e.MainActivity.n_SendCommand(Native Method)
at md59096a9123c571e4f030e303e8372967e.MainActivity.SendCommand(MainActivity.java:42)
at java.lang.reflect.Method.invoke(Native Method)
at android.view.View$DeclaredOnClickListener.onClick(View.java:4447)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Suppressed: java.lang.ClassNotFoundException: md59096a9123c571e4f030e303e8372967e.EntityEditor
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 14 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
如何缩小或解决这个问题?
最佳答案
感谢对问题的评论,我 found这是一个可以通过每次清理和重建来解决的错误。
关于c# - Xamarin Android 应用遇到未找到类 ... 在路径 : DexPathList[[zip file . ..]...],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47953561/
对于具有离线功能的智能手机应用程序,我正在为Xml文件创建单向文本同步。我希望我的服务器将增量/差异(例如GNU差异补丁)发送到目标设备。这是计划:Time=0Server:hasversion_1ofXmlfile(~800kiB)Client:hasversion_1ofXmlfile(~800kiB)Time=1Server:hasversion_1andversion_2ofXmlfile(each~800kiB)computesdeltaoftheseversions(=patch)(~10kiB)sendspatchtoClient(~10kiBtransferred)Cl
我构建了两个需要相互通信和发送文件的Rails应用程序。例如,一个Rails应用程序会发送请求以查看其他应用程序数据库中的表。然后另一个应用程序将呈现该表的json并将其发回。我还希望一个应用程序将存储在其公共(public)目录中的文本文件发送到另一个应用程序的公共(public)目录。我从来没有做过这样的事情,所以我什至不知道从哪里开始。任何帮助,将不胜感激。谢谢! 最佳答案 无论Rails是什么,几乎所有Web应用程序都有您的要求,大多数现代Web应用程序都需要相互通信。但是有一个小小的理解需要你坚持下去,网站不应直接访问彼此
我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r
刚入门rails,开始慢慢理解。有人可以解释或给我一些关于在application_controller中编码的好处或时间和原因的想法吗?有哪些用例。您如何为Rails应用程序使用应用程序Controller?我不想在那里放太多代码,因为据我了解,每个请求都会调用此Controller。这是真的? 最佳答案 ApplicationController实际上是您应用程序中的每个其他Controller都将从中继承的类(尽管这不是强制性的)。我同意不要用太多代码弄乱它并保持干净整洁的态度,尽管在某些情况下ApplicationContr
我的最终目标是安装当前版本的RubyonRails。我在OSXMountainLion上运行。到目前为止,这是我的过程:已安装的RVM$\curl-Lhttps://get.rvm.io|bash-sstable检查已知(我假设已批准)安装$rvmlistknown我看到当前的稳定版本可用[ruby-]2.0.0[-p247]输入命令安装$rvminstall2.0.0-p247注意:我也试过这些安装命令$rvminstallruby-2.0.0-p247$rvminstallruby=2.0.0-p247我很快就无处可去了。结果:$rvminstall2.0.0-p247Search
我是一个Rails初学者,但我想从我的RailsView(html.haml文件)中查看Ruby变量的内容。我试图在ruby中打印出变量(认为它会在终端中出现),但没有得到任何结果。有什么建议吗?我知道Rails调试器,但更喜欢使用inspect来打印我的变量。 最佳答案 您可以在View中使用puts方法将信息输出到服务器控制台。您应该能够在View中的任何位置使用Haml执行以下操作:-puts@my_variable.inspect 关于ruby-on-rails-如何在我的R
当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub
如何在ruby中调用C#dll? 最佳答案 我能想到几种可能性:为您的DLL编写(或找人编写)一个COM包装器,如果它还没有,则使用Ruby的WIN32OLE库来调用它;看看RubyCLR,其中一位作者是JohnLam,他继续在Microsoft从事IronRuby方面的工作。(估计不会再维护了,可能不支持.Net2.0以上的版本);正如其他地方已经提到的,看看使用IronRuby,如果这是您的技术选择。有一个主题是here.请注意,最后一篇文章实际上来自JohnLam(看起来像是2009年3月),他似乎很自在地断言RubyCL
我正在尝试在Ruby中复制Convert.ToBase64String()行为。这是我的C#代码:varsha1=newSHA1CryptoServiceProvider();varpasswordBytes=Encoding.UTF8.GetBytes("password");varpasswordHash=sha1.ComputeHash(passwordBytes);returnConvert.ToBase64String(passwordHash);//returns"W6ph5Mm5Pz8GgiULbPgzG37mj9g="当我在Ruby中尝试同样的事情时,我得到了相同sha
我正在学习http://ruby.railstutorial.org/chapters/static-pages上的RubyonRails教程并遇到以下错误StaticPagesHomepageshouldhavethecontent'SampleApp'Failure/Error:page.shouldhave_content('SampleApp')Capybara::ElementNotFound:Unabletofindxpath"/html"#(eval):2:in`text'#./spec/requests/static_pages_spec.rb:7:in`(root)'