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. DARK_ETERNAL

    DARK_ETERNAL

    Joined:
    May 9, 2012
    Posts:
    41
    Greetings, @rushil133

    Unfortunately, I'm still having issues with this as well. It seems that the Twitter API itself is retrieving a null message, thus the JSON parser fails. If I happen to find something about this, I'll gladly share it; that is, if we don't get a reply from Prime31 before me finding a workaround.
     
  2. DARK_ETERNAL

    DARK_ETERNAL

    Joined:
    May 9, 2012
    Posts:
    41
    @belal

    You've got to call first PurchaseProduct, then after purchasing it, call the ConsumeProduct. Take a look at the plugin documentation, for you have to call that in one of the response events. You should look at the Google IAB documentation as well, since it describes how goes the whole purchase flow. There, you will learn when is the product consumed.
     
  3. DARK_ETERNAL

    DARK_ETERNAL

    Joined:
    May 9, 2012
    Posts:
    41
  4. panor

    panor

    Joined:
    Dec 27, 2013
    Posts:
    9
    hi, i need to select a photo from android gallery, but when i click de button the app closes.
    this is how i call it:
    EtceteraAndroid.promptForPictureFromAlbum(0,0, "gallery photo");
    after a few seconds the screen gets black and force quit.
    also happen in the demo scene.
     
    Last edited: Feb 11, 2014
  5. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @panor, how about some data to work with such as logs, Android OS version, device model, etc.
     
  6. panor

    panor

    Joined:
    Dec 27, 2013
    Posts:
    9
    version android 4.3, devive model samsung S4, also we try on a tablet with android 4.2 and have same problem
     
  7. LukasO

    LukasO

    Joined:
    May 23, 2013
    Posts:
    115
    Hi Prime,

    I'm having an occasional issue with your Android IAB plugin. There seems to be an occasional case where when trying to buy unmanaged products, an error can return on certain devices indicating that the item has already been bought. It only seems to be on certain devices with certain accounts. Any ideas?

    Thanks
     
  8. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @lukas, I can't say I have ever heard of that occurring. If you are 100% certain the item has not been purchased when it occurs you will definitely want to open a bug report directly with Google so they can check their servers.
     
  9. sicklepickle

    sicklepickle

    Joined:
    Apr 8, 2012
    Posts:
    44
    Hi Prime31, I'm having an issue with AdMob ads randomly not showing up after the app has been restarted.
    Adb will even happily list "To get test ads on this device..." but not dump the raw JSON or get to "dexopt: --- END"
    (See 1st log)

    Sometimes after a close the app will launch to fullscreen black without ever getting as far as the splash - when this happens the ads almost always fail to launch after minimising and restarting. (See 2nd log)

    Letting this time out and restart once again sometimes returns the ad functionality.
    It's almost as if something's jamming up the JNI and failing to close gracefully.

    Essentially what we're seeing is intermittent ads, and the odd failure to launch.
    The behaviour is far less prevailent if you destroy banners before closing, but while in the locked out state, ads display happily from other apps (including AIR apps using the JNI)


    Notes:
    -Android
    -Unity 4
    -Happens with or without test ads enabled
    -Happens with test scene.
    -Events have been forwarded to dalvik VM via manifest
    -Using P31 StoreKit/GoogleIAB combo, Social Networking (FB/Twitter) Combo, Admob Combo.
    -Tried upgrading all of the P31 plugins
    -No other plugins in project
    -Latest version of prime31 tools.
    -Used a new manifest, everything seems in order.
    -Happens on Samsung and HTC devices (HTC One, HTC Desire, Galaxy Tab 2, Galaxy Tab 3, possibly more) (A huge percentage of devices)
    -Doesn't seem to happen with Sony devices
    -Double and triple checked manifest permissions.
    -Behaviour applies to both interstitial and banner ads
    -Same behaviour whether or not the adunitid is used only in init or when creating banners.
    -Loading screen and timers used to avoid calling loads of things on the same thread, in a short time.
    Ads not displaying from within the AdmobAndroid test scene (Init, Create Banner).

    Cheers,
    J


    Log from a failed advert:

    02-19 19:29:26.929: D/WML_SISO(4467): InitPasteboardJni
    02-19 19:29:26.929: D/WML_SISO(4467): InitPasteboardJni
    02-19 19:29:26.937: I/Ads(4467): To get test ads on this device, call adRequest.addTestDevice("8C51D52C10090DAC8D79346DE54E5EFF");
    02-19 19:29:26.976: D/WML_SISO(4467): InitPasteboardJni
    02-19 19:29:27.000: D/dalvikvm(4467): DexOpt: --- BEGIN 'ads-1528325054.jar' (bootstrap=0) ---
    02-19 19:29:28.062: W/PowerManagerService(188): Timer 0x7->0x3|0x15
    02-19 19:29:38.953: E/Watchdog(188): !@Sync 136

    <!-- Then ~5-10 seconds of wait ->

    02-19 19:29:59.992: E/AlarmManagerService(188): android_server_AlarmManagerService_set to type=3, 4317.725000000
    02-19 19:30:00.000: E/AlarmManagerService(188): android_server_AlarmManagerService_set to type=3, 4187.991000000
    02-19 19:30:00.000: V/AlarmManager(188): ClockReceiver onReceive() ACTION_TIME_TICK
    02-19 19:30:00.007: D/KeyguardUpdateMonitor(188): received broadcast android.intent.action.TIME_TICK
    02-19 19:30:00.007: D/KeyguardUpdateMonitor(188): handleTimeUpdate
    02-19 19:30:00.007: D/STATUSBAR-Clock(268): onReceive() - ACTION_TIME_TICK
    02-19 19:30:00.015: D/STATUSBAR-Clock(268): updateClock :19:30
    02-19 19:30:00.039: D/STATUSBAR-Clock(268): onReceive() - ACTION_TIME_TICK
    02-19 19:30:00.039: D/STATUSBAR-Clock(268): updateClock :19:30
    02-19 19:30:00.203: D/dalvikvm(188): GC_CONCURRENT freed 828K, 27% free 19067K/26055K, paused 4ms+14ms
    02-19 19:30:07.218: D/dalvikvm(4467): GC_CONCURRENT freed 454K, 7% free 8369K/8967K, paused 10ms+2ms
    02-19 19:30:07.218: D/webviewglue(4467): nativeDestroy view: 0x18f99c8
    02-19 19:30:08.953: E/Watchdog(188): !@Sync 137
    02-19 19:30:38.953: E/Watchdog(188): !@Sync 138

    As you'll notice there's no "DexOpt: --- END" and incremental Watchdog sync issues.




    Log from the blank screen startup:

    02-19 19:43:28.218: D/dalvikvm(414): GC_CONCURRENT freed 2006K, 35% free 18076K/27399K, paused 2ms+7ms
    02-19 19:43:28.343: D/ActivityManager(188): Trying to launch applicationName
    02-19 19:43:28.343: V/WindowManager(188): rotationForOrientationLw(orient=0, last=0); user=0 mLidOpen=-1 mDockMode=0 mHdmiPlugged=false mAccelerometerDefault=1 sensorRotation=-1

    02-19 19:43:28.351: E/JavaBinder(188): !!! FAILED BINDER TRANSACTION !!!
    02-19 19:43:28.351: D/KeyguardViewMediator(188): setHidden false
    02-19 19:43:28.351: W/ActivityManager(188): Exception when starting activity com.s****e.t*******s/com.prime31.UnityPlayerProxyActivity
    02-19 19:43:28.351: W/ActivityManager(188): android.os.TransactionTooLargeException
    02-19 19:43:28.351: W/ActivityManager(188): at android.os.BinderProxy.transact(Native Method)
    02-19 19:43:28.351: W/ActivityManager(188): at android.app.ApplicationThreadProxy.scheduleLaunchActivity(ApplicationThreadNative.java:669)
    02-19 19:43:28.351: W/ActivityManager(188): at com.android.server.am.ActivityStack.realStartActivityLocked(ActivityStack.java:638)
    02-19 19:43:28.351: W/ActivityManager(188): at com.android.server.am.ActivityStack.startSpecificActivityLocked(ActivityStack.java:771)
    02-19 19:43:28.351: W/ActivityManager(188): at com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:1667)
    02-19 19:43:28.351: W/ActivityManager(188): at com.android.server.am.ActivityStack.completePauseLocked(ActivityStack.java:1089)
    02-19 19:43:28.351: W/ActivityManager(188): at com.android.server.am.ActivityStack.activityPaused(ActivityStack.java:1001)
    02-19 19:43:28.351: W/ActivityManager(188): at com.android.server.am.ActivityManagerService.activityPaused(ActivityManagerService.java:4229)
    02-19 19:43:28.351: W/ActivityManager(188): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:387)
    02-19 19:43:28.351: W/ActivityManager(188): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1607)
    02-19 19:43:28.351: W/ActivityManager(188): at android.os.Binder.execTransact(Binder.java:338)
    02-19 19:43:28.351: W/ActivityManager(188): at dalvik.system.NativeStart.run(Native Method)
    02-19 19:43:28.351: W/ActivityManager(188): Force removing ActivityRecord{422ebbf8 com.s****e.t*******s/com.prime31.UnityPlayerProxyActivity}: app died, no saved state
    02-19 19:43:28.367: D/OpenGLRenderer(414): Flushing caches (mode 1)
    02-19 19:43:28.367: I/ActivityManager(188): Start proc app.processName for activity hostingNameStr: pid=4558 uid=10145 gids={3003}
    02-19 19:43:29.187: W/ActivityManager(188): Activity destroy timeout for ActivityRecord{41954cf0 com.s*****e.t*******s/com.prime31.UnityPlayerNativeActivity}
    02-19 19:43:29.289: E/lights(188): write_int failed to open /sys/class/sec/sec_touchkey/brightness
    02-19 19:43:29.289: W/PowerManagerService(188): Timer 0x7->0x3|0x0
    02-19 19:43:29.289: I/PowerManagerService(188): Ulight 7->3|0
    02-19 19:43:29.289: D/PowerManagerService(188): setLightBrightness : mButtonLight : 0
    02-19 19:43:30.953: I/power(188): *** release_dvfs_lock : lockType : 1
    02-19 19:43:30.953: D/PowerManagerService(188): releaseDVFSLockLocked : all DVFS_MIN_LIMIT are released
    02-19 19:43:30.953: W/ActivityManager(188): mDVFSLock.release()
    02-19 19:43:31.156: D/AudioHardwareTinyALSA(99): Entering AudioStreamOutALSA standby mode
    02-19 19:43:31.156: I/AudioHardwareTinyALSA(99): Close mHandle:194dd90
    02-19 19:43:33.351: D/KeyguardViewMediator(188): setHidden false
    02-19 19:43:33.351: D/OpenGLRenderer(414): Flushing caches (mode 0)
    02-19 19:43:33.351: D/KeyguardViewMediator(188): setHidden false
    02-19 19:43:33.351: D/DEFERED_APP_VISIBILITY(188): tweaking closing app
    02-19 19:43:33.351: D/DEFERED_APP_VISIBILITY(188): tweaking closing app
    02-19 19:43:33.351: D/DEFERED_APP_VISIBILITY(188): tweaking closing app
    02-19 19:43:33.351: V/WindowManager(188): rotationForOrientationLw(orient=-1, last=0); user=0 mLidOpen=-1 mDockMode=0 mHdmiPlugged=false mAccelerometerDefault=1 sensorRotation=-1
    02-19 19:43:33.367: D/KeyguardViewMediator(188): setHidden false
    02-19 19:43:33.367: D/KeyguardViewMediator(188): setHidden false
    02-19 19:43:33.367: D/KeyguardViewMediator(188): setHidden false
    02-19 19:43:33.382: D/KeyguardViewMediator(188): setHidden false
    02-19 19:43:33.398: D/KeyguardViewMediator(188): setHidden false
    02-19 19:43:33.414: D/KeyguardViewMediator(188): setHidden false
    02-19 19:43:33.429: D/KeyguardViewMediator(188): setHidden false
    ...
    02-19 19:43:37.992: W/ActivityManager(188): Launch timeout has expired, giving up wake lock!
    02-19 19:43:38.968: E/Watchdog(188): !@Sync 164
    02-19 19:43:59.992: E/AlarmManagerService(188): android_server_AlarmManagerService_set to type=3, 5517.732000000
    02-19 19:44:00.000: E/AlarmManagerService(188): android_server_AlarmManagerService_set to type=3, 5027.990000000


    Followed by more incremental !@Sync messages

    Edit:
    Disabled smilies :(
     
  10. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @sickle, the odd bit I see in that log is the TransactionTooLargeException. That exception is thrown when too much data is passed from one app to another. I'm not sure what you are sending into the app there but it would be a good idea to reduce its size to under the Android limit (90k if my memory serves me). As for a possible workaround, I would try destroying the banner when your app is backgrounder then recreating it again at app launch. That might do the trick.
     
  11. sicklepickle

    sicklepickle

    Joined:
    Apr 8, 2012
    Posts:
    44
    Cheers for the reply P31, but I'm still having issues.

    Changes:
    -Removed all other P31 plugins
    -Tried with AdMob SDK 6.4.1
    -Tried destroying all ads when not in use and before loading more.
    -Removed OnApplicationFocus handlers and that sort of thing in an attempt to reduce chatter.
    -Cleanly exiting the app every single time.

    The TransactionTooLargeException only happens when you attempt to start the app after ads have already failed in the previous session - even after a clean exit. So after 3-4 clean exits, the ads just fail to display (they're never downloaded). Exit the app, and it fails to start with a blank screen and eventual timeout.
    (It will restart generally if you just hit the icon again).

    Other than that I'm not sending anything into the app and nor is it downloading anything.

    Any ideas?

    Thanks,
    J

    Edit:
    Just tried the same sort of tests with this little plugin:
    http://forum.unity3d.com/threads/167731-Free-Admob-plugin-simple-prefab
    No such issues with it. (Though it's very limited)
    Do you perhaps have older versions of the plugin lying around that I might be able to test?
    I'd rather keep all the plugins P31 if possible, y'know...
     
    Last edited: Feb 20, 2014
  12. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @sickle, I can't seem to reproduce what you are seeing with the demo scene. What are you seeing as output for the failedToReceiveAdEvent and receivedAdEvent? One of those will fire anytime AdMob goes to load an ad.
     
  13. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    I am not sure what the extra jar file is that AdMobs SDK is attempting to load. What happens inside their SDK is all closed source so there is no way to determine the details of how it works. I can say for sure that it is not part of the distributable SDK. There definitely doesn't appear to be any JNI errors in there. JNI errors are very noisy in the logs. It is possible that an odd bug found its way into the latest AdMob SDK. It seems no load or fail event is occurring in that last log. I'll see if I can track down a Tab 2 tomorrow and repro what you are seeing. I've only got 5 or 6 devices with me at the moment and none exhibit the issue.
     
    Last edited: Feb 20, 2014
  14. sicklepickle

    sicklepickle

    Joined:
    Apr 8, 2012
    Posts:
    44
    Whatever it was, the downgrade seems to have helped for now.
    Thanks for your time though, really appreciate it!
     
  15. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    340
    Hi, Just to let you know i'm seeing the same random crash with the latest Prime31 Admob plugin on Samsung Galaxy S2(4.0.3).
    It seems to work well with my others test devices HTC Nexus One(2.3.6), XPeriaPlay(2.3.4), GalaxyTab2 GTP31110(4.1.1).
    I'll just downgrade the jar file as sicklebrick pointed out.
     
  16. Dzxyan

    Dzxyan

    Joined:
    Sep 23, 2013
    Posts:
    167
    Hi Prime31,
    I have a question for you In Apps Billing,
    GoogleIAB.purchaseProduct("MyPurchaseId","Description"),
    If myPurchase Id type is Unmanaged Product,
    how many time i can buy for that product?
    i try rebuy it again,
    but got purchaseFailedEvent: Unable to buy item (respone: 7:Item Already Owned),
    what should i do for that?
    If my purchase success,
    i wanna add a item in my apps,
    what should i trace from?
    for a sucess purchase?
     
  17. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dzxyan, Google killed the concept of unmanaged products over a year ago. I would suggest you give their overview a quick read so that you understand the basic concepts of their billing system.
     
  18. Dzxyan

    Dzxyan

    Joined:
    Sep 23, 2013
    Posts:
    167
    I see the overview that you provide just now,
    So as a example after purchase the item, we should consume it?
    I wanna know where i can trace my purchase success?
    which script prime31 have provide for that?
     
  19. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dzxyan, the plugin provides many events to notify you of every message that the Play Store sends. The list is available right on our documentation page. The full event list is right after the text: "GoogleIABManager fires the following events".
     
  20. Dzxyan

    Dzxyan

    Joined:
    Sep 23, 2013
    Posts:
    167
    as a example
    I use
    GoogleIAB.purchaseProduct("test1");
    GoogleIAB.purchaseProduct("test2");
    from the
    public void purchaseSucceeded( string json )
    {
    purchaseSucceededEvent.fire( new GooglePurchase( json.dictionaryFromJson() ) );
    }

    how can i know which event that i success fire?
     
  21. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dzxyan, judging from your response I am guessing you do not know how to use .NET events. We have video tutorials on the subject available on YouTube, there are quite literally thousands of tutorials available by searching Google for ".net event tutorial" and the included *EventListener script that comes with all of our plugins has examples of listening to every event the plugin offers.
     
  22. Byrondinho

    Byrondinho

    Joined:
    Jul 26, 2011
    Posts:
    19
    Hi @prime31,
    I have PlayGameServices on my project and when i launch my app he auto ask me for login on the Splash screen, i don't want this ask at the start, i am not doing nothing for this action.
     
  23. ninjanosui

    ninjanosui

    Joined:
    Jul 12, 2013
    Posts:
    54
    Hi @prime31,

    Is it possible and what do i need for(Android Vuforia combination) :
    -Sharing 1 attachment by mail:
    - Composing an email with text only.
    -Sharing a screenshot / text using Android share dialog

    Cheers,
    Steven
     
  24. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @ninjanosui, the Etcetera Plugin can send emails with and without an attachment.
     
  25. ninjanosui

    ninjanosui

    Joined:
    Jul 12, 2013
    Posts:
    54
    @prime31 what about the share dialog?
     
  26. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @ninja, our Social Networking Plugin supports the Facebook share dialog but we do not support any others.
     
  27. ninjanosui

    ninjanosui

    Joined:
    Jul 12, 2013
    Posts:
    54
    @prime31 you sure?:p
    Intent screenshotIntent = new Intent();
    screenshotIntent.setType("image/png");
    screenshotIntent.setAction(Intent.ACTION_SEND);
    screenshotIntent.putExtra(android.content.Intent.EXTRA_EMAIL, to);
    screenshotIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
    screenshotIntent.putExtra(android.content.Intent.EXTRA_TEXT, message);
    screenshotIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(path));
    startActivity(Intent.createChooser(screenshotIntent, "Send mail..."));

    That should be all right?
     
  28. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @ninjanosui, we do not offer a plugin that uses the Android share Intent. You can of course write your own. As previously mentioned our Etcetera Plugin does in fact offer access to show the email composer.
     
  29. Pranav-Paharia

    Pranav-Paharia

    Joined:
    Feb 13, 2013
    Posts:
    6
    Hey! I'm trying to implement in app purchase by using your android unity plugin. I made the build of your test scene and running it on nexus 7 device. I'm getting the following error. Please help me.
    $problem.png

    03-04 21:43:04.455: I/Unity(4095): AndroidJavaException: java.lang.ClassNotFoundException: com.prime31.GoogleIABPlugin
    03-04 21:43:04.455: I/Unity(4095): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown>:0
    03-04 21:43:04.455: I/Unity(4095): at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unknown>:0
    03-04 21:43:04.455: I/Unity(4095): at UnityEngine.AndroidJavaObject._CallStatic[AndroidJavaObject] (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0
    03-04 21:43:04.455: I/Unity(4095): at UnityEngine.AndroidJavaObject.CallStatic[AndroidJavaObject] (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0
    03-04 21:43:04.455: I/Unity(4095): at UnityEngine.AndroidJavaObject.FindClass (System.String name) [0x00000] in <filename unknown>:0
    03-04 21:43:04.455: I/Unity(4095): at UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) [0x00000] in <filename unknown>:0
    03-04 21:43:04.455: I/Unity(4095): at UnityEngine.AndroidJavaClass..ctor (System.String className) [0x00000] in <filename unknown>:0
    03-04 21:43:04.455: I/Unity(4095): at GoogleIAB..cctor () [0x0000d] in /Users/click85/tempIAP/Assets/InAppBillingAndroid/Goo
    03-04 21:43:05.065: I/ActivityManager(527): Waited long enough for: ServiceRecord{42bdaae8 u0 com.google.android.talk/com.google.android.apps.babel.realtimechat.RequestWriter}
    03-04 21:43:06.215: D/dalvikvm(1273): GC_CONCURRENT freed 400K, 6% free 8638K/9176K, paused 2ms+3ms, total 28ms
    03-04 21:43:06.315: I/GCM(1423): GCM message com.google.android.talk 0:1393936985847357%5a539273f9fd7ecd
    03-04 21:43:06.345: E/Babel(4336): gcm push received for invalid account: Redacted-21
    03-04 21:43:06.365: D/dalvikvm(1423): GC_CONCURRENT freed 354K, 15% free 8646K/10152K, paused 3ms+5ms, total 47ms
    03-04 21:43:06.445: D/dalvikvm(4336): GC_CONCURRENT freed 391K, 7% free 8247K/8804K, paused 2ms+3ms, total 35ms



    03-04 21:43:18.295: I/Unity(4095): AndroidJavaException: java.lang.ClassNotFoundException: com.prime31.GoogleIABPlugin
    03-04 21:43:18.295: I/Unity(4095): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown>:0
    03-04 21:43:18.295: I/Unity(4095): at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unknown>:0
    03-04 21:43:18.295: I/Unity(4095): at UnityEngine.AndroidJavaObject._CallStatic[AndroidJavaObject] (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0
    03-04 21:43:18.295: I/Unity(4095): at UnityEngine.AndroidJavaObject.CallStatic[AndroidJavaObject] (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0
    03-04 21:43:18.295: I/Unity(4095): at UnityEngine.AndroidJavaObject.FindClass (System.String name) [0x00000] in <filename unknown>:0
    03-04 21:43:18.295: I/Unity(4095): at UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) [0x00000] in <filename unknown>:0
    03-04 21:43:18.295: I/Unity(4095): at UnityEngine.AndroidJavaClass..ctor (System.String className) [0x00000] in <filename unknown>:0
    03-04 21:43:18.295: I/Unity(4095): at GoogleIAB..cctor () [0x0000d] in /Users/click85/tempIAP/Assets/InAppBillingAndroid/Goo
     
    Last edited: Mar 4, 2014
  30. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Judging from the NoSuchMethodError for this method I am guessing that your jar file is either not getting compiled into your final project or corrupt in some way. Delete the jar files and reimport a fresh copy of the plugin. If you use version control of any kind make sure it does not mess with the file permissions or else Unity won't be able to include it in your apk.
     
  31. Pranav-Paharia

    Pranav-Paharia

    Joined:
    Feb 13, 2013
    Posts:
    6
    Okay. I'm trying to reimport everything. Thanks for the reply !
     
  32. Pranav-Paharia

    Pranav-Paharia

    Joined:
    Feb 13, 2013
    Posts:
    6
    Hey ! I've imported the jar file and rebuild the plugin but still the same error is coming. To help you to identify the problem more clearly let me explain you whatever I grasped from the issue.
    --> I'm using your test scene to understand the working of your plugin. I used build and run option to execute your IABTestScene.
    --> The execution was successful. I used terminal in mac to get the log of the apk. When I pressed the first button "Initialize IAB" I get the message of
    03-04 21:43:18.295: I/Unity(4095): AndroidJavaException: java.lang.ClassNotFoundException: com.prime31.GoogleIABPlugin
    03-04 21:43:18.295: I/Unity(4095): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown>:0
    03-04 21:43:18.295: I/Unity(4095): at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unknown>:0

    As you have told me to reimport the plugin files. I have done it accordingly. But the error was still coming. Then I dug into the IABUIManager.cs file and I found on pressing first button GoogleIAB.init() was called. Going to GoogleIAB.cs file I found these lines of code interesting in the constructor of the file

    // find the plugin instance
    using( var pluginClass = new AndroidJavaClass( "com.prime31.GoogleIABPlugin" ) )
    _plugin = pluginClass.CallStatic<AndroidJavaObject>( "instance" );

    I think the apk is not able to access the concern java library, which is in IABPlugin.jar. I've reimported this file but the error is still there. Hence the test scene you have provided is not functioning properly. I'm confused here about how to proceed further. Please help me Prime 31.
     
  33. Pranav-Paharia

    Pranav-Paharia

    Joined:
    Feb 13, 2013
    Posts:
    6
    Hello Prime31,
    Finally after copying files carefully in the project file structure I got rid of this problem. But there is new problem coming along that is when I click on Initialize IAB I get these messages in log.

    03-05 15:29:58.616: E/Prime31-IABH(13563): In-app billing error: Illegal state for operation (queryInventory): IAB helper is not set up.

    03-05 15:36:32.206: W/Prime31(13637): You have not queried your inventory yet so the plugin does not have the required information to protect you from coding errors.

    03-05 15:36:32.206: E/AndroidRuntime(13637): FATAL EXCEPTION: main
    03-05 15:36:32.206: E/AndroidRuntime(13637): java.lang.Error: FATAL EXCEPTION [main]
    03-05 15:36:32.206: E/AndroidRuntime(13637): Unity version : 4.3.0f4
    03-05 15:36:32.206: E/AndroidRuntime(13637): Device model : samsung GT-I9103
    03-05 15:36:32.206: E/AndroidRuntime(13637): Device fingerprint: samsung/GT-I9103/GT-I9103:4.0.4/IMM76D/XWLP2:user/release-keys
    03-05 15:36:32.206: E/AndroidRuntime(13637): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.clicklabs.copter/com.prime31.GoogleIABProxyActivity}; have you declared this activity in your AndroidManifest.xml?
    03-05 15:36:32.206: E/AndroidRuntime(13637): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1511)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1387)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at android.app.Activity.startActivityForResult(Activity.java:3195)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at android.app.Activity.startActivity(Activity.java:3302)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at com.prime31.GoogleIABPlugin$3.run(GoogleIABPlugin.java:150)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at android.os.Handler.handleCallback(Handler.java:605)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at android.os.Handler.dispatchMessage(Handler.java:92)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at android.os.Looper.loop(Looper.java:137)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at android.app.ActivityThread.main(ActivityThread.java:4517)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at java.lang.reflect.Method.invokeNative(Native Method)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at java.lang.reflect.Method.invoke(Method.java:511)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:985)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:752)
    03-05 15:36:32.206: E/AndroidRuntime(13637): at dalvik.system.NativeStart.main(Native Method)


    I'm sure I'm missing to change some settings. But where ? Please help me.
     
  34. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @pranav, it appears that you have something off with your Android SDK setup or perhaps a file permission error with the jar files. Unity incudes the jar files into its apk at build time. All classes from the jars should then be available. Searching Stack Overflow for causes for a jar files class not being available 2 things came up: file permissions on the jar and Using Java 1.7. Java 1.6 solved the issue for many folks.
     
  35. itachi4365

    itachi4365

    Joined:
    Sep 24, 2012
    Posts:
    40
    Can anyone share on how if users logs in once with appropriate permissions he won't have to log in again.
     
  36. Konjo12

    Konjo12

    Joined:
    Feb 7, 2013
    Posts:
    5
    Prime31 Android Social networking plugin is not working. Previous version of plugin used to work, but when I have updated the plugin I cannot create a build getting following error:
    Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
    C:\Program Files (x86)\Java\jdk1.6.0_45\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "D:/Program Files (x86)/Unity4/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs;

    Cannot pass this section:
    processing archive C:\Users\PC004\Desktop\PuzzleSoccer\05_dev\Temp\StagingArea\android-libraries\Facebook-Plugin-Library\libs\.\FacebookPlugin.jar...
    ignored resource META-INF/MANIFEST.MF
    processing com/prime31/FacebookPlugin$1.class...
    processing com/prime31/FacebookPlugin$10.class...
    processing com/prime31/FacebookPlugin$2.class...
    processing com/prime31/FacebookPlugin$3.class...
    processing com/prime31/FacebookPlugin$4.class...
    processing com/prime31/FacebookPlugin$5.class...
    processing com/prime31/FacebookPlugin$6.class...
    processing com/prime31/FacebookPlugin$7.class...
    processing com/prime31/FacebookPlugin$8$1.class...
    processing com/prime31/FacebookPlugin$8.class...
    processing com/prime31/FacebookPlugin$9.class...
    processing com/prime31/FacebookPlugin.class...
    processing com/prime31/FacebookPluginBase$1.class...
    processing com/prime31/FacebookPluginBase.class...

    Please fix the plugin or advise.
     
  37. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @konjo, from log it would appear that you have more than one of the android services jar files. Just remove the duplicate and ensure only one exists to clear up the build issue.
     
    Last edited: Mar 10, 2014
  38. Konjo12

    Konjo12

    Joined:
    Feb 7, 2013
    Posts:
    5
    @prime31 I'm removing and adding it, and I'm getting this error with new plugin, but when I remove everything and add your older plugin it works correctly.
     
  39. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @konjo, I can't reproduce and there have been no other reports so what is happenning is exclusive to something in your project. Please email your full project to questions (at) prime31.com so that I can look at in detail to see what the issue is.
     
  40. StevenMCH

    StevenMCH

    Joined:
    Feb 15, 2014
    Posts:
    16
    Prime31, just wondering if I can implement Facebook leaderboard with your plugin, and if there is a tutorial for implementing it. I've been searching everywhere. ..
     
  41. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @steven, on mobile games, the Facebook API is limited to posting and retrieving scores. There are already wrapper methods for both operations and examples in the demo scene included with the plugin.
     
  42. Plow-Digital

    Plow-Digital

    Joined:
    Mar 5, 2014
    Posts:
    6
    PDF Plugin:

    We need an Android plugin written for Unity that will open a pdf viewer. It will require a function call that can be made from Unity and has a parameter to pass in a filepath. The viewer must be able to load online filepaths, as well as local filepaths. I believe the deliverable format will be a .jar file, with possibly a Post Processing script for Unity that will make the .jar file accessible from Unity.

    We need an iOS plugin written for Unity that will open a pdf viewer. It will require a function call that can be made from Unity and has a parameter to pass in a filepath. The viewer must be able to load online filepaths, as well as local filepaths. I believe the deliverable format will be XCode files and assets, with an accompanying Post Processing script for Unity that will place the assets into the generated XCode project. -Greg, Plow Digital
     
  43. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @plow, you're best bet is to post in the work for hire forums. We are not available for contract work at this time.
     
  44. SyncInteractive

    SyncInteractive

    Joined:
    Mar 17, 2014
    Posts:
    12
    Hi Prime31

    E/Prime31 (31526): Exception running command on UI thread: String resource ID #0x7f090393

    I keep getting this error when i am trying to call FacebookAndroid.showDialog( "apprequests", parameters );
     
  45. rejwan1

    rejwan1

    Joined:
    Jul 3, 2012
    Posts:
    40
    @Prime31

    We've started porting our game to Android (we're using plenty of your plugins in our project), and we've noticed that in the Android manifest file you override Unity's activity with your own:
    Code (csharp):
    1. <activity android:name="com.prime31.UnityPlayerActivity" android:screenOrientation="sensorPortrait" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    2. </activity>
    Now we have a plugin we use that opens local notifications, they work fine, but we had to adjust it to use the prime31 activity:
    Code (csharp):
    1.  
    2. import com.prime31.UnityPlayerActivity;
    3.  
    4. PendingIntent.getActivity(context, id, new Intent(context,UnityPlayerActivity.class), 0);
    The notifications show up fine, and when clicked the game is opened - however, if the game was already running, all of our sounds will start playing in a loop and the game goes crazy. If opening the game from a notification when the game is closed, it works perfectly well....

    Any ideas?

    Thanks!
    Ron
     
  46. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @rejwan, that sure is an odd one. Our Activity is a sublcass of Unitys and only exists to forward lifecycle events where needed. It doesn't actually do anything with regard to the actual UnityPlayer. You may want to shoot a bug report over to the Unity crew so they can give it a look.
     
  47. dai_yx

    dai_yx

    Joined:
    Mar 25, 2014
    Posts:
    1
    Hi Prime31
    I am developing a plugin that allows showing a new activity on top of the existing unity activity. The plugin activity is not full screen, When I run the activity code in a native android app, all is fine, I can see the underlying activity. But when I run it inside a unity app (wrapped by a plugin), the new activity popup UI shows up with black background - the underlying unity scene/activity does not show. any ideas why I don't see the background unity scene?
     
  48. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    169
    Hello. We've got troubles with your Android FB plugin.

    When we call any FB activity, login window opens. When I input my data and press "Sumbit", I get the following error:

    "App Not Setup: The developers of this app have not set up this app properly for Facebook Login."

    Google suggests to turn sandbox off. But it is off already. More to say - our application is released for more that a year and FB was working OK, but last time we noticed that our users begin to have this error loggin in to FB.

    Do you know what could the reason of this error be?


    And the second question: we've tried to update Social plugin for android to the latest version, but there's something strange.

    I've noticed that the manifest generated by the latest version was changed a lot. So the strange thing is that your documentation http://prime31.com/docs#androidSocial suggests to set "class name" in FB settings to "com.prime31.UnityPlayerProxyActivity", but there's nothing like "com.prime31.UnityPlayerProxyActivity" in the manifest any more.

    Manifest looks like:

    Code (csharp):
    1.  
    2.  
    3.     <application
    4.         android:icon="@drawable/app_icon"
    5.         android:label="@string/app_name"
    6.         android:debuggable="true">
    7.         <activity android:name="com.prime31.UnityPlayerNativeActivity" android:screenOrientation="sensorLandscape"
    8.                   android:launchMode="singleTask"
    9.                   android:label="@string/app_name"
    10.                   android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    11.             <intent-filter>
    12.                 <action android:name="android.intent.action.MAIN" />
    13.                 <category android:name="android.intent.category.LAUNCHER" />
    14.             </intent-filter>
    15.             <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    16.         </activity>
    17.    
    18.  
    19.             <activity android:name="com.prime31.GoogleIABProxyActivity" android:configChanges="orientation"></activity>
    20.             <activity configChanges="orientation|screenLayout|screenSize" android:name="com.facebook.LoginActivity"></activity>
    21.             <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 275603189242237"/>
    22.  
    23.         <meta-data android:name="com.prime31.FacebookPlugin" android:value="UnityPlayerActivityProxy"/>
    24. </application>
    25.  
    26.  
    27.  
    PS: The strangest thing is that changing class name under FB settings doesn't change anything. I've got this error each time.
     
    Last edited: Mar 27, 2014
  49. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @soul, the manifest looks fine. You would know instantly if it wasn't correct since it would result in a crash. As for your other error, all I can do is reiterate exactly what Facebook is telling you: your app is not properly setup. Review and triple check all of your Facebook app setup. Facebook has found something in the setup it does not like.
     
    Last edited: Mar 27, 2014
  50. soulburner

    soulburner

    Joined:
    Mar 25, 2012
    Posts:
    169
    Sorry for bothering you. After 3 days of exploring we've found an error. Our FB App ID was wrong. Sorry again.