Microsoft.Maui.IPropertyMapper - The type '' cannot be used as a type parameter... There is no implicit conversion - maui

I'm trying to get maps to work on .net MAUI and found this blog post (linked to from the official MAUI blog). https://www.cayas.de/blog/dotnet-maui-custom-map-handler
I've downloaded the repo linked at the end of the blog but I can't get it to run.
In the blog post the MapHandler code looks like this:
public static IPropertyMapper<IMap, MapHandler> MapMapper = new PropertyMapper<IMap, MapHandler>(ViewMapper)
{ };
But in the repo it looks like this:
public static IPropertyMapper<MapView, MapHandler> MapMapper = new PropertyMapper<MapView, MapHandler>(ViewMapper)
{ };
Neither of which work for me, as I get the error (at runtime) below.
The type 'MapControlDemo.Handlers.MapHandler' cannot be used as type parameter 'TViewHandler' in the generic type or method 'PropertyMapper<TVirtualView, TViewHandler>'. There is no implicit reference conversion from 'MapControlDemo.Handlers.MapHandler' to 'Microsoft.Maui.IElementHandler'
Confusingly there are another couple of errors that shouldn't be errors??
Any ideas? I contacted the author and he suggested it could be my maui version as it works for him, but I'm on the latest.

Perhaps the author was building on a Mac.
I've confirmed that an attempt to build on Windows results in a build error. VS Version 17.3.0 Preview 1.1
The error I got was
Error CS0311 The type 'MapControlDemo.Handlers.MapHandler' cannot be used
as type parameter 'TViewHandler'
in the generic type or method 'IPropertyMapper<TVirtualView, TViewHandler>'.
There is no implicit reference conversion from
'MapControlDemo.Handlers.MapHandler' to
'Microsoft.Maui.IElementHandler'.
MapControlDemo (net6.0-android) C:\...\maui-maps\Handlers\MapHandler.cs 6
HOWEVER, I was able to RUN on Android - by selected an Android emulator as target (so using net6.0-android) and pressing F5 - therefore that error is misleading.
Given that this is only implemented on iOS and Android, I recommend editing .csproj to REMOVE Windows platform. I also removed MacCatalyst (maybe that would work but I was going for simplest test):
Change:
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
To:
<TargetFrameworks>net6.0-android;net6.0-ios</TargetFrameworks>
Then I was able to build.
NOTE: Without adding a Google Maps ID, when ran on Android, the result was an empty map.
tl;dr Easiest way to test is on a Mac, targetting iOS.

Related

How do I fix Unity textmeshpro error after updating 2018.1 to 2018.3?

After updating from unity 2018.1 to Unity 2018.3, there is a bunch of error messages about text mesh pro. Here are the error messages
/Users/administrator/Dropbox/Sebastian/home/coding/Unity/Experimental Project/Library/PackageCache/com.unity.textmeshpro#1.3.0/Scripts/Runtime/TMP_Text.cs(4929,40): error CS0121: The call is ambiguous between the following methods or properties: TMPro.TMPro_ExtensionMethods.Multiply(this UnityEngine.Color32, UnityEngine.Color32)' andTMPro.TMPro_ExtensionMethods.Multiply(this UnityEngine.Color32, UnityEngine.Color32)'
/Users/administrator/Dropbox/Sebastian/home/coding/Unity/Experimental Project/Library/PackageCache/com.unity.textmeshpro#1.3.0/Scripts/Runtime/TMPro_Private.cs(3552,92): error CS0121: The call is ambiguous between the following methods or properties: TMPro.TMPro_ExtensionMethods.Compare(this UnityEngine.Color32, UnityEngine.Color32)' andTMPro.TMPro_ExtensionMethods.Compare(this UnityEngine.Color32, UnityEngine.Color32)'
Multiple plugins with the same name 'tmpro_plugin' (found at 'Packages/com.unity.textmeshpro/Plugins/64 Bit Plugins/TMPro_Plugin.bundle' and 'Assets/Downloaded Assets/TextMesh Pro/Plugins/64 Bit Plugins/TMPro_Plugin.bundle'). That means one or more plugins are set to be compatible with Editor. Only one plugin at the time can be used by Editor.
you have 2 folders of TMP in your project, one was probably added from the packages after the upgrade.
find them and remove the new one for a quick fix...
or do this: http://blog.collectivemass.com/2018/09/upgrading-textmesh-pro/

Const declarations are not supported in strict mode on certain browsers

When I run my app in the iOS iPhone 6 simulator (or my physical iPad2) I get this error:
SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.
=> reactBoilerplateDeps.dll.js:4088
Which leads to the is-in-browser module included by jss:
export const isBrowser = typeof window === "object"
&& typeof document === 'object'
&& document.nodeType === 9;
export default isBrowser;
I'm using these packages:
material-ui#v1.0.0-beta.1
react-boilerplate#v3.4.0
How do I correct this? Maybe the transform-es2015-block-scoping plugin as per this question ?
The app works fine on my physical iPhone 6 and desktop browser(s) but not on my iPad2.
According to Can I Use this is fixed in [iOS] Safari 10, so you might be able to get away with telling people who run into this issue that their browser isn't supported, and they should update it, but that's really not a good solution.
Also, note that when twig.js hit this issue, their fix was to declare with the var keyword instead of const, so perhaps you should submit a bug report to is-in-browser about this.
It would also be a good idea to try to see if using the var keyword instead of const works for you, by editing the file where you found export const isBrowser ... to replace const with var. This information will help if you decide to submit a bug report, and if it does work, you could create a fork of their repository with your fix, and submit a pull-request.
Looks like is-in-browser was not built with correct babel settings. You can try going to node_modules/is-in-browser and run npm run build to rebuild it.

IntelliJ IDEA 15 Play 2.4 reverse routing method parameter "string cannot be applied to java.lang.String"

I use IntelliJ IDEA 15.0.4 to develop a Java Play! 2.4.4 application. Since a few months (I think it was because of an IntelliJ update, but not 100% sure) the following problem occurs:
Whenever I call a reverse route from a controller that takes a String as a parameter, the parameter is displayed as an error with the following message:
methodName (string) in ReverseMyController cannot be applied to (java.lang.String)
Here's a code example:
public Result myAction(String myId) {
// Do something...
// Redirect back to referrer
flash("success", "Action was a success");
if(!myId.isEmpty()) return redirect(controllers.routes.MyController.showItem(myId));
return redirect(controllers.routes.MyController.itemList(1));
}
In this example, the parameter myId passed to the method showItem would be error highlighted, like this.
I already tried fiddling with the Project Structure settings and searched Google, but to no avail. I hope somebody is able to help me with this, my OCD-self would really appreciate having a code base with no error hints again ;)
Accepted answer does not solve the problem that is why I am answering this old question.
I had the same problem with Play 2.5.4 and InteliJ 2016.1.3
I removed the type (String) from route declaration in routes file and InteliJ stopped highlighting it as error.
Change following:
GET /path/:string_arg controllers.MyController.myMethod(string_arg: String)
To
GET /path/:string_arg controllers.MyController.myMethod(string_arg)
and it works fine.
Yes, I meet the same issue as what you said. I think it is a bug of the IDEA 15.0.4, Have you tried to change to the older version before 15.0.4?

wsdl2 does not show extended functions in ColdFusion 10

I have a simple test setup:
component displayname="test1" extends="test2"
{
remote Any function ping1() {}
}
component displayname="test2"
{
remote Any function ping2() {}
}
When I cal the cfc using test1.cfc?wsdl something strange happens.
When I tell my application to use WSDL version 1 using this.wssettings.version everything looks fine, pretty much the same as in CF9. But when I tell it to use version 2 the function "ping2" does not show up in my definition xml.
Why doesn't WSDL 2 show my extended function "test2" when I call test1.cfc?wsdl ??
I tried this on ColdFusion 10 and both WSDL and WSDL2 do not show the inherited methods. I only see the ping1() function of the test1.cfc, I do not see ping2() inherited from test2.cfc. If you change the "Select web service version" value in the ColdFusion Administrator from 2 (the default) to 1, then ColdFusion 10 performs as ColdFusion 9 does and shows both methods.
On ColdFusion 9, the WSDL shows both methods.
In my opinion, this is a bug in ColdFusion 10, you should log it with Adobe (https://bugbase.adobe.com/), and post the bug number here so others can vote for it. This could break existing functionality if people upgrade without changing the default web services version.
I tried this exact code on CF 9.01 and did not get the same result. My WSDL shows both methods. Something is unique about your CF install - perhaps the wrong version of Axis or something? I'm sorry I can't be more helpful - but I'm struggling to figure out a way to duplicate your issue.

Zend Framework Can't determine mime type of image upload

Hi all I'm trying to upload a image when creating a item in my app, however the action fails returning the following error: The mimetype of file 'mytestimage.jpg' could not be detected.
I've tried adding a Mime Type validator but the error persists, can anyone tell me where I'm going wrong in the code below.
// Image uploads
$images = new Zend_Form_Element_File('images');
$images->setMultiFile(2)
->addValidator('IsImage')
->addValidator('Size',false,'5242880')
->addValidator('Extension',false,'jpg,png,gif')
->addValidator('ImageSize',false,array(
'minwidth' => 250,
'minheight'=>250,
'maxwidth'=>500,
'maxheight'=>500
))
->setValueDisabled(true);
Many thanks in advance.
Graham
I had the same problem.
Zend_Frameworks tries to determine the mimetype in two ways:
First it tries to use the PECL FILEINFO-Extension (which is not installed on every server)
if the extension is not istalled it tries to use mime_content_type (a php function). This function however is deprecated as of php version 5.3
So in this case I guess your hoster is using php version 5.3 and has not installed the PECL FILEINFO-Extension. Same goes unfortunately for my hoster :(
Here are more details of the two ways in the php-manual:
http://de.php.net/manual/en/function.mime-content-type.php
http://de.php.net/manual/en/ref.fileinfo.php
By the way. You can see the code ZF uses in the file "Zend\File\Transfer\Adapter\Http.php" (lines 1281-1318: methodname is _detectMimeType