building chat application for windows platform with unity

11 posts / 0 new
Last post
building chat application for windows platform with unity
ahmed.jamal.ikram's picture
Offline
Joined
06/25/2012 - 03:23
Posted
Thu, 08/30/2012 - 00:41

HI EVERYONE,

i was trying to build the chat application for windows platfom with the latest unity extension, but was unable to proeceed because of an error which showed in the AlljoynAgent.cs stating that

 

Assets/Scripts/AllJoynAgent.cs(56,25): error CS0122: `AllJoynUnity.AllJoyn.TriggerCallbacks()' is inaccessible due to its protection level the code in this line is just AllJoyn.TriggerCallbacks();

I dont have any idea about this error, can anyone please help :(

Re: building chat application for windows platform with unity
yosun's picture
Offline
Joined
09/03/2012 - 00:26

It looks like they forgot to expose a few methods. File a bug report? 

I get the same error: 

 

Assets/Scripts/AllJoynAgent.cs(56,25): error CS0122: `AllJoynUnity.AllJoyn.TriggerCallbacks()' is inaccessible due to its protection level 
Re: building chat application for windows platform with unity
yosun's picture
Offline
Joined
09/03/2012 - 00:26

Actually, try the following:

 Build unitystartalljoyn.class following directions in https://www.alljoyn.org/docs-and-downloads/documentation/alljoyn-unity-s... if you are using Eclipse or using ant

 Import the .unitypackage

Re: building chat application for windows platform with unity
mitchw's picture
Offline
Joined
08/16/2012 - 15:25

 

There are two ways to fix the `AllJoynUnity.AllJoyn.TriggerCallbacks()' is inaccessible due to its protection level error in the Chat example:

 

You can comment out the entire Update method (lines 53 through 57) in AllJoynAgent.cs 

OR

You can re-import the AllJoynUnity_2_3_6.unitypackage into the Chat example project in the Unity editor. (Assets -> Import Package -> Custom Package, navigate to the <SDK download folder>/unity and select AllJoyn_Unity_2_3_6.unitypackage, then click Import in the pop-up window)

 

Note that in either case, you will still need to build alljoynstartunity.jar and place it in Assets\Plugins\Android (see the quick start guide for help)

 

These steps will not be necessary in the next release (2.6)

Re: building chat application for windows platform with unity
RLI.br's picture
Offline
Joined
09/07/2012 - 22:54

 

After solve this errors, I got these: --DllNotFoundException: alljoyn_cAllJoynUnity.AllJoyn.GetVersion ()AllJoynAgent.Awake () (at Assets/Scripts/AllJoynAgent.cs:41) --DllNotFoundException: alljoyn_cAllJoynUnity.AllJoyn.SetMainThreadOnlyCallbacks (Boolean mainThreadOnly)AllJoynUnity.AllJoyn+BusAttachment..ctor (System.String applicationName, Boolean allowRemoteMessages)basic_clientserver.BasicChat.StartUp () (at Assets/Scripts/BasicChat.cs:199)basic_clientserver.BasicChat..ctor () (at Assets/Scripts/BasicChat.cs:187)AllJoynClientServer.Start () (at Assets/Scripts/AllJoynClientServer.cs:90) Maybe exist some problem in this release (2.3.6). (sorry for any English errors)
Re: building chat application for windows platform with unity
RLI.br's picture
Offline
Joined
09/07/2012 - 22:54

Sorry my big mistake.
These errors happen because I tried to run the chat in the Unity editor and not in the device.

Re: building chat application for windows platform with unity
mitchw's picture
Offline
Joined
08/16/2012 - 15:25

Are you getting this error when trying to run the Chat sample in the Unity editor via the "play" button? Can you confirm that you're getting this error using the AllJoyn SDK 2.3.6 w/ Unity Extension - Windows 7/x86 download? This sounds like an issue someone else was having because they were trying to run the Chat sample on Windows via the Unity editor when in fact they had downloaded and were using the AllJoyn SDK 2.3.6 w/ Unity Extension - Android.

Re: building chat application for windows platform with unity
RLI.br's picture
Offline
Joined
09/07/2012 - 22:54

 

Hello mitchw, To AllJoyn SDK 2.3.6 w/ Unity Extension - Android has no error if run on the device, the error only appears if you try to use the PLAY button in the editor Unity.In AllJoyn SDK 2.3.6 w/ Unity Extension - Windows 7/x64, (NOT x86) if use the PLAY button I have these errors again:--DllNotFoundException: C:/alljoyn-sdk-2-3-6-win7x64/alljoyn_2_3_6_dbg/unity/samples/Chat/Assets/Plugins/alljoyn_c.dllAllJoynUnity.AllJoyn.GetVersion ()AllJoynAgent.Awake () (at Assets/Scripts/AllJoynAgent.cs:41)--DllNotFoundException: C:/alljoyn-sdk-2-3-6-win7x64/alljoyn_2_3_6_dbg/unity/samples/Chat/Assets/Plugins/alljoyn_c.dllAllJoynUnity.AllJoyn.SetMainThreadOnlyCallbacks (Boolean mainThreadOnly)AllJoynUnity.AllJoyn+BusAttachment..ctor (System.String applicationName, Boolean allowRemoteMessages)basic_clientserver.BasicChat.StartUp () (at Assets/Scripts/BasicChat.cs:199)basic_clientserver.BasicChat..ctor () (at Assets/Scripts/BasicChat.cs:187)AllJoynClientServer.Start () (at Assets/Scripts/AllJoynClientServer.cs:90)  

I'll try the x86 version on another machine (dual core x86) and then I'll tell you what happened.

Alljoyn can never be used in the Unity editor?

Re: building chat application for windows platform with unity
RLI.br's picture
Offline
Joined
09/07/2012 - 22:54

Hello mitchw,

AllJoyn SDK 2.6 w/ Unity Extension - Windows 7/x86 (no Bluetooth support) (debug) 

No error to Unity in a dual core machine, wich PLAY button in the editor. 

To x64 version, the error still remains...

 

Re: building chat application for windows platform with unity
mitchw's picture
Offline
Joined
08/16/2012 - 15:25

Thanks for the feedback. I was able to reproduce the same results for the Chat application, the 2.6 Windows x86 build works fine when run in the Unity editor, but the 2.6 Windows x64 build gives the DllNotFoundException for the alljoyn_c.dll.

If you replace the alljoyn_c.dll in the x64 version of Chat with the alljoyn_c.dll from the x86 version of Chat, that should fix the error. It is located at <SDK directory>\unity\samples\Chat\Assets\Plugins

Re: building chat application for windows platform with unity
ninthjarl's picture
Offline
Joined
12/11/2012 - 21:01

Thanks for that. It has solved it temporarily not sure if we can really use the 64bit version in x86 platform. If I come across any issues, will post it here. BTW, I am running windows 7 professional on Intel Xeon CPU E31245 3.3Ghz.