Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Reign Unity Plugins (Win8/WP8, BB10, iOS, Android, ect...)

Discussion in 'Assets and Asset Store' started by zezba9000, Oct 1, 2013.

  1. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    The build error message was:

    ""1> System.IO.FileNotFoundException: Assembly "Microsoft.Advertising.WinRT.UI, Version=8.1.40402.2, Culture=neutral, PublicKeyToken=null" file not found."."

    Could this be due to not having the Ads SDK? I was building to Windows Store so I didn't think it was necessary.
     
  2. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    Thank for help! Now I can continue my development :)
     
  3. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Still not working at all after the update.
    Tried the demo scene but does not work either, it says that ad succeeded, but nothing is shown =/

    screen DPI is 234.0124
    not sure how to get ad width and height on runtime, but I have set to:
    Android_AdMob_AdSize.Banner_320x50

    Edit: On WP8 both its working. On Android neither banner or interstitial works.
     
    Last edited: May 29, 2014
  4. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Last edited: May 29, 2014
  5. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    This sounds like you don't have the Ads SDK referenced in Visual Studios.
    Did you add the MS-Ads sdk as a refference as listed in the docs? http://www.reign-studios.net/docs/windows-8/ads/
     
  6. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Your apk works fine for me!
    I can check the dpi on the demo when I get home!
     
  7. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Thanks for your help. I'll do those ... I didn't notice those sets of instructions on the websites for ads and in app purchases.
     
  8. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Docs have just been updated and are now more organized for future updates is probably why.
     
    Last edited: May 29, 2014
  9. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    The adsDemo DPI is the same, but how do I see the DPI on the apk you sent?
     
  10. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    You install the apk via: "adb install Android_Build.apk"
    To see the log you do: "adb logcat"
    NOTE: Run the "adb logcat" before you open up the app and you will the the "Screen DPI" number print to the terminal window.

    "adb" can be found in your Android SDK folder and you run it via the Terminal on Mac or Console on Windows.
     
  11. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Oh, I had installed it directly on android via email, and for some reasosn it did not show. Now it did, it's also 234!

    Also, this test is landscape, my app is portrait, don't know if it makes a difference.
     
    Last edited: May 30, 2014
  12. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Looks like your Android OS is reporting the wrong DPI value on your device.... great. My devices report, 1.0 and 1.5
    Well there is a workaround, so i'll push that up in the next update.
     
  13. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    I hate android >.<
    That would cause both the banner and the interstitial not to work?
     
  14. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Me too :)
    The interstitial should still work. Let me get an update out and I will validate that.
     
  15. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    After last update I cannot compile project for android anymore :(

    Error: [Temp\StagingArea\AndroidManifest-main.xml:39, D:\work3\Windows Dev\Unity\Anti2048\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml:8] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()


    What was changed in last update? What should I update in project?
     
  16. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    I was able to fix that error, nut now getting new one :(

    Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
    C:\Program Files\Java\jdk1.7.0_40\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="D:/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

    stderr[

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/cast/Cast$CastApi$a$9;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
    at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
    at com.android.dx.command.dexer.Main.processClass(Main.java:685)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
    at com.android.dx.command.dexer.Main.access$600(Main.java:78)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:596)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at SDKMain.main(SDKMain.java:129)
    1 error; aborting
    ]

    I have Google Play integrated Game Service in Unity project. Does your plugin now have compatible issues with it?
     
  17. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Interstitial is also not currently working =/
     
  18. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Yes you can have issues with two plugins that use the same API as Android doesn't build in (what should be built in) to there core API libs and thus copy paste is required and in turn namespace/package conflict can occur. I can change the package/namespaces of these objects in the next update which should get rid of those errors.
     
  19. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Some fixes for those will come out in the update. Bare with me until I can test and get that out later tonight or so.
     
  20. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    K bug fix release pushed out. AdMob should work now.
     
  21. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Nope, nether the banner or the interstitial.
    Also getting a NullReferenceException when trying to buy IAP, on MessageBoxManager.Show.
    My update is already one week late on android, I can't update until this is fixed =/
     
  22. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Nothing has changed with MessageBox.Manager.Show. Can you give more info about the error?
    Also you might try re-installing the unitypackage from "Edit->Reign->Download packages" in case something is messed up and re-importing assets.
    Also update your Android SDK with the "SDK Manager" (I really recommend you do this to get it out of the way). If possible, email (support@reign-studios.com) me the APK or something you are getting the error with, so I can see if I get the same issue on my devices. Anything that might help me debug your issue would help as your device seems to be having issues I have a harder time reproducing. If anything send me more of your logcat information.
     
  23. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    @totsboy FYI, i've just tested on a Samsung Galaxy Tab 4 and both Ad types work. In fact they work on all my Android devices. Sounds like something else is wrong if you still are having issues. So i've tested on AndoirdOS 4.4.2, 4.0.1 and 2.3.4

    You really need to send me your full logcat file... or I have no idea what is wrong with your device.
     
    Last edited: Jun 1, 2014
  24. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    I have already updated the SDK.
    Also updated reign again through packages. Still doesn't work.
    I have sent you the apk!
     
  25. totsboy

    totsboy

    Joined:
    Jul 12, 2013
    Posts:
    253
    Also, posted this on the reign forum since unity was down:


    ads are showing on WP8 and refreshing normally, but they won't get any clicks, it just doesn't work!
    I'm getting a ton of impressions and zero clicks.
    seems like it's an admob problem, not related to plugin, found this possible "fix", but not sure what the "format" is:

    1 - no renovation set to auto-refresh ads from AdMob
    2 - delete the "Format" from the XAML code

    source:
    https://groups.google.com/forum/#!topic/google-admob-ads-sdk/p84aMuWc2QA

    I'm also getting the error:
    0x80070005 Access Denied on startup

    Also shows this on debug:

    'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Runtime.InteropServices.WindowsRuntime.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    Error: Operation has failed with error 0x80070005: Access is denied.


    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/MetroPlayer/HandleSystemError.cpp Line: 19)
     
    Last edited: Jun 2, 2014
  26. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'm trying to incorporate ads into my Windows Store game before releasing it. I have some questions as I'm new to the whole game ads thing.

    I see there are two options for ads ... interstitial ads and normal ads. Am I right in assuming that normal ads would be put on your gameplay screen and interstitial ads would be a separate scene that the user would navigate through as he / she was playing the game. So a good place for an interstitial ad might be before each game level? Is that too heavy a use for interstitial ads ... should they only play once per play session or periodically? Typically, do games have either interstitial ads or normal ads or should they have both?
     
  27. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Another question ... if I have an interstitial ad page before a new level in my game. Should I have a skip button or should the user have to click on the ad itself to skip to the actual gameplay?
     
  28. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Hi Rajmahal, sorry the Unity forum didn't notify me of this message for some reason.
    To sum up your questions.
    "Normal Ads" = Banner Ads and can be shown 24/7 while they play your game.
    "Interstitial Ads" = Full-Screen Ads that can be shown at key areas of your game... like after you beat a level or something.

    Games can use both Ad types. But I recommend you only show interstitial Ads every so often as they will piss people off if there are to many.

    No you don't. Each native Ads API will do that for you.
     
  29. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Update pushed out.

    1) Android "createdCallbacks" don't get fired before they are done.

    2) Debug warning will appear if you run with REIGN_DISABLED on.

    3) Fixed MM-Ads null ref for BB10

    4) Fixed Android Dispose Ad method.
     
  30. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    New bug found! :(
    I call messagebox
    MessageBoxManager.Show("Undo", "Are you sure you want to make undo?", MessageBoxTypes.OkCancel, doUndoCallback);

    and in callback
    I do undo if pressed OK and unpause game.

    But in android user can tap outside the messagebox and your plugin do not fires callback so I cannot unpause game.

    Can you please check it and fix?
     
  31. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Okay, so if I have an interstitial ad scene that loads after a level is completed, how should I transition to the next level? Should I just have it load after a set time or put a "skip to next level" button? Sorry for the noob questions but I just want to make sure my game uses the ads properly.
     
  32. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    One more question, are interstitial ads supported for Windows 8 store apps? I noticed that the interstitial ads demo only has a section for WP8 and not for W8 as in the case of the Ads Demo script.
     
  33. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I set up normal ads using the Ads Demo script once my main gameplay starts. I built it in Visual Studio for a Windows Store game as a master build (using Unity 4.3.4). I'm using the test settings as per Microsoft and the ads do seem to appear properly. However, I'm noticing a huge performance drop once I hover over or click on the ad with the mouse. It makes my game unplayable.

    Is this normal or something that you've seen when testing?
     
  34. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    I'll take a look and get this fix asap. I thought this was working. What device are you testing with?
     
  35. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Call "ad.Cache" when the user starts to play the level. Then when they are done, call "ad.Show"
     
  36. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    No AdMob does not support it yet. But will add in some APIs that do later.

    Are you doing this on Windows8.1? It might slow it down a little when it loads an Ads but should not bad. Make sure you are not creating more Ads then you need and making them overlay eachother or something.
     
  37. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Thanks for the reply. I'm only creating one ad as far as I know. Essentially, all I did was add the Ad Demo script on the main camera and put Reign Services in the scene. I don't get this issue in the editor but only when I build and play in Visual Studio. I'm using the testing Add ID values specified on the Microsoft developer website.
     
  38. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    What device are you testing on? Is it some super slow Intel GPU?
     
  39. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'm using an HP laptop with core i5 processor, 8 GB ram and a mobile ATI video card that is Direct X11 compatable ... I think it has 128 MB of dedicated video ram but I could be mistaken.
     
  40. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    O yes forgot to say. If you are running in Debug mode, then yes it will slow stuff down a bit. When you build for release then this will not be an issue.
     
  41. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'm pretty sure I had done a Master build. There was no slow down until either I clicked an ad, hovered the mouse cursor over an ad or finished the level and loaded another level.

    Also, should I be doing something to stop displaying the ads when I exit a level? At the moment, the ads remain on the screen after I exit the level and go back to the earlier menus.
     
  42. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Well the Reign plugin is not doing anything that would slow it down. If its going slow, then the Ads SDK is doing it entirely. The plugin just sets up the Ad and adds it to the main XAML surface for you. All Ad frameworks do slow down games. Just give the user a option to purchase Ad removal or something.
     
  43. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    That's fine ... but I would like to confirm that i'm not missing a key step in my implementation. In a good implementation of in-game ads, should I be calling a method to start displaying them when a scene loads and then disable them as I exit the scene and load another scene? At the moment, it seems to work in a very strange way as I only have the ads demo script calling up the ad on my gameplay level but the ads never go away once invoked. Even when the player navigates to other menus that don't have the ad demo script, the ads are always appearing on the screen. Is that right?
     
  44. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Because the AdsDemo script keeps itself alive (which you want btw), simply invoke a static method that sets "ad.Visible = true/false" before you load a scene.
     
  45. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Okay ... as long as that's the intended functionality.

    Thanks for the great support.
     
  46. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Ok an update has been pushed out that fixes your issue.
     
  47. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    998
    Update!

    Unity4.5 support for iOS now works. If you still need Unity4.3.4 support, the plugin now ships with a zip file: "Plugins/iOS/Unity_4.3.4_Support_Libs.zip"
     
  48. XRayAdams

    XRayAdams

    Joined:
    May 23, 2014
    Posts:
    23
    I tested it with Nexus 7 tablet
     
  49. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Any updates on Windows Store / Phone status with unity 4.5?
     
  50. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Actually I figured out the issue I was having with a performance drop once I clicked an ad. It was entirely a code issue on my side. Great asset!