Prime31 plugins with Unity

kankikanki Posts: 62Member
Hi, all!

My problem is simple: can't get the Prim31 Android plugins work with Ouya / Unity. They function fine with other Android devices. I'm quite new with Android building so I'm guessing there might be something wrong with my manifest file. As said, almost the same manifest works with other Android's, though (the differences being main activity name and Ouya-intent, along with some resolution tags).

The plugins in question are the latest Admob (2013-02-17) and Social Networking (2013-02-27). I'm using Unity 3.5.7, and latest Ouya versions (ODK 1.0.0 and firmware 1.0.108_r1). Otherwise our application runs fine with Ouya, but when actually trying to launch either a banner request with Admob, or Facebook login with Social Network, I got a crash. I will post the LogCat debug-outs in following posts as the limit for message length hits me here :).

One notable thing with Social Networking plugin is that I was forced to replace the layout.xml file offered by the plugin with the Ouya-default one, because id "unityLayout" was not recognized.

Has anyone got any insight to this matter?

bests,
Markus

Comments

  • kankikanki Posts: 62Member

    (LogCat output with Admob crash)

    ---clip begin---
    03-08 23:00:18.977: I/Unity(1377): AdSceneManagerScript.RequestBanner() location: Top
    03-08 23:00:18.977: I/Unity(1377):  
    03-08 23:00:18.977: I/Unity(1377): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 43)
    03-08 23:00:18.987: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.007: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.017: D/dalvikvm(1377): DexOpt: --- BEGIN 'ads844922524.jar' (bootstrap=0) ---
    03-08 23:00:19.027: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.047: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.067: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.097: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.117: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.117: D/dalvikvm(1427): DexOpt: load 5ms, verify+opt 12ms, 139036 bytes
    03-08 23:00:19.127: D/dalvikvm(1377): GC_CONCURRENT freed 1191K, 13% free 11030K/12551K, paused 21ms+1ms, total 50ms
    03-08 23:00:19.137: D/dalvikvm(1377): DexOpt: --- END 'ads844922524.jar' (success) ---
    03-08 23:00:19.137: D/dalvikvm(1377): DEX prep '/data/data/com.kankibros.multispace/cache/ads844922524.jar': unzip in 0ms, rewrite 120ms
    03-08 23:00:19.137: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.157: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.157: I/dalvikvm-heap(1377): Grow heap (frag case) to 12.473MB for 281896-byte allocation
    03-08 23:00:19.177: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.207: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.207: E/dalvikvm(1377): Could not find class 'android.gesture.GestureStore', referenced from method com.google.ads.internal.k.a
    03-08 23:00:19.207: W/dalvikvm(1377): VFY: unable to resolve new-instance 63 (Landroid/gesture/GestureStore;) in Lcom/google/ads/internal/k;
    03-08 23:00:19.207: D/dalvikvm(1377): VFY: replacing opcode 0x22 at 0x0000
    03-08 23:00:19.207: D/dalvikvm(1377): DexOpt: unable to opt direct call 0x012c at 0x02 in Lcom/google/ads/internal/k;.a
    03-08 23:00:19.207: D/dalvikvm(1377): DexOpt: unable to opt direct call 0x0127 at 0x11 in Lcom/google/ads/internal/k;.a
    03-08 23:00:19.207: I/dalvikvm(1377): Failed resolving Lcom/google/ads/internal/k$a; interface 61 'Landroid/gesture/GestureOverlayView$OnGesturePerformedListener;'
    03-08 23:00:19.207: W/dalvikvm(1377): Link of class 'Lcom/google/ads/internal/k$a;' failed
    03-08 23:00:19.207: D/dalvikvm(1377): DexOpt: unable to opt direct call 0x16d1 at 0x22 in Lcom/google/ads/internal/k;.a
    03-08 23:00:19.217: D/AndroidRuntime(1377): Shutting down VM
    03-08 23:00:19.217: W/dalvikvm(1377): threadid=1: thread exiting with uncaught exception (group=0x41127300)
    03-08 23:00:19.217: E/AndroidRuntime(1377): FATAL EXCEPTION: main
    03-08 23:00:19.217: E/AndroidRuntime(1377): java.lang.NoClassDefFoundError: android.gesture.GestureStore
    03-08 23:00:19.217: E/AndroidRuntime(1377): at com.google.ads.internal.k.a(SourceFile:41)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at com.google.ads.AdView.a(SourceFile:514)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at com.google.ads.AdView.<init>(SourceFile:94)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at com.prime31.AdMobPlugin$1.run(AdMobPlugin.java:80)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at android.os.Handler.handleCallback(Handler.java:615)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at android.os.Handler.dispatchMessage(Handler.java:92)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at android.os.Looper.loop(Looper.java:137)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at android.app.ActivityThread.main(ActivityThread.java:4745)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at java.lang.reflect.Method.invokeNative(Native Method)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at java.lang.reflect.Method.invoke(Method.java:511)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    03-08 23:00:19.217: E/AndroidRuntime(1377): at dalvik.system.NativeStart.main(Native Method)
    03-08 23:00:19.227: E/nvaudio_hw(112): cannot open pcm: cannot open device '/dev/snd/pcmC0D3p': No such device
    03-08 23:00:19.227: W/ActivityManager(310):   Force finishing activity com.kankibros.multispace/.OuyaUnityApplication
    03-08 23:00:19.247: I/Process(1377): Sending signal. PID: 1377 SIG: 9
    ---clip end---
  • kankikanki Posts: 62Member
    (LogCat output with Social Networking crash)

    ---clip begin---
    03-09 10:05:33.078: E/AndroidRuntime(3288): FATAL EXCEPTION: main
    03-09 10:05:33.078: E/AndroidRuntime(3288): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kankibros.multispace/com.prime31.FacebookProxyActivity}: java.lang.UnsupportedOperationException: Session: an attempt was made to request new permissions for a session that is not currently open.
    03-09 10:05:33.078: E/AndroidRuntime(3288): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at android.app.ActivityThread.access$600(ActivityThread.java:130)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at android.os.Handler.dispatchMessage(Handler.java:99)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at android.os.Looper.loop(Looper.java:137)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at android.app.ActivityThread.main(ActivityThread.java:4745)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at java.lang.reflect.Method.invokeNative(Native Method)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at java.lang.reflect.Method.invoke(Method.java:511)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at dalvik.system.NativeStart.main(Native Method)
    03-09 10:05:33.078: E/AndroidRuntime(3288): Caused by: java.lang.UnsupportedOperationException: Session: an attempt was made to request new permissions for a session that is not currently open.
    03-09 10:05:33.078: E/AndroidRuntime(3288): at com.facebook.Session.requestNewPermissions(Session.java:977)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at com.facebook.Session.requestNewPublishPermissions(Session.java:501)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at com.prime31.FacebookProxyActivity.reauthorizeWithNewPublishPermissions(FacebookProxyActivity.java:100)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at com.prime31.FacebookProxyActivity.onCreate(FacebookProxyActivity.java:35)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at android.app.Activity.performCreate(Activity.java:5008)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
    03-09 10:05:33.078: E/AndroidRuntime(3288): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
    03-09 10:05:33.078: E/AndroidRuntime(3288): ... 11 more
    ---clip end---
  • kankikanki Posts: 62Member

    ... and for the record, here's the manifest file I'm using:

    ---clip begin---
    <?xml version="1.0" encoding="utf-8"?>
    <manifest 
        package="com.kankibros.multispace"
    android:installLocation="preferExternal" 
    android:versionCode="1"
    android:versionName="1.0"> 
      <supports-screens 
    android:smallScreens="false" 
    android:normalScreens="false" 
    android:largeScreens="true" 
    android:xlargeScreens="false" 
    android:anyDensity="false"/>
    <application 
    android:icon="@drawable/app_icon" 
    android:label="@string/app_name" 
    android:debuggable="true"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
    <activity android:name=".OuyaUnityApplication"
    android:label="@string/app_name" 
    android:screenOrientation="landscape"
    android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="ouya.intent.category.GAME"/> 
    </intent-filter>
    </activity>
            <activity android:name="com.unity3d.player.UnityPlayerActivity"
                      android:label="@string/app_name"
                      android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
            </activity>
            <activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
                      android:label="@string/app_name"
                      android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
                <meta-data android:name="android.app.lib_name" android:value="unity" />
                <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
            </activity>
            <activity android:name="com.unity3d.player.VideoPlayer"
                      android:label="@string/app_name"
                      android:screenOrientation="behind"
                      android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
            </activity>
        
       <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
    <receiver android:name="com.google.ads.InstallReceiver" android:exported="true">
    <intent-filter>
    <action android:name="com.android.vending.INSTALL_REFERRER" />  
    </intent-filter>
    </receiver>
    <activity android:name="com.prime31.GoogleIABProxyActivity"></activity>
           <activity android:name="com.facebook.LoginActivity"></activity>
           <activity android:name="com.prime31.FacebookProxyActivity"></activity>
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 469494586445574"/>
    </application>

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="com.android.vending.BILLING"/>
    </manifest>

    ---clip end---
  • kankikanki Posts: 62Member
    Hi, again!

    Brief update: I managed to get the Prime31 Social Networking somewhat working by replacing the reauthorizeWithNewPublishPermissions call with a more proper loginWithPublishPermissions - call. No luck with the AdMob, though.

    Still with Social Networking, I get bunch of errors in LogCat, and managed to get Ouya freeze couple of times. The posting still works, but is quite inconvenient as you need to use the touchpad to get the virtual keyboard on screen. Has anyone found a way around this? It would be best to be able invoke the keyboard with gamepad button ("O", preferably).

    bests,
    Markus
  • LitteratusLitteratus Posts: 28Member
    I am failing to find my source, however I remember the Ouya team making a statement that ads will not be allowed in games.
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    AdMob is advertising on mobile platforms. That said, here's a tutorial about setting it up:

    http://blog.appjigger.com/add-admob-banner-to-your-unity3d-game-using-unity2eclipse/
    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
  • kankikanki Posts: 62Member
    Hi, all.

    Yes, I'm aware of what AdMob is, and we have it running smoothly on other Android platforms with Unity (through the Prim31 plugin). I also posted this to support and got a brief response from Pier that it might be that AdMob does not somehow support Ouya platform (?). 

    The problem is that I got an error that android.gesture.GestureStore is missing. Pier said that (not that he knows of) they have not removed the aforementioned lib.

    Anyhow, we are considering not to use Ads with Ouya anyway as it makes little sense. But I couldn't find anywhere that Ouya actually forbids you from using Ads. Is this really so?

    br,
    Markus
  • LitteratusLitteratus Posts: 28Member
    I tried for hours to find that source.  I remember it being said in a Q&A about monetization that "Free with ads" is not a viable model for the Ouya, which kind of blew up into a "How am I supposed to cross promote my app" debate...  I don't remember if they said that Ads were outright banned, but that was the impression that I got.  I could very well be wrong (And considering I can't find the source, it may have been all a bad dream) or they may have completely reversed their stance.. I'm not sure anymore.

    My only advice is if you are going to use ads, prepare for the possibility that they are not allowed, that way you won't be caught off guard in that case.

  • AyrikAyrik Posts: 429Member
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    kanki said:
    Hi, all.

    Yes, I'm aware of what AdMob is, and we have it running smoothly on other Android platforms with Unity (through the Prim31 plugin). I also posted this to support and got a brief response from Pier that it might be that AdMob does not somehow support Ouya platform (?). 

    The problem is that I got an error that android.gesture.GestureStore is missing. Pier said that (not that he knows of) they have not removed the aforementioned lib.

    Anyhow, we are considering not to use Ads with Ouya anyway as it makes little sense. But I couldn't find anywhere that Ouya actually forbids you from using Ads. Is this really so?

    br,
    Markus
    I don't believe it's OUYA that is restricting you from using ads in your game. My only concern is with AdMob and whether AdMob would allow you to put mobile ads on an android console/non mobile device. If it's acceptable by AdMob I'll make it work. I'm just trying to avoid working on it, and then throwing away work if it has a chance of being rejected.
    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
  • joaquingrechjoaquingrech Posts: 22Member
    google doesn't mind where you display the admob. They try to support as many platforms as possible (even iOS, pc and mac). They get money displaying ads... so it would be non-sense to block any platform.
Sign In or Register to comment.