Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Prime31 Android Plugins Officially Live!

Discussion in 'Android' started by prime31, Jun 6, 2011.

  1. wilfred

    wilfred

    Joined:
    Nov 14, 2011
    Posts:
    17
    Hi Prime,

    In the w3i Android plugins, why it don't call AppWasRun function? I can't so any ad tracking in w3i now. Could you fix it? Thanks.
     
  2. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @wilfred, can you be more specific? What exactly are you referring to?
     
  3. dannyskim

    dannyskim

    Joined:
    Jul 20, 2011
    Posts:
    87
    Hey again Mike,

    I'm having an issue with OpenFeint integration, don't know if you can provide any insight. I'm getting a Building DEX failed error when compiling, and I think it is because OpenFeint is possibly duplicating some of your methods... I've checked to make sure I have no duplicate files, so I can't think of what exactly could be wrong:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/facebook/android/AsyncFacebookRunner$1;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
    at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
    at com.android.dx.command.dexer.Main.processClass(Main.java:486)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
    at com.android.dx.command.dexer.Main.access$400(Main.java:67)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    at com.android.dx.command.dexer.Main.processOne(Main.java:418)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
    at com.android.dx.command.dexer.Main.run(Main.java:206)
    at com.android.dx.command.dexer.Main.main(Main.java:174)
    at com.android.dx.command.Main.main(Main.java:95)
    1 error; aborting

    I know this is kind of outside of the scope of your support, but if you could point me in the right direction at least it would be appreciated.
     
  4. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @danny, OF includes a really old version of the Facebook Connect SDK. If you are savvy with jars, you should be able to remove their compiled class files (anything com.facebook) and it *might* work. Besides that there is no easy fix.
     
  5. dannyskim

    dannyskim

    Joined:
    Jul 20, 2011
    Posts:
    87
    Hmm, alrighty. I'll take a look at the associated .jar files with a .class editor and see if I can figure out, I'll post any appreciable results. Thanks for the fast response as always.
     
  6. dannyskim

    dannyskim

    Joined:
    Jul 20, 2011
    Posts:
    87
    So I removed the compiled class files as you recommended and it's compiling. I'm under the assumption that removing these files entirely will cause something to break inside of OF in regards to Facebook posting, so I'll take a look at report my findings.

    If it comes down to decompiling and moving references and such, I'll post a how-to if I find a solid solution that doesn't cause any crashes.
     
  7. wilfred

    wilfred

    Joined:
    Nov 14, 2011
    Posts:
    17
    Hi Prime,

    I mean is your plugin include w3i Advertiser SDK? Because I can't see "AppWasRun()" in Advertiser SDK called.
     
  8. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @wilfred, only the iOS version covers both the publisher and advertiser SDKs. Android only covers the publisher SDK.
     
  9. wilfred

    wilfred

    Joined:
    Nov 14, 2011
    Posts:
    17
    i see....Any reason why not include the advertiser SDKs? :(
     
  10. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @wilfred, lack of demand. You are te only one who has ever asked for them.
     
  11. dannyskim

    dannyskim

    Joined:
    Jul 20, 2011
    Posts:
    87
    Something in OpenFeint broke your Android Manifest generation script. Could you possibly post the manual changes I would need to make to the .xml file for Social Networking and Android Billing so I can just modify it myself?
     
  12. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @danny, the changes required are already present in the Manifest.xml file included with each plugin.
     
  13. dannyskim

    dannyskim

    Joined:
    Jul 20, 2011
    Posts:
    87
    is there anything else that I need to add other than the changes that are included in the Manifest file? I added the meta-data and permissions sections of the IAB Manifest file into the default Manifest file found in the Unity folder, but I keep on getting crashes every time I try to make a purchase now.

    Code (csharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest
    3.     xmlns:android="http://schemas.android.com/apk/res/android"
    4.     package="com.unity3d.player"
    5.     android:installLocation="preferExternal"
    6.     android:versionCode="1"
    7.     android:versionName="1.0">
    8.     <supports-screens
    9.         android:smallScreens="true"
    10.         android:normalScreens="true"
    11.         android:largeScreens="true"
    12.         android:xlargeScreens="true"
    13.         android:anyDensity="true"/>
    14.  
    15.     <application
    16.         android:icon="@drawable/app_icon"
    17.         android:label="@string/app_name"
    18.         android:debuggable="true">
    19.         <activity android:name="com.unity3d.player.UnityPlayerProxyActivity"
    20.                   android:label="@string/app_name"
    21.                   android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    22.             <intent-filter>
    23.                 <action android:name="android.intent.action.MAIN" />
    24.                 <category android:name="android.intent.category.LAUNCHER" />
    25.             </intent-filter>
    26.         </activity>
    27.         <activity android:name="com.unity3d.player.UnityPlayerActivity"
    28.                   android:label="@string/app_name"
    29.                   android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    30.         </activity>
    31.         <activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
    32.                   android:label="@string/app_name"
    33.                   android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    34.             <meta-data android:name="android.app.lib_name" android:value="unity" />
    35.             <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
    36.         </activity>
    37.         <activity android:name="com.unity3d.player.VideoPlayer"
    38.                   android:label="@string/app_name"
    39.                   android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    40.         </activity>
    41.     </application>
    42.    
    43.     <!-- META DATA -->
    44.     <service android:name="com.prime31.billing.BillingService" />
    45.         <receiver android:name="com.prime31.billing.BillingReceiver">
    46.             <intent-filter>
    47.                 <action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
    48.                 <action android:name="com.android.vending.billing.RESPONSE_CODE" />
    49.                 <action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
    50.             </intent-filter>
    51.         </receiver>
    52.        
    53.     <!-- PERMISSIONS -->
    54.     <uses-permission android:name="android.permission.INTERNET" />
    55.     <uses-permission android:name="com.android.vending.BILLING" />
    56.    
    57. </manifest>
    Not sure what's going on, and I can't see how OpenFeint could have broken your Manifest generation script.
     
  14. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @danny, the Manifest.xml files contain all the changes required for the plugins.
     
  15. dannyskim

    dannyskim

    Joined:
    Jul 20, 2011
    Posts:
    87
    The meta-data portion of the Manifest file needed to be put in the <application> section. I figured I was doing something wrong, which is why I posted the code. Oh well, lesson learned, move on.
     
  16. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @Prime31

    We're having an issue w/a game AFTER we've published it (we've since taken it down). But we added in a checkForPrevious purchased unlocks on first launch and it worked perfectly fine... didn't unlock the game until the user actually purchased it (via the testing accounts). But now that we've put it on the market, it is unlocking on EVERY launch for EVERY user (only new accounts we've created to test with that are not in the google play test account section). have you ever seen anything like this? we're not doing anything fancy... just do the init, and on the billing supported event we check to see if its first launch and if it is we run restoreTransactions, which seems to always be returning a valid receipt because its definitely unlocking.

    Cheers
    Bryan
     
  17. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bpritchard, i've never seen Google Play provide receipts for items that were not actually purchased. You may want to open a bug report with them because something isnt right in there.
     
  18. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    I'm assuming that restoreTransactions() returns a list of valid receipts, after when the transactionsRestored event should be running correct? Thats how the sequence is setup.. and d on't do anything in between.. we just start one and wait for that to finish. Our unlock is in the transactionsRestored event, so i would think it would be pretty straight forward.
     
  19. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bpritchard, the transactionsRestoredEvent and the transactionRestoreFailedEvent are only indicators that the request to restore transactions was received by Google Play. They do not return receipts, products or anything of the sort. Play will get around to firing the purchaseSucceededEvent for any purchases that it actually restores.
     
  20. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    Oh so i'm backwards? so basically the restoreTransactions will automatically return the purchaseSucceededEvent if there are valid receipts?
     
  21. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @bpritchard, that is correct. The transactionsRestored/FailedEvents are merely to tell you if the request successfully (or unsuccessfully) reached the Play servers. Play will then at some point in the future actually do the restoring if there are any transactions to restore.
     
  22. ironhero

    ironhero

    Joined:
    Nov 15, 2008
    Posts:
    65
    Prime 31

    does your Social networking plugin really support single sign on support?

    I've just failed to get it working on your Facebook test scene.

    I run the scene on android device.
    Push Init and Login buttons.
    Get the dialog to install Facebook For Android.
    Installed Facebook for Android and login FB

    Then I started your test app again
    Push Init and Show Post Dialog buttons
    It seem I should get Post Dialog here
    But I got the dialog to install Facebook For Android again

    What I did wrong?
    Need advise to force single sign on support working

    Thanks
     
  23. devGuillaume

    devGuillaume

    Joined:
    Feb 10, 2012
    Posts:
    23
    Could you tell exactly which plugins are affected? We're now considering adding the AdMob plugin on top of Etcetera, Social Networking and In App Billing but this is not a definitive list.
    Thank you!
     
    Last edited: May 14, 2012
  24. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @iron, we removed SSO from the Android version a while back. Facebook has a huge pile of bugs with it and affecting different devices that they still haven't fixed. In addition it required overriding the main Unity Activity which has a host of difficulties as well.


    @dev, you are fine with the plugins listed. They will all work without issue.
     
  25. ironhero

    ironhero

    Joined:
    Nov 15, 2008
    Posts:
    65
    @Prime

    override the main Unity Activity is not a problem
    it is extended with a lot of things in my case already
    if it solves the problem, would you like to drop some info on it ?
     
  26. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @iron, you would need to create your own authentication system. Our plugin only supports the in app login process.
     
  27. nikolic

    nikolic

    Joined:
    Oct 15, 2011
    Posts:
    162
    @prime31

    Sorry if this has already been asked, the topic is not easy to search.
    What are the required manifest permissions for social plugin?
    Thanks.
     
  28. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @nikolic, if there were any manifest changes required they would be contained in the Manifest.xml file. The SocialNetworking Plugin does not required any though besides the obvious internet permission.
     
  29. devGuillaume

    devGuillaume

    Joined:
    Feb 10, 2012
    Posts:
    23
    @Prime31, In the askForReview() and askForReviewNow() methods, is the appPackageName parameter the bundle identifier shared between multiple platforms and located in Unity's Player Settings?
    If it is, could you add a method to retrieve this identifier at runtime? It is suggested here how it can be done for iOS (could be useful as well) but I don't know about Android. Or you could just remove the appPackageName parameter altogether?
     
    Last edited: May 15, 2012
  30. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dev, that is a required name that should be the exact package name you setup in the Googke Play web portal when creating your game.
     
  31. kinzia

    kinzia

    Joined:
    Aug 14, 2010
    Posts:
    18
    I've got problem with mobclix plugin and qcar. My qcar work well before generate the manifest xml. After I generate it, all qcar function does not work. Any solution can fix this problem?

    Thanks!!
     
  32. nshack31

    nshack31

    Joined:
    Nov 4, 2011
    Posts:
    96
    These plugins are great, i'm using a few.

    But when using the admob plugin it works great in Portrait using: AdMobAndroid.createBanner( AdMobAndroidAd.smartBanner, 0, 0 );

    but if i change my game to "Landscape Left" and run it on my tablet i cannot see a banner. any ideas?! thanks


    .....edit sorry it actually works on most devices, its low res ones that seem to have a prob
     
    Last edited: May 17, 2012
  33. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @kinzia, you will have to setup your AndroidManifest file manually by adding the requirements for QCAR.


    @nashack, we have some really old low res devices in our test bed that work fine. Are you listening to the events the plugin fires? It could very well be that there is just no fill available.
     
  34. nshack31

    nshack31

    Joined:
    Nov 4, 2011
    Posts:
    96
    It's an Archos 7... fairly sure its not a fill issue. I works fine in portrait but refuses to work in landscape. not the end of the world
     
  35. kinzia

    kinzia

    Joined:
    Aug 14, 2010
    Posts:
    18
    how to setup the androidManifest with qcar?
    Thanks!
     
  36. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @kinzia, we don't provide support for QCAR. Pleas consult the QCAR documentation or vendor.
     
  37. achingupta87

    achingupta87

    Joined:
    Apr 9, 2012
    Posts:
    144
    Hello EveryBody

    I wants to use Electra Plugins with unity3d for android sample project.

    Can u please tell the How its is possible .

    If any sample project is available please share with me.

    Thanks:mad:
     
  38. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @aching, the demos scene is located in the testSupport folder.
     
  39. achingupta87

    achingupta87

    Joined:
    Apr 9, 2012
    Posts:
    144
    I got the testSupport folder but when I try to open this scene it does not open.

    First I open the new project from unity 3.4 then when I try to open this scene nothing is import in the unity nothing is displayed?????

    can u help me whats the problem??????
     
  40. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @achung, demo scenes will only work with Unity 3.5.
     
  41. achingupta87

    achingupta87

    Joined:
    Apr 9, 2012
    Posts:
    144
    Now I have the unity 3.5 but the same problem again......when we try to open the scene nothing is included with scene simple unity window is open nothing is show.......where is the problem now. I have the EtceteraAndroid plugin folder which contains two folders some files. I select the scene from the testSupport folder but nothing is shown......please help????????
     
  42. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @aching, are you pressing play to run the scene? Are your player settings set to Android? Did you open the files up to look at them?
     
  43. achingupta87

    achingupta87

    Joined:
    Apr 9, 2012
    Posts:
    144
    1st of all I open the unity window . Then from file I select the open scene then select the scene from testsupport folder.
    now nothing is opened in the unity window.........player setting is set for android.........now what i do......please help.
     
  44. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @aching, are you pressing play to run the scene? What GameObjects do you see in the object list? Please post screenshots as well. We have never heard of a situation where Unity opens a scene with no errors it doesn't actually open it.
     
  45. achingupta87

    achingupta87

    Joined:
    Apr 9, 2012
    Posts:
    144
    I m using Plane gameObject in the game. I attached the 2 screenshots of unity window which we see when try to run the project..Is It only run in the android device or we can check this in unity editor or webplayer.?????????

    Can u tell me please is Plugin is only works with unity 3.5 or unity 3.5 pro version ??????
    It not works with unity 3.4 or old version????
     

    Attached Files:

    Last edited: May 22, 2012
  46. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @aching, it is an Android plugin with Android native code and can only run on an actual Android device.
     
  47. achingupta87

    achingupta87

    Joined:
    Apr 9, 2012
    Posts:
    144
    Thanks Team for your response......One more question from my side.

    Is Prime31 only support unity 3.5 android Pro version or old version also. because I have unity 3.4 android Pro ?
     
  48. devGuillaume

    devGuillaume

    Joined:
    Feb 10, 2012
    Posts:
    23
    Hi Danny,
    Could you post the modified Giraffe.jar? I'm not savvy with jars and it could save me some time. Thank you!
     
  49. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @aching, Unity Android Basic 3.4 will work fine.


    @dev, all you have to do is unzip the jar file, delete any files you want to remove then zip it again.
     
  50. devGuillaume

    devGuillaume

    Joined:
    Feb 10, 2012
    Posts:
    23
    @Prime31, oh, thanks!
    For reference:
    I indeed just had to open Giraffe.jar with 7-zip and remove the following classes:
    com.facebook.android
    com/gree.giraffe/thirdpart.bridge/FacebookBridge.class
    com/gree.giraffe/thirdpart.bridge/FbAuthFragmentDialog.class
    com/gree.giraffe/thirdpart.bridge/FbDialogListener.class

    Here are the logcat output errors I get when running our game, but I guess it's harmless (other than not being able to access Facebook from OpenFeint anymore, of course):

    NotSupportedAndroidMethodCallback: Failed to handle method '{"PRODUCT_NAME":"<xxx>", "GII_DOMAIN":"gree.net", "GII_DEV_DOMAIN":"dev.gree.jp", "GII_API_HOST_PREFIX":"api", "MY_APP_DEFAULT_LEADERBOARD_ID":"", "OF_APP_ID":"<xxx>", "Analytics":{"iTunesAppId":"appId", "Apsalar":{"apsalarSecret":"", "apsalarKey":""}, "gameVersion":""}, "MY_APP_DEFAULT_CURRENCY_ID":"", "MODULES":"OpenFeint,Social", "MY_APP_DEFAULT_SCORE_ID":"", "OF_INITIAL_DASHBOARD_ORIENTATION":"3", "GII_DEPLOY_TARGET":"DEVELOPMENT", "OF_PRODUCT_KEY":"<xxx>", "FACEBOOK_FORCE_DIALOG_AUTH":"false", "OF_APP_SHORT_DISPLAY_NAME":"<xxx>", "PROTOCOL":"http", "MY_APP_DEFAULT_ACHIEVEMENT_ID":"", "TWITTER_CONSUMER_KEY":"", "OF_ENABLE_PUSH_NOTIFICATIONS":"1", "TWITTER_CONSUMER_SECRET":"", "OF_DEVELOPMENT_MODE":"2", "OF_CUSTOM_INIT_FLOW":"0", "OF_ALWAYS_ASK_FOR_APPROVAL_IN_DEBUG":"0", "OF_SECRET_KEY":"<xxx>", "OF_FORCE_UNREGISTER_PUSH_NOTIFICATIONS ":"1", "GII_DEV_SUFFIX":"gii17", "MY_APP_DEFAULT_PERC

    I hadn't looked at logcat before since integrating OpenFeint, so it might have nothing to do with the Giraffe.jar modification...

    I attached the file for reference, but it's probably only compatible with the 4.0 release of the Android Unity plugin: View attachment $Giraffe.zip