issues with resource.designer after upgrade to mvvmcross 4.1 - android

I have an xamarin android project using mvvmcross. with version 4.0 it worked without issues. After the upgrade I'm no longer able to build and get a lot of these errors:
error CS0117: 'Resource.Styleable' does not contain a definition for 'Theme_toolbarStyle'
if it helps, here is the link to the repository: https://github.com/NPadrutt/MoneyFox.Windows/tree/xamarin
EDIT: I found that it this error seems to be linked to the mvvmcross support design package. When I deinstall it, it will build (but then I have an inflate exception..)
How can I fix that?

Related

How to find cause of error when dexing: MethodHandle.invoke and MethodHandle.invokeExact

I have a project that has started throwing this error when building in Android Studio or Gradle:
com.android.tools.r8.ApiLevelException: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)
Now I assume that it's related to use of Java 8 features, perhaps a lambda, but the error message gives no clue as to where the problem lies - it could be my code or it could be a library.
What's the best way to find out where the offending code is? It's a reasonably large app with several modules and quite a few libraries.
In my case i tried to mock something via mockk in an instrumentation test running Api Version 26 or higher, removing the dependency was my only solution as long as following issue is not resolved: https://github.com/mockk/mockk/issues/281
Update: It seems that the issue got resolved and using mockk version 1.10.0 will resolve this issue
One approach would be to set your min api to 26, to avoid the error and build the apk, and then inspect the bytecode of the app (dexdump, baksmali, etc.) to find any usages of the MethodHandle class.
Looking through the error log, it did give a bit more information, specifically nominating one jar file that it failed on:
/Users/.../androidApp/build/intermediates/transforms/desugar/debug/41.jar
On examining that jar file, the classes were all from a library recently added to the project, and the very first class listed was:
META-INF/versions/9/org/h2/util/Bits.class
This turns out to be a Java 9 customised class. Deleting it from the jar file (using zip -d) solved the problem.
Just change the mockk version to 1.10.0, this will resolve the
I have same case when used too high version of Mockito library.
The solution was downgrading from 3.8.0 to 3.4.6. and everything started to work properly.
Error occurred for:
org.mockito:mockito-android:3.8.0
but work for:
org.mockito:mockito-android:3.4.6
We need to update the java version to java 8.
For that please click on File -> Project structure -> app (under Module folder) -> Then select the source compatibility and target compatibility to java 8.
After that you might encounter another error with MethodHandle.invoke and MethodHandle.invokeExact, if you get this error then set the minSdkVersion to 26 or higher

Android Studio - Canary 8: Can't access the resources in feature modules and library modules

I can't access to the feature module resources and the resources from another library which is included as an API in InstantApp. The only place where it recognises to get resources is the base feature class. I have the following sample: when I run the application there are several Fragment classes in the feature module which have to be loaded along with the layouts also located in that module, but it always fails with
Caused by: android.content.res.Resources$NotFoundException:
Tried to exclude Multi-Dexing, other modules, also disabled the aapt2, after which it has started to complain about not found views.
What could be the reason of this?
A bug is reported here.
With reference to Google issue tracker, it has been fixed with Android SDK Built-Tools to 27.0.2
Please update your Android SDK Built-Tools to 27.0.2 And ensure you are on Android Studio 3.0.1 or newer.
If any issue persists, please report at Google issue tracker they will re-open to examine.

Android Studio cannot render FloatingActionButton

I'm just now learning how to develop in Android Studio and this error come up when I began my helloworld tutorial:
Rendering Problems The following classes could not be instantiated: - android.support.design.widget.FloatingActionButton
The exception details are:
android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1080029
I'm using version 23.2.0 of the Android Support Design library.
How can I get the FloatActionButton to render in the preview pane?
Look at the error stack trace generated by the previewer. It says it cannot find a drawable resource by id 0x1080029. Does a drawable exist by that ID? Are you supplying an invalid ID? On my system it appears resources start at 0x7f010000.
Also found this: Android Studio FloatingActionButton error. It says there could be a bug in version 23.2.0 of the support design lib and that downgrading to 23.1.0 fixes it.
Upgrade to Android Support Library version 23.2.1 resolves the issue. It's already available in Android Studio SDK manager.
There appears to be a bug in version 23.2.0 of the Android Support libraries; simply downgrading to 23.1.1 and rebuilding your project should make the problem disappear.
Note that the problem is not just in the Design library; also the AppCompat widgets cause problems for AppCompatButton and AppCompatImageButton also give similar errors reporting missing resources.

Change Android Studio doclet version

I need to generate the javadoc for a Library in Android Studio.
The problem is that, when I start to create the doc, I see the following logs:
Constructing Javadoc information...
Standard Doclet version 1.8.0_31
Building tree for all the packages and classes...
[...]
1 error
javadoc: error - com.sun.tools.doclets.internal.toolkit.util.DocletAbortException: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.FunctionalInterface not found
I don't know exactly what is the problem. I think it is the doclet version (it takes by default 1.8.0_31); I tried to modify it but I did not succeed... any help?
I am using Mac OSX and Android Studio 1.2.2

"Package does not exist" error using Android v4 Compatibility Library

I'm using MonoDroid 4.2 in Visual Studio 2010, and I'm trying to use ViewPager, Fragments, and other things from the Android v4 Compatibility Library.
I was able to add the project reference to Mono.Android.Support.v4.dll and at design time I get no errors and intellisense works fine.
But when I build, I get errors like this:
package android.support.v4.view.ViewPager does not exist
android.support.v4.view.ViewPager.OnPageChangeListener
If I double-click on the error, it opens the source java file that MonoDroid creates on the fly, and goes to the line with the problem:
public class ViewPagerTestActivity_MyPagerAdapter
extends android.support.v4.view.PagerAdapter
So it looks like Java can't find the library package, but I'm not sure why. Do I need to install that manually, and how do I tell MonoDroid where to find it?
After some research, I learned that I needed to actually install the support library. MonoDroid has .NET bindings for it, but the underlying java can't build without it, of course. Here are instructions for getting the support library and instructions for hooking it up to a MonoDroid project.

Categories

Resources