- picpic2006
- Posts: 71
- Joined:
Windows Store Build
Hello,
I tried to build a completely new project for windows store, it is just the button exemple from your sample.
This is what i do !
1 First i switch plateform to windows store,
2 then i go to check my player setting,
I use Net Core,
3 i hit build.
"I have a error in console that say enable to patch file
Failed to patch file
UnityEngine.Debug:LogError(Object)
NoesisBuildPostprocessor:OnPostprocessBuildWSA(String) (at Assets/Editor/NoesisGUI/NoesisBuildPostprocessor.cs:36)
NoesisBuildPostprocessor:OnPostprocessBuild(BuildTarget, String) (at Assets/Editor/NoesisGUI/NoesisBuildPostprocessor.cs:14)
After i go in visual studio
https://drive.google.com/file/d/0B7tPUW ... sp=sharing
i check that my dll are here, i have a weird icon for them.
After the compile in VS
I really don't see what to do ?
Ohhh i use unity 64 bit 5.1.2
Thanks you
I tried to build a completely new project for windows store, it is just the button exemple from your sample.
This is what i do !
1 First i switch plateform to windows store,
2 then i go to check my player setting,
I use Net Core,
3 i hit build.
"I have a error in console that say enable to patch file
Failed to patch file
UnityEngine.Debug:LogError(Object)
NoesisBuildPostprocessor:OnPostprocessBuildWSA(String) (at Assets/Editor/NoesisGUI/NoesisBuildPostprocessor.cs:36)
NoesisBuildPostprocessor:OnPostprocessBuild(BuildTarget, String) (at Assets/Editor/NoesisGUI/NoesisBuildPostprocessor.cs:14)
After i go in visual studio
https://drive.google.com/file/d/0B7tPUW ... sp=sharing
i check that my dll are here, i have a weird icon for them.
After the compile in VS
Code: Select all
Exception de première chance à 0x75B74598 dans Template.exe : exception Microsoft C++ : Platform::FailureException ^ à l'emplacement de mémoire 0x0879CE6C. HRESULT:0x80004005 Erreur non spécifiée
Informations WinRT : NoesisError: NoesisUnityRenderHook library was not initialized
Trace de la pile :
[Code externe]
Noesis.dll!15a13b16()
Noesis.dll!15a13a62()
[Code externe]
S'il existe un gestionnaire pour cette exception, le programme peut continuer en toute sécurité.
Ohhh i use unity 64 bit 5.1.2
Thanks you
-
sfernandez
Site Admin
- Posts: 3188
- Joined:
Re: Windows Store Build
Hi,
First, make sure SDK is set to "8.1" (or "Phone 8.1" or "Universal 8.1" when appropriate).
Next, could you please verify that MainPage.xaml.cs exist in your project (it should!).
Since 1.2.4 we automatically try to patch that file adding the following line inside the MainPage() constructor (before Unity 5.1 changes were made to App.xaml.cs, inside InitializeUnity() function):
Thanks for your feedback.
First, make sure SDK is set to "8.1" (or "Phone 8.1" or "Universal 8.1" when appropriate).
Next, could you please verify that MainPage.xaml.cs exist in your project (it should!).
Since 1.2.4 we automatically try to patch that file adding the following line inside the MainPage() constructor (before Unity 5.1 changes were made to App.xaml.cs, inside InitializeUnity() function):
Code: Select all
appCallbacks.SetSwapChainPanel(mainPage.GetSwapChainPanel());
appCallbacks.SetCoreWindowEvents(Window.Current.CoreWindow);
appCallbacks.InitializeD3DXAML();
+ appCallbacks.LoadGfxNativePlugin("NoesisUnityRenderHook.dll");
- picpic2006
- Posts: 71
- Joined:
Re: Windows Store Build
Yes bingo
i check this i needed to write this in your mainpage.xaml.cs and it work thanks
appCallbacks.LoadGfxNativePlugin("NoesisUnityRenderHook.dll");
By default it missing !
Update when i debug it in VS the sample load correctly but i have no input i can't clic any button !
Something is missing i think !
i check this i needed to write this in your mainpage.xaml.cs and it work thanks
appCallbacks.LoadGfxNativePlugin("NoesisUnityRenderHook.dll");
By default it missing !
Update when i debug it in VS the sample load correctly but i have no input i can't clic any button !
Something is missing i think !
-
sfernandez
Site Admin
- Posts: 3188
- Joined:
Re: Windows Store Build
This line should be added automatically by our BuildPostProcessor. Could you please post here the contents of the MainPage() constructor after you click the Build button and before manually patching that line?
About the input, wstore builds only provide Touch input in Unity, mouse is not available.
About the input, wstore builds only provide Touch input in Unity, mouse is not available.
- picpic2006
- Posts: 71
- Joined:
Re: Windows Store Build
this is the code !
Thanks i didn't know that about the mouse input for windows store build sorry !
Is there a way to have mouse input for windows store build, it's strange !!!
Code: Select all
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEngine.Windows;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage;
using Windows.UI;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
using UnityPlayer;
namespace Template
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
private WinRTBridge.WinRTBridge _bridge;
private SplashScreen splash;
private Rect splashImageRect;
private WindowSizeChangedEventHandler onResizeHandler;
public MainPage()
{
this.InitializeComponent();
NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Required;
AppCallbacks appCallbacks = AppCallbacks.Instance;
// Setup scripting bridge
_bridge = new WinRTBridge.WinRTBridge();
appCallbacks.SetBridge(_bridge);
appCallbacks.RenderingStarted += () => { RemoveSplashScreen(); };
#if !UNITY_WP_8_1
appCallbacks.SetKeyboardTriggerControl(this);
#endif
appCallbacks.SetSwapChainPanel(GetSwapChainPanel());
appCallbacks.SetCoreWindowEvents(Window.Current.CoreWindow);
appCallbacks.InitializeD3DXAML();
splash = ((App)App.Current).splashScreen;
GetSplashBackgroundColor();
OnResize();
onResizeHandler = new WindowSizeChangedEventHandler((o, e) => OnResize());
Window.Current.SizeChanged += onResizeHandler;
#if UNITY_WP_8_1
SetupLocationService();
#endif
}
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
splash = (SplashScreen)e.Parameter;
OnResize();
}
private void OnResize()
{
if (splash != null)
{
splashImageRect = splash.ImageLocation;
PositionImage();
}
}
private void PositionImage()
{
var inverseScaleX = 1.0f;
var inverseScaleY = 1.0f;
#if UNITY_WP_8_1
inverseScaleX = inverseScaleX / DXSwapChainPanel.CompositionScaleX;
inverseScaleY = inverseScaleY / DXSwapChainPanel.CompositionScaleY;
#endif
ExtendedSplashImage.SetValue(Canvas.LeftProperty, splashImageRect.X * inverseScaleX);
ExtendedSplashImage.SetValue(Canvas.TopProperty, splashImageRect.Y * inverseScaleY);
ExtendedSplashImage.Height = splashImageRect.Height * inverseScaleY;
ExtendedSplashImage.Width = splashImageRect.Width * inverseScaleX;
}
private async void GetSplashBackgroundColor()
{
try
{
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///AppxManifest.xml"));
string manifest = await FileIO.ReadTextAsync(file);
int idx = manifest.IndexOf("SplashScreen");
manifest = manifest.Substring(idx);
idx = manifest.IndexOf("BackgroundColor");
if (idx < 0) // background is optional
return;
manifest = manifest.Substring(idx);
idx = manifest.IndexOf("\"");
manifest = manifest.Substring(idx + 2); // also remove quote and # char after it
idx = manifest.IndexOf("\"");
manifest = manifest.Substring(0, idx);
int value = Convert.ToInt32(manifest, 16) & 0x00FFFFFF;
byte r = (byte)(value >> 16);
byte g = (byte)((value & 0x0000FF00) >> 8);
byte b = (byte)(value & 0x000000FF);
await CoreWindow.GetForCurrentThread().Dispatcher.RunAsync(CoreDispatcherPriority.High, delegate()
{
ExtendedSplashGrid.Background = new SolidColorBrush(Color.FromArgb(0xFF, r, g, b));
});
}
catch (Exception)
{ }
}
public SwapChainPanel GetSwapChainPanel()
{
return DXSwapChainPanel;
}
public void RemoveSplashScreen()
{
DXSwapChainPanel.Children.Remove(ExtendedSplashGrid);
if (onResizeHandler != null)
{
Window.Current.SizeChanged -= onResizeHandler;
onResizeHandler = null;
}
}
#if !UNITY_WP_8_1
protected override Windows.UI.Xaml.Automation.Peers.AutomationPeer OnCreateAutomationPeer()
{
return new UnityPlayer.XamlPageAutomationPeer(this);
}
#else
// This is the default setup to show location consent message box to the user
// You can customize it to your needs, but do not remove it completely if your application
// uses location services, as it is a requirement in Windows Store certification process
private async void SetupLocationService()
{
AppCallbacks appCallbacks = AppCallbacks.Instance;
if (!appCallbacks.IsLocationCapabilitySet())
{
return;
}
const string settingName = "LocationContent";
bool userGaveConsent = false;
object consent;
var settings = Windows.Storage.ApplicationData.Current.LocalSettings;
var userWasAskedBefore = settings.Values.TryGetValue(settingName, out consent);
if (!userWasAskedBefore)
{
var messageDialog = new Windows.UI.Popups.MessageDialog("Can this application use your location?", "Location services");
var acceptCommand = new Windows.UI.Popups.UICommand("Yes");
var declineCommand = new Windows.UI.Popups.UICommand("No");
messageDialog.Commands.Add(acceptCommand);
messageDialog.Commands.Add(declineCommand);
userGaveConsent = (await messageDialog.ShowAsync()) == acceptCommand;
settings.Values.Add(settingName, userGaveConsent);
}
else
{
userGaveConsent = (bool)consent;
}
if (userGaveConsent)
{ // Must be called from UI thread
appCallbacks.SetupGeolocator();
}
}
#endif
}
}
Is there a way to have mouse input for windows store build, it's strange !!!
-
sfernandez
Site Admin
- Posts: 3188
- Joined:
Re: Windows Store Build
After you click the Build button, does the message "Failed to patch file" appears in the Unity console?
It is weird because the file we want to patch seems to be in your project: MainPage.xaml.cs, and the code we are looking for is also there: "appCallbacks.SetBridge(_bridge);"
It is weird because the file we want to patch seems to be in your project: MainPage.xaml.cs, and the code we are looking for is also there: "appCallbacks.SetBridge(_bridge);"
- picpic2006
- Posts: 71
- Joined:
Re: Windows Store Build
yes the message appear in unity console !
I have to write this line to manage it in VS
I have to write this line to manage it in VS
-
sfernandez
Site Admin
- Posts: 3188
- Joined:
Re: Windows Store Build
Could you please create a ticket in the bugtracker and attach your project so we can analyze what is happening, because we don't understand why the Postprocessor can't patch the file automatically.
Thanks for your collaboration.
Thanks for your collaboration.
- picpic2006
- Posts: 71
- Joined:
Re: Windows Store Build
Hello,
My first problem is this error appear in my vs studio project can i ignore it
I have on more problem maybe it is not noesis problem but i tried every thing i imagine with out succes.
My caracter encoding is wrong when i create the package in VS or when i run it via simulator.
All my accent are replaced by ? i know that is due to format encoding character but i tried to convert my files without succes. I desktop or editor all is good.
I have to save MainPage.xaml.cs manually to patch it can it be the problem ?
Can you see a solution
Thanks you
My first problem is this error appear in my vs studio project can i ignore it
Code: Select all
NullReferenceException: Object reference not set to an instance of an object.
at Noesis.Extend.<GetPublicProperties>b__43e(PropertyInfo p)
at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Noesis.Extend.GetPublicProperties(Type type)
at Noesis.Extend.GetPropertyIndex(IntPtr unityType, String propName)
(Filename: <Unknown> Line: 0)
My caracter encoding is wrong when i create the package in VS or when i run it via simulator.
All my accent are replaced by ? i know that is due to format encoding character but i tried to convert my files without succes. I desktop or editor all is good.
I have to save MainPage.xaml.cs manually to patch it can it be the problem ?
Can you see a solution
Thanks you
- picpic2006
- Posts: 71
- Joined:
Re: Windows Store Build
hi
i created a ticket and i give you the project by link
thanks
The project is just a test exemple just with Noesis as plugin
[LINK REMOVED]
i created a ticket and i give you the project by link
thanks
The project is just a test exemple just with Noesis as plugin
[LINK REMOVED]
Who is online
Users browsing this forum: No registered users and 3 guests