I am trying to use Akavache with Xamarin.
I've installed Akavache package from NuGet to Android and Windows Phone projects.
Initialization:
BlobCache.ApplicationName = "MyApp4";
BlobCache.EnsureInitialized();
BlobCache.LocalMachine.InsertObject("key", "Value");
Third line throws an error (on both Android and Windows Phone targets):
Akavache.Sqlite3.Internal.SQLiteException: no such table: SchemaInfo
What am I doing wrong?
Thanks in advance :)
The exception is a first change exception, but is handled. So just F5 and continue. Paul Betts explains the reasoning here https://github.com/akavache/Akavache/issues/195#issuecomment-66576874
"Yep, so to explain what this is doing, it's looking for a table that we internally use to do migrations (so that we can change the on-disk format of Akavache without breaking existing data); in new databases, this table is never found, so we have a first-chance exception."
I encountered this with Xamarin.iOS. It got "fixed" but may not be the same cause. And while I don't have a complete explanation of "why", for me the problem appeared to be something awry in the simulator files. By ditching all saved simulator state files the problem went away. The weird thing is that a simulator "Reset Content and Settings..." was not good enough, nor was just switching to a new simulator. (Nor restarts of simulator/XamStudio, nor full cleans/rebuilds etc.) It started working when I cleared all the files for all simulators found in the simulator hidden folders... Or maybe it was the chicken I sacrificed at the same time. Coulda been the chicken.
The location for the iOS simulator files on the Mac changed in iOS8. The following post has both the pre-ios8 and ios8 locations identified: Document Directory Path of iOS 8 Beta Simulator. (Unfortunately ios8 makes it quite a bit trickier to find.)
Possibly the same kind of weirdness can happen in the Android emulators...
I experienced the same issue using Xamarin. My fix was to turn off the System.Exception breakpoint.
Related
I'm working on creating a CordApp which I'm expecting to run on user's phone. Android as a starting point. From my reading so far, Android phones do not have a JVM running on the phone and the compiled code is converted into either Dalvik or something similar.
Has someone tried to install their CorDapp on an android based mobile device?
I'm a nooby in the area of CordApp as well in android apps but hoping that I can find some good starting tips here. Thanks for help.
The bottom line is that Corda needs a JVM environment to execute. The most light-weight test we have tried is Raspberry Pi with 2G Memory.
(answering the follow-up in the comment above)
You might be able to run several distinct nodes on some server. However at that point there would be little point in using Corda in the first place.
Once you run a node "somewhere else" the user won't own the private key for its node, and all the safety of using Corda disappears. You're reverting to a 'trusted third party' model.
Here is the error I'm getting when trying to archive my app for deployment.
This error doesn't show up at any other time. The project builds and runs on emulators and devices without issue. This error has zero context or direction as to where to look to fix it. It also just randomly showed up out of nowhere, last time I built/archived (with zero functional changes) this error did not happen.
Main difference between this archival and the previous one is a newer version of VS 2017. Don't remember exactly the version from before, but am currently on 15.9.4 (stable).
Looking around on the interwebs, I've found that this error seems to have something to do with ObservableCollection's, which there are probably 10-ish in my app. Not really sure what to do here, because this has never been an issue previously, and I'm coming up on a deadline and with the structure of the app, am not in a good position to start making functional changes.
EDIT
I have also cleaned and rebuilt my solution, as well as deleting all bin/obj folders in my xamarin projects. Even tried deleting the .vs folder which can sometimes help. But still no go.
Going to try updating VS to 15.9.5 and see if maybe it was fixed in a release.
EDIT 2
Updating VS 2017 to 15.9.5 made no difference.
EDIT 3
I had my coworker try archiving the exact same project on his machine (running VS 2017: 5.9.3, and it archived fine for him. So far that's the only difference we've been able to find between our environments.
I saw the same problem using VS2017 15.9.9. Even the same code that could be archived a week ago threw the above mentioned error. It seems related to local data in the solution. A "clear" build was not sufficient. However manual deletion of the local obj and bin folders followed by archiving (build is done implicitly) solved the problem for me.
For my part closing Visual studio and deleting the .vs hidden folder did it.
It's actually a fix for many issues using Xamarin.
I had this other issue where I couldn't archive because the build process would just hang and never end. Deleting the .vs folder did it too.
https://github.com/xamarin/xamarin-android/issues/1760
Just go to project property then go to Android options-> Select Advanced then increase the Java Max heap size to 2G/3G -> it's working for me.
Leon Lu's suggestion worked. I don't particularly like it, as it took forever and repairing basically restores you to a base install (no extensions or personalizations). Took about 1.2 hours to complete, but once done I was able to again archive my android application. I guess something went wrong in vs at some point, perhaps during an update. There's no way to tell.
I tried ALL of the ideas above, but had no consistent reliable luck with any of them.
I found that Microsoft has had the problem reported to them (see link below). After a ton of time burn on this, I posted at the link below one way that I've been able to get around this archive-build issue.
Like the other fixes, it's not exactly logical, and nothing that you would think would work, but I've found the process to be repeatable, which is golden for me with tight timelines and having no time for this.
MS Visual Studio Developer Community Problem 507708
Posted on a Saturday morning, a sign of really needing to get around this urgently. I hope it helps you too.
Hey guys and girls for a the past week I've grown a lot of interest in android studio (even without knowing quite much about it) I decided to create an app that I deemed quite useful. However the app required maps to be integrated in it and I really did not know what I was doing and at one point I started messing with the settings and then all hell broke loose and I kept getting AAPT2 errors and I even tried to fix this issue with the gradle properties line that you add (I forgot the line of code to add). Anyways it still didnt work. However I rembered that I always kept the good version (before I broke everything) of the app on my phone. So when I go in my phone the app is there and it works just fine. Ive tried so many things to get the source code from the app on my phone without any succes. My question is, how can I get the source code back from the working app onto my laptop to continue coding in android studio? If it helps I am using Linux 18.04 LTS and running the newest version of android studio. Thank you for any help from you guys. This means a lot to me.
You can’t get back the ‘source code’ from an already compiled app.
You should consider using some version control platforms like git from the next time
Background
I wanted to simplify the usage of DB in an Android app.
For this, I've compared some third party libraries that create a DAO layer.
I've come up with a nice library called "GreenDao" (presentation about it here) . The website shows that it's faster than other competitors (like ORMLite) and is optimized for Android.
The problem
For some reason, on some device (usually old devices, with GB) , I get the next console error when trying to install the app:
Installation error: INSTALL_FAILED_DEXOPT
Please check logcat output for more details.
Launch canceled!
I've searched for the reason of this error, but couldn't find out how to solve it. Many complain about this error, but I can't find out why it occurs, and what can be done.
The error is quite common and known, but it's never mentioned as the result of using this library, yet when I remove the usage of this library, everything works fine...
Also note that on newer devices (like nexus 4) it installs and works just fine, and that the sample itself also works fine no matter which device I test it on.
The question
Why does it occur?
Is it possible that the structure of the classes is just too much for old devices to load, since we use other libraries ?
Could it be that I've reached the limit of code that is supported by android apps?
The jar file itself takes just 87KB ...
How can I solve this?
Ok, I've found the problem and the solution:
It has nothing to do with GreenDao.
It's because the app uses too many jars, so maybe Android has a limitation of code.
The solution is to either delete un-needed jar files or delete a lot of code.
I have used this site to help me with the apkTool in the past, however I have today come up against an error I can't quite get my head around.
I am DE-compiling an APK which was written by a predecessor as it requires a few tweaks and he hasn't left any source files behind..
So, As far as I'm aware I have the latest tool available, using windows 7 64bit.
I have added the framework from my test tablet which the app runs fine on. And this is what I get..
This is the error screen
http://img199.imageshack.us/img199/4291/63yc.png
Anyone have an idea at what the issue is here? Any help really appreciated.
There's an open issue on a similar exception (scroll to the bottom):
https://code.google.com/p/android-apktool/issues/detail?id=477