UXDivers / Gorilla-Player-Support

This is the public Gorilla Player support website
http://gorillaplayer.com
115 stars 17 forks source link

Custom Renderers Not working #283

Open basharat58 opened 6 years ago

basharat58 commented 6 years ago

I am using Gorilla player to view a page with some some Custom Renderers. It gives an error: Gorilla SDK needed The previewed page requires assemblies not available in this player. Please use the Gorilla SDK to include those and get an optimal preview.

I have followed the process outlined here: https://github.com/UXDivers/Gorilla-Player-Support/wiki/Gorilla-SDK. My Android solutions have reference to UXDivers.Gorilla.SDK and UXDivers.Gorilla.SDK.Droid which I installed using Nuget.

Below is a picture of my Shared and Android solution, showing the Custom Renderers that I am looking to integrate: solution

The RoundedRenderer.cs file in the Android solution references and exports the Renderer in the shared solution: android-custom

I then register the assemblies (classes) in the MainActivity.cs file in Android: load-application

However when I run the file using Gorilla player (everything is set up fine as I can view other pages in Gorilla Player including a page that has a Listview with data loaded from the DesignTimeData.json file) I get the following: player

And yet the Gorilla SDK is installed. Please could you assist?

FrancoisM commented 6 years ago

Your two screenshots are inconsistent. Did you rename you renderers? On screenshot 1 it's called RoundedRendererand on screenshot 2 you register from type Rounded.

basharat58 commented 6 years ago

Hi FrancoisM,

Those are the names above. In the standard project, the files are called: Rounded and NavigationBar. In the platform specific/native projects the files are called: RoundedRenderer and NavigationBarRenderer.

I thought that in the MainActivity.cs file I had to to register Rounded and NavigationBar for the RegisterAssemblyFromType - I was not sure what exactly I had to register (just started to use Gorilla player). I changed it to the following, but it is still not working:

LoadApplication(UXDivers.Gorilla.Droid.Player.CreateApplication(this, new UXDivers.Gorilla.Config("Good Gorilla") .RegisterAssemblyFromType()
.RegisterAssemblyFromType() ));

FrancoisM commented 6 years ago

check my repo as a starting point with Gorilla and custom renderers.

Note that you don't register types but assemblies. So as I guess your custom renderers are in the same assembly, then you registered it twice. Moreover, if your custom renderers are in the android app itself (i.e you didn't use a separate android library for your renderers) then I don't think you need to register any assemblies.

basharat58 commented 6 years ago

I looked at your repo, but could not make any progress going off that and then comparing that to my solution. Really don't know what the issue can be.

LeoHere commented 6 years ago

@FrancoisM Gorilla should not have any issue finding those converters. Are the assemblies where those converters resides registered with the SDK? How are those converters declared in the App.xaml?

basharat58 commented 6 years ago

Hi FrancoisM,

Sorry, I don't know the answer to your question. I am still stuck with my initial problem above. The Gorilla player on my android emulator stopped working and I uninstalled it.

When I go to the Play Store it says that it is installed so does not let me install again.

basharat58 commented 6 years ago

FrancoisM/LeoHere

Can you help?. I am just stumped, and get the following warning:

{"level":"warn","message":"Unable to resolve type 'null.Rounded' with arguments '' and assembly ''.","timestamp":"2018-05-01T17:29:54.354Z"} {"processingIssue":true,"issueType":"warning","position":{"file":"E:\Development\Xamarin\Grial\EcomApp1\EcomApp1\EcomApp1\Views\MainView.xaml","hasPosition":true,"line":81,"column":44,"position":3293},"area":"Xaml","scope":"Req","contextInstanceId":33,"targetId":28,"sampleDataId":1,"level":"info","message":"Xaml processing warning Summary:\"Tag custombutton:Rounded was removed\"; Message:\"Tag custombutton:Rounded removed because is defined in a assembly outside Players known assemblies. Extend the player through the SDK to solve this.\"","timestamp":"2018-05-01T17:29:54.354Z"}****

FrancoisM commented 6 years ago

hmm, I replied to en email chain and my reply got posted here. The issues are unrelated though. I'll delete my posts.

FrancoisM commented 6 years ago

@Robson02, did you try to just load the master branch of my repo and run it "as is"?

basharat58 commented 6 years ago

No I did not try that. I will download and give it a go.

basharat58 commented 6 years ago

Hi FrancoisM

I downloaded your repo and tried to run that in Gorilla. On the MainPage.xaml file where we have:

it is giving me the same issue as I am having in my own project: Unable to resolve type 'Controls.RoundedBoxView' with arguments '' and assembly ''.

But your project has no Android solution and I am trying to view this is an Android emulator (working in Windows).

FrancoisM commented 6 years ago

How could you "run that in Gorilla" in the first place as my repo only has an iOS project and you're on windows? I start to sense that the problem comes down to the way you use gorilla. Don't use Gorilla Player. Just run the app (mine, yours, whatever) which has the SDK Player embedded into it.