Getting ProtoBuf.ProtoException using OsmSharp in Xamarin Android -


I'm trying to test a sample project called Android. Routing Offline in Github.

After the two tap on the screen (for the first time just become Geo Coordinate) I get a protoof. Protoco router c. s. In

  Private Static Ibsic Router Data Soros & Lt; Tsaggedda & gt; _graph; Public static zero start () {var routing serializer = new CHEdgeDataSourceSerializer (); _graph = routingSerializer.Deserialize (Assembly.GetExecutingAssembly (). GetManifestResourceStream (@ "Android. Routing Offline.Campaign-Big Contracts. Mobile Rowing")); } Public static root count (GeoCoordinate, from GeoCoordinate) {try {lock (_graph) {var router = router.createfom (_graph, new CHRouter), new osmuruting interruptor ()); // The exception is below the var Modified = Router. Resol (vehicle. Car); To solve var = router Resolve (vehicle, car); If (from resuscit! = Empty & amp; resonated! = Null) {return router.quality (vehicle, car, resold, resoluge); }}} Hold (exception before) {OsmSharp.Logging.Log.TraceEvent ("router", Osmansherp.loggingtranceEventType.critical, "unused exception occurred: {0}", ex.ToString ()); } Return tap; }  

and the exception:

  & gt; {ProtoBuf.ProtoException: Invalid Wire-Type; It usually lets you & gt; Overwrite the file without reducing the length or setting; View & gt; Http://stackoverflow.com/q/2152978/23354 & gt; ProtoBuf.ProtoReader.ReadSingle () ...  

I did not delete the file (kempen-big.contracted.mobile.routing) as a linked file in the project Added. Any ideas how can I solve this issue?

OK, the first thing to try is the content of the stream You are reading (like GetManifestResourceStream ), in fact there are content that you are expecting, and some cover or otherwise-corrupt Messenger. If you have some checksum algorithms then you can run: great! Just checking . Longer will be a great start, otherwise you can cheat by receiving hex (for the purposes of validity of the content):

 using  (var ms = new memorystream () ) {Stream.CopyTo (ms); String hex = bitcounter Toaster (msat buffer), 0, (int) ms lamp); // Dump this string and compare it to run the same output on the // oringal file; They should be identical)  

Note that this duplicates content in memory, purely we can get a byte from one ( Oversized) - This is not intended for "real" code, but unless you make sure the content is correct, all other bets are closed I strongly suspect that you believe the content is original The file is similar to the content no Only . Note that I also believe that the original file works fine if the original file does not work in case of deserialization: again, all the bets are closed.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -