Search Unity

  1. How can our website serve you better? Give us your feedback. Take our survey and let us know.
    Dismiss Notice

Admob Unity Package that work with Unity 3.2, 3.3, 3.4 3.5

Discussion in 'Android' started by MicroEyes_old, Mar 16, 2012.

?

Are you Satisfy with this tutorial?

  1. Yes

    71.4%
  2. No

    9.5%
  3. Not Completely

    19.0%
  1. jason0202

    jason0202

    Joined:
    Feb 15, 2012
    Posts:
    13

    Hi MicroEyes,

    I googled and found 1 good example of standalone admob plugin implementation. Maybe this may help you. :)

    Link: http://www.e-nature.ch/tech/?p=170
     
  2. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Thank you so much for giving your time, But as i already mentioned that, i m able to call my first static function but not the next one.

    i hav seen a lot of new things in tutorial, so i'll give it a shot.. back to you..
     
  3. manituan

    manituan

    Joined:
    Apr 26, 2012
    Posts:
    2
    Thank you so much! This was very useful.

    Just a note, there is a new version of admob and android sdk.

    Regards!
     
  4. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Thankx for the info man.
     
  5. Somedays

    Somedays

    Joined:
    Jan 2, 2012
    Posts:
    214
    Hey MicroEyes, I've decided to try out your new tutorial! Everything was going well until this part of your tutorial:

    2. Open Eclipse -> File menu -> Import -> In General -> Existing Projects into workspace. Then in "Select Root Directory" section click browse and select folder "Android" in "%YOUR_UNITY_PROJECT%/Assets/Plugin". This will open Project in eclipse. Now its time to make some changes.

    I imported my project but theres an error saying Unable to resolve target 'android-14' and this is a pic of what I'm getting



    Any idea of what I could be doing wrong?
     
  6. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hey SomeDays,
    The problem is, the project i had uploaded have unity GoogleAdMobAdsSdk-4.3.1.jar class path of my system, and probably you hav installed unity at other location..
    Please follow Step 5 to resolve this issue.. Good Luck .. :)
     
  7. Somedays

    Somedays

    Joined:
    Jan 2, 2012
    Posts:
    214
    MicroEyes, you are a god. Thank you for all of your help and for providing an awesome tutorial!!!

    ADS WORK!
     
  8. waltergs

    waltergs

    Joined:
    Mar 21, 2011
    Posts:
    12
    I have this error:

    Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead.



    and this



    this too

     
    Last edited: Jun 15, 2012
  9. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hey Waltergs,
    Please follow a note after Step 2 in implementation. If still getting error please let me know..Good Luck..
     
  10. waltergs

    waltergs

    Joined:
    Mar 21, 2011
    Posts:
    12
    I did it, but i'm having the same problem.





    Your example project (Admob) deosn't have a build .jar in the :

    "%YOUR_UNITY_PROJECT%/Assets/Plugin/Android/bin"

    I doubt that this work
     
    Last edited: Jun 15, 2012
  11. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Can you specify JDK, unity, Android SDK version you have in your system? so that i can test.
    One more thing, have u tried to execute my project.?
     
  12. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    And about <uses-permission> Error in AndroidManifest.xml, u have missed a quote under the application tag, maybe that is causing this error. Please post your AndroidManifest.xml here.
     
  13. waltergs

    waltergs

    Joined:
    Mar 21, 2011
    Posts:
    12
    Yes, but your project is empty in Plugins/android/bin

    i have all android packages.

    In this project Android 4.0

    JDK v. 7 update 2 ( 1.7.0_02-b13 )

    My Android Manifest
    Code (csharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    3.     package="com.Thraxx.Aliendominator"
    4.     android:versionCode="1"
    5.     android:versionName="1.0"
    6.     android:installLocation="preferExternal"
    7.     >
    8.  
    9.     <uses-sdk android:minSdkVersion="8" />
    10.  
    11.     <application
    12.         android:icon="@drawable/ic_launcher"
    13.         android:label="@string/app_name" >
    14.         <activity
    15.             android:label="@string/app_name"
    16.             android:name=".AdmobActivity" >
    17.             <intent-filter >
    18.                 <action android:name="android.intent.action.MAIN" />
    19.  
    20.                 <category android:name="android.intent.category.LAUNCHER" />
    21.             </intent-filter>
    22.         </activity>
    23.         <activity android:name="com.google.ads.AdActivity"
    24.              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" >            
    25.         </activity>
    26.     </application>
    27.     <uses-permission android:name="android.permission.INTERNET"/>
    28.     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    29.     <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
    30.     <uses-permission android:name="android.permission.READ_PHONE_STATE" />              <!-- to get Android Device ID -->
    31. </manifest>
    Now i have this error :(

     
    Last edited: Jun 16, 2012
  14. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hey waltergs,

    AnimationListener AdListener are interfaces. Make sure you have aleady implemented AdListener AnimationListener.

    That means that when you put it in your code, you have to implement all the methods. There are three methods for Animation Listener five methods for AdListener.

    onAnimationStart(Animation a)
    onAnimationEnd(Animation a)
    onAnimationRepeat(Animation a)
    You have to implement the others, even if you put nothing in them.

    Here would be your revised code:
    @Override
    public void onAnimationEnd(Animation animation) {
    }
    @Override
    public void onAnimationStart(Animation a) { }

    @Override
    public void onAnimationRepeat(Animation a) {
    }

    @Override
    public void onDismissScreen(Ad arg0) {
    // TODO Auto-generated method stub
    }

    @Override
    public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
    // TODO Auto-generated method stub
    }

    @Override
    public void onLeaveApplication(Ad arg0) {
    // TODO Auto-generated method stub
    }

    @Override
    public void onPresentScreen(Ad arg0) {
    // TODO Auto-generated method stub
    }

    @Override
    public void onReceiveAd(Ad arg0) {
    // TODO Auto-generated method stub
    }


    Errors you mentioned above will be solved by a NOTE specified in Step 5 (In Implementation Section)
    If You get some errors like "The method ?????????? must override a superclass method", Then do this.
    Right Click on Project, Goto Properties -> Select Java Compilor and select Compiler Compliance Level to 1.6. Then you'll get a dialog box, click Yes on it.
    Actually the problem is: Eclipse is defaulting to Java 1.5 and you have classes implementing interface methods (which in Java 1.6 can be annotated with @Override, but in Java 1.5 can only be applied to methods overriding a superclass method).

    Please Clean your project from Project Menu in Eclipse.


    I hope this helped! Good Luck.
     
  15. vimsilva

    vimsilva

    Joined:
    Jun 29, 2012
    Posts:
    2
    I retraced step 5 but has the same problem. Help me.


    full image:http://goo.gl/cjyGt
     

    Attached Files:

    Last edited: Jun 29, 2012
  16. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hi vimsilva,
    You haven't added Android SDK with your project, bcoz Referenced Libraries Android Dependencies are there but where is Android SDK. (See Attachment Pic)

    To add Android SDK to your project Right CLick on your project in Project Explorer -> Properties -> Select Android from tree.

    On right hand, you will see a list Android SDKs, if not Open Window Menu -> Android SDK Manager. Install them goto Project Properties again select appropriate SDK version(recommending 15)..

    Hope this will help you..
    Thankx.

    $ProjectExplorer.PNG
     
  17. vimsilva

    vimsilva

    Joined:
    Jun 29, 2012
    Posts:
    2
    Thanks for your help. Now I'm with another problem. When I press a button (Enable, disable ... anyone.) The app crashes.

    At logcat appears:

    : I / Unity (5906): (Filename:. / Runtime / ExportGenerated / AndroidManaged / UnityEngineDebug.cpp Line: 43)
    : E / dalvikvm (5906): JNI ERROR (bug app) accessed stale reference 0x2b90000d site (index 3 in a table of size 1)
    : E / dalvikvm (5906): Aborting VM
    : A / libc (5906): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code = 1)

    Can you help me?
     
  18. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hi Vimsilva, according to this log, you r missing to change your package name either in Java Code or in Unity. On both sides, Package name must be same. In Unity, you'll find package as Bundle Identifier in Player Settings. And above log is the complete log. Please provide me the whole log.
     
  19. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    Hello MicroEyes,
    I been following this thread and successfully getting the plug-in into the Unity 3.5x Editor (lastest). I changed your script so the Start function looks like this:
    void Start () {
    Debug.Log("Unity Calling Start");
    AdvertisementManager.Instantiate("whateverMyId", AdvertisementManager.AdvSize.DEVICE_WILL_DECIDE,
    AdvertisementManager.AdvOrientation.HORIZONTAL, AdvertisementManager.Position.BOTTOM,
    AdvertisementManager.Position.CENTER_HORIZONTAL, false, AdvertisementManager.AnimationInType.NO_ANIMATION,
    AdvertisementManager.AnimationOutType.NO_ANIMATION);
    AdvertisementManager.EnableAds();
    Debug.Log("Unity End Calling Start");
    AdvertisementManager.ShowAds();
    Debug.Log("Shown Ads");
    AdvertisementManager.RePositionAds(AdvertisementManager.Position.TOP, AdvertisementManager.Position.CENTER_HORIZONTAL);
    Debug.Log("Repo Ads");
    }

    Then I attach this script to an object and fired up my app in my test phone (HTC Inspire). Nothing shows up. The AdmodActivity class was invoked without any problem tho. I did a log trace where I found the followings:
    ...............
    07-10 15:50:10.301 I/Unity (21048): UnityEngine.Debug:Log(Object)
    07-10 15:50:10.301 I/Unity (21048): AdmobPluginCall:Start() (at C:\Documents and Settings\tumix\My Documents\MushAttacks\Assets\Scripts\Ads\AdmobPluginCall.cs:50)
    07-10 15:50:10.301 D/Database(21048): dbopen(): path = /data/data/com.my2ndcom.my3rdcom/databases/webview.db, free size = 978
    07-10 15:50:10.321 D/ConnectivityService( 1310): getMobileDataEnabled returning true
    07-10 15:50:10.341 D/Database(21048): dbopen(): path = /data/data/com.my2ndcom.my3rdcom/databases/webviewCache.db, flag = 6
    07-10 15:50:10.341 D/Database(21048): dbopen(): path = /data/data/com.my2ndcom.my3rdcom/databases/webviewCache.db, free size = 978
    07-10 15:50:10.371 D/skia (21048): htcFlashPlugin::htcFlashPlugin
    07-10 15:50:10.421 I/ADMOB (21048): Enabling Complete
    07-10 15:50:10.431 I/Ads (21048): To get test ads on this device, call adRequest.addTestDevice("myDeviceId");
    07-10 15:50:10.461 I/ADMOB (21048): AdView already Visible
    07-10 15:50:10.491 I/Ads (21048): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_buildAdURL({"preqs":0,"u_sd":1.5,"slotname":"whatEverMyIdIs","u_w":320,"msid":"com.my2ndcom.my3rdcom","js":"afma-sdk-a-v4.3.1","mv":"4002304.com.android.vending","isu":"myDeviceId","cipa":0,"format":"468x60_as","net":"wi","app_name":"1.android.com.my2ndcom.my3rdcom","hl":"en","u_h":533,"u_audio":3});</script></head><body></body></html>
    07-10 15:50:10.521 D/webkit-timers(21048): [JWebCoreJavaBridge::resume] >> do resume
    07-10 15:50:11.312 D/skia ( 1442): purging 194K from font cache [25 entries]
    07-10 15:50:11.382 W/webcore (21048): Can't get the viewWidth after the first layout
    07-10 15:50:11.392 D/skia (21048): SwapPlugins [MainUrl] about:blank
    07-10 15:50:11.612 I/Ads (21048): Received ad url: <"url": "http://googleads.g.doubleclick.net:80/mads/gma?preqs=0&u_sd=1.5&slotname=a14ffc33d0cf12b&u_w=320&msid=com.my2ndcom.my3rdcom&js=afma-sdk-a-v4.3.1&mv=4002304.com.android.vending&isu=myDeviceId&cipa=0&format=468x60_as&net=wi&app_name=1.android.com.my2ndcom.my3rdcom&hl=en&u_h=533&u_audio=3&u_so=p&output=html&region=mobile_app&u_tz=300&ex=1&client_sdk=1&pto=0&caps=interactiveVideo_clickTracking_sdkAdmobApiForAds&jsv=27", "afmaNotifyDt": "null">
    07-10 15:50:11.733 D/dalvikvm( 1442): GC_EXPLICIT freed 584K, 49% free 4873K/9479K, external 21633K/23661K, paused 401ms
    07-10 15:50:11.753 D/dalvikvm(21048): GC_CONCURRENT freed 249K, 49% free 2911K/5639K, external 2K/514K, paused 4ms+5ms
    07-10 15:50:12.323 W/webcore (21048): Can't get the viewWidth after the first layout
    07-10 15:50:12.343 I/Ads (21048): onReceiveAd()
    07-10 15:50:12.343 I/ADMOB (21048): Adv Received
    07-10 15:50:12.343 W/Ads (21048): Not enough space to show ad! Wants: <702, 90>, Has: <480, 75>
    07-10 15:50:12.343 D/skia (21048): SwapPlugins [MainUrl] http://googleads.g.doubleclick.net:...droid.vending&isu=myDeviceId&cipa=0&format=46
    07-10 15:50:13.324 D/ConnectivityService( 1310): getMobileDataEnabled returning true
    07-10 15:50:13.364 D/dalvikvm(10947): GC_EXPLICIT freed <1K, 53% free 3068K/6471K, external 1743K/2255K, paused 99ms
    07-10 15:50:16.327 D/ConnectivityService( 1310): getMobileDataEnabled returning true
    07-10 15:50:17.258 D/StatusBarPolicy( 1412): onSignalStrengthsChanged
    07-10 15:50:17.258 D/StatusBarPolicy( 1412): ATT SignalStrength: asu=6 signalDbm=102 ecno=33
    07-10 15:50:19.330 D/ConnectivityService( 1310): getMobileDataEnabled returning true
    07-10 15:50:20.261 D/StatusBarPolicy( 1412): onSignalStrengthsChanged
    07-10 15:50:20.261 D/StatusBarPolicy( 1412): ATT SignalStrength: asu=4 signalDbm=106 ecno=38
    07-10 15:50:22.343 D/ConnectivityService( 1310): getMobileDataEnabled returning true
    07-10 15:50:25.346 D/ConnectivityService( 1310): getMobileDataEnabled returning true
    ..................
    It appears there is a message telling me "07-10 15:50:12.343 W/Ads (21048): Not enough space to show ad! Wants: <702, 90>, Has: <480, 75>". You think this is the problem why the ad didn't show? Any suggestion? My player setting is 480x800 on the android platform.
    Thanks for your time in advance.
     
  20. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hi tumitoto,

    Thankx for using this plugin.
    Actually, there is an issue with AdvertisementManager.AdvSize.DEVICE_WILL_DECIDE.
    Please user AdvSize BANNER in your C# script. This will sort your issue.

    If above solution wont work, post you log again.
     
  21. KMI

    KMI

    Joined:
    Jul 11, 2012
    Posts:
    9
    Hi MicroEyes,

    First of all, great tutorial and thank you for the effort but i'm facing a little problem which i can't get through.

    I exported the .jar file to the corresponding /bin folder - in web player I can start my project and even the buttons appear (enable/disable ads).

    Then I tried to start the project in my device but i get the following error in unity while building running:


    Any hints where i did something wrong?
     
  22. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Thankx KMI, for using my tutorial.
    For your concern, my Admob plugin won't work in web build. There Buttons will appear, but can't perform any action.
    One more thing, AdMob is solely for mobile applications (as declared by Google), not for web builds.

    According to me, error you mentioned above is not bcoz of plugin. Have you tried to create build without admob plugin.?
    To do this, remove Android folder from Plugin remove admob script from gameobject. try to create an android build again.
    If still getting this error message, Please check your android configuration for Unity.

    Good Luck.
     
  23. KMI

    KMI

    Joined:
    Jul 11, 2012
    Posts:
    9
    Oops, sry, i made a mistake. My game is actually made for Android mobile devices first hand :) (my brains was playing a trick with me writing "web player")

    Building without the plugin works nicely (my game is in the finishing touch factor and has been tested on some samsung phones already now i wan't to add some ads).
    Hmm, ill try different approaches, hopefully I can come back with some more helpful info - i have to read how this building process takes place in more detail.


    Mhh, the classes.jar was copied to the eclipse folder which caused errors. Removing that fixed the error :)

    However, now when the game is uploaded to the device and started then it causes immidiate crash (even the game window is not shown, just the pop up that app crashed). I'll keep trying and looking
     
    Last edited: Jul 11, 2012
  24. hawkeyeul

    hawkeyeul

    Joined:
    Feb 5, 2011
    Posts:
    2
    MicroEyes Thank you for doing this. Sadly I haven't been able to get it to work. I've been beating my head against the wall for a several hours now. I gotta be missing something simple. I get to the point where I'm trying to test the app and when I try to enable an add the game crashes with this debug log. What have I done wrong? Thanks for any help

    tsize=3}
    D/Unity (13498): NativeActivity save instance state: 0x2066b70
    D/Unity (13498): NativeActivity stop: 0x2066b70
    D/Unity (13498): NativeActivity start: 0x2066b70
    I/ActivityManager(10785): Start proc com.htc.notes for broadcast com.htc.notes/.
    sync.NotesAccountReceiver: pid=13646 uid=9996 gids={3003, 1015, 1006, 2001}
    I/ActivityManager(10785): No longer want com.htc.home.personalize (pid 13326): h
    idden #16, adj=12
    I/ActivityManager(10785): No longer want com.htc.providers.settings:remote (pid
    13395): hidden #16, adj=12
    D/ActivityManager(10785): Config after re-evaluted by window manager: null
    D/Unity (13498): NativeActivity resume: 0x2066b70
    W/ActivityManager(10785): Activity pause timeout for ActivityRecord{4186f030 com
    .PlanBFromBeyondLite/com.unity3d.player.UnityPlayerNativeActivity}
    I/Unity (13498): onResume
    D/Unity (13498): NativeActivity pause: 0x2066b70
    I/Unity (13498): onPause
    D/Unity (13498): onDetachedFromWindow
    D/Unity (13498): NativeActivity save instance state: 0x2066b70
    D/Unity (13498): NativeActivity stop: 0x2066b70
    D/Unity (13498): NativeActivity start: 0x2066b70
    D/Unity (13498): NativeActivity resume: 0x2066b70
    W/ActivityManager(10785): Activity idle timeout for ActivityRecord{4186f030 com.
    PlanBFromBeyondLite/com.unity3d.player.UnityPlayerNativeActivity}
    I/Unity (13498): onResume
    D/Unity (13498): NativeActivity pause: 0x2066b70
    I/Unity (13498): onPause
    D/Unity (13498): onDetachedFromWindow
    D/Unity (13498): NativeActivity save instance state: 0x2066b70
    D/Unity (13498): NativeActivity stop: 0x2066b70
    D/Unity (13498): NativeActivity start: 0x2066b70
    D/Unity (13498): NativeActivity resume: 0x2066b70
    I/Unity (13498): onResume
    D/Unity (13498): NativeActivity pause: 0x2066b70
    I/Unity (13498): onPause
    D/Unity (13498): onDetachedFromWindow
    D/Unity (13498): NativeActivity save instance state: 0x2066b70
    D/Unity (13498): NativeActivity stop: 0x2066b70
    D/Unity (13498): NativeActivity start: 0x2066b70
    D/Unity (13498): NativeActivity resume: 0x2066b70
    I/Unity (13498): onResume
    D/Unity (13498): NativeActivity pause: 0x2066b70
    I/Unity (13498): onPause
    D/Unity (13498): onDetachedFromWindow
    D/Unity (13498): NativeActivity save instance state: 0x2066b70
    D/Unity (13498): NativeActivity stop: 0x2066b70
    D/Unity (13498): NativeActivity start: 0x2066b70
    D/Unity (13498): NativeActivity resume: 0x2066b70
    I/Unity (13498): onResume
    D/Unity (13498): NativeActivity pause: 0x2066b70
    I/Unity (13498): onPause
    D/Unity (13498): onDetachedFromWindow
    D/Unity (13498): NativeActivity save instance state: 0x2066b70
    D/Unity (13498): NativeActivity stop: 0x2066b70
    I/ActivityManager(10785): Displayed com.PlanBFromBeyondLite/com.unity3d.player.U
    nityPlayerNativeActivity: +22s786ms (total +23s1ms)
    D/Unity (13498): NativeActivity configuration changed: 0x2066b70
    I/Unity (13498): onConfigurationChanged
    D/Unity (13498): NativeActivity window focus changed: 0x2066b70 -- 1
    D/Unity (13498): NativeActivity start: 0x2066b70
    D/ActivityManager(10785): Config after re-evaluted by window manager: null
    I/ActivityManager(10785): Start proc com.android.settings:remote for broadcast c
    om.android.settings/.framework.activity.powersaver.SmartSynServiceReceiver: pid=
    13692 uid=1000 gids={1015, 3002, 3001, 3003, 5001, 5003, 3007, 3006, 2001, 1007}

    I/ActivityManager(10785): Start proc com.htc.smartnetwork for broadcast com.htc.
    smartnetwork/.SystemIntentReceiver: pid=13709 uid=10100 gids={3003}
    I/ActivityManager(10785): No longer want com.htc.store (pid 13351): hidden #16,
    adj=12
    I/ActivityManager(10785): No longer want com.google.android.apps.plus (pid 11997
    ): hidden #16, adj=12
    D/Unity (13498): NativeActivity resume: 0x2066b70
    I/Unity (13498): onResume
    D/Unity (13498): NativeActivity pause: 0x2066b70
    I/Unity (13498): onPause
    D/Unity (13498): onDetachedFromWindow
    D/Unity (13498): NativeActivity save instance state: 0x2066b70
    D/Unity (13498): NativeActivity stop: 0x2066b70
    D/Unity (13498): NativeActivity start: 0x2066b70
    D/Unity (13498): NativeActivity resume: 0x2066b70
    I/Unity (13498): onResume
    D/Unity (13498): Creating OpenGL ES 1.x context (RGBA32 8888 16/0)
    I/Unity (13498): onSurfaceCreated
    I/Unity (13498): onSurfaceChanged 960x540
    I/Unity (13498): view is 960x540
    I/Unity (13498): initUnity
    I/Unity (13498): glGetString (GL10.GL_VERSION)='OpenGL ES-CM 1.1'
    D/Unity (13498): [SHA1] cc9c45b32b6dd1375f6e6f0ffb04f48806774062 10433552 by
    tes ~ lib/armeabi-v7a/libunity.so
    D/Unity (13498): Mono path[0] = '/data/app/com.PlanBFromBeyondLite-1.apk/asset
    s/bin/Data/Managed'
    D/Unity (13498): PlayerConnection::Initialize
    D/Unity (13498): PlayerConnection constructor
    D/Unity (13498): Playerconnection 3
    D/Unity (13498): Waiting for connection from host on [10.13.161.128]...
    I/ActivityManager(10785): No longer want com.htc.opensense (pid 13379): hidden #
    16, adj=12
    D/Unity (13498): NativeActivity pause: 0x2066b70
    I/Unity (13498): onPause
    W/ActivityManager(10785): Activity pause timeout for ActivityRecord{4186f030 com
    .PlanBFromBeyondLite/com.unity3d.player.UnityPlayerNativeActivity}
    D/ActivityManager(10785): Config after re-evaluted by window manager: null
    D/Unity (13498): Timed out. Continuing without host connection.
    D/Unity (13498): Using monoOptions --debugger-agent=transport=dt_socket,embedd
    ing=1,defer=y,address=0.0.0.0:56504
    D/Unity (13498): InitializeMonoFromMain OK (534bff00)
    D/Unity (13498): PlayerConnection::Initialize
    D/Unity (13498): PlayerInitEngineNoGraphics OK
    D/Unity (13498): Renderer: Adreno (TM) 220
    D/Unity (13498): Vendor: Qualcomm
    D/Unity (13498): Version: OpenGL ES-CM 1.1
    D/Unity (13498): GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_A
    PPLE_texture_2D_limited_npot GL_ARB_vertex_buffer_object GL_EXT_texture_filter_a
    nisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_
    OES_blend_equation_separate GL_OES_blend_func_separate GL_OES_blend_subtract GL_
    OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_depth
    _texture GL_OES_depth24 GL_OES_draw_texture GL_OES_EGL_image GL_OES_EGL_image_ex
    ternal GL_OES_framebuffer_object GL_OES_matrix_palette GL_OES_packed_depth_stenc
    il GL_OES_point_size_array GL_OES_point_sprite GL_OES_read_format GL_OES_rgb8_rg
    ba8 GL_OES_stencil_wrap GL_OES_texture_cube_map GL_OES_texture_env_crossbar GL_O
    ES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_O
    ES_texture_npot GL_OES_texture_mirrored_repeat GL_QCOM_binning_control GL_QCOM_e
    xtended_get GL_QCOM_tiled_rendering GL_AMD_compressed_3DC_texture
    D/Unity (13498): Creating OpenGLES1.x graphics device
    D/Unity (13498): InitializeGfxDevice OK
    D/Unity (13498): Initialize engine version: 3.5.1f2
    D/Unity (13498): Begin MonoManager ReloadAssembly
    D/Unity (13498): Platform assembly: /data/app/com.PlanBFromBeyondLite-1.apk/as
    sets/bin/Data/Managed/UnityEngine.dll (this message is harmless)
    D/Unity (13498): Loading /data/app/com.PlanBFromBeyondLite-1.apk/assets/bin/Da
    ta/Managed/UnityEngine.dll into Unity Child Domain
    D/Unity (13498): Platform assembly: /data/app/com.PlanBFromBeyondLite-1.apk/as
    sets/bin/Data/Managed/Assembly-CSharp-firstpass.dll (this message is harmless)
    D/Unity (13498): Loading /data/app/com.PlanBFromBeyondLite-1.apk/assets/bin/Da
    ta/Managed/Assembly-CSharp-firstpass.dll into Unity Child Domain
    D/Unity (13498): Platform assembly: /data/app/com.PlanBFromBeyondLite-1.apk/as
    sets/bin/Data/Managed/Assembly-CSharp.dll (this message is harmless)
    D/Unity (13498): Loading /data/app/com.PlanBFromBeyondLite-1.apk/assets/bin/Da
    ta/Managed/Assembly-CSharp.dll into Unity Child Domain
    D/Unity (13498): Platform assembly: /data/app/com.PlanBFromBeyondLite-1.apk/as
    sets/bin/Data/Managed/Assembly-UnityScript.dll (this message is harmless)
    D/Unity (13498): Loading /data/app/com.PlanBFromBeyondLite-1.apk/assets/bin/Da
    ta/Managed/Assembly-UnityScript.dll into Unity Child Domain
    D/Unity (13498): - Completed reload, in 0.237 seconds
    D/Unity (13498): PlayerInitEngineGraphics OK
    D/Unity (13498): Platform assembly: /data/app/com.PlanBFromBeyondLite-1.apk/as
    sets/bin/Data/Managed/UnityScript.Lang.dll (this message is harmless)
    D/Unity (13498): Platform assembly: /data/app/com.PlanBFromBeyondLite-1.apk/as
    sets/bin/Data/Managed/Boo.Lang.dll (this message is harmless)
    D/Unity (13498): onDetachedFromWindow
    D/Unity (13498): NativeActivity resume: 0x2066b70
    I/Unity (13498): onResume
    I/Unity (13498): onSurfaceChanged 960x540
    I/Unity (13498): view is 960x540
    I/Unity (13498): onSurfaceChanged 960x540
    I/Unity (13498): view is 960x540
    D/Unity (13498): Watchdog wakeup : 1.50s has past without activity
    D/Unity (13498): Unloading 7 Unused Serialized files (Serialized files now loa
    ded: 0 / Dirty serialized files: 0)
    D/Unity (13498):
    D/Unity (13498): Unloading 4 unused Assets to reduce memory usage. Loaded Obje
    cts now: 781. Operation took 114.501999 ms.
    D/Unity (13498): System memory in use: 2.4 MB.
    D/Unity (13498): Unloading 1 Unused Serialized files (Serialized files now loa
    ded: 0 / Dirty serialized files: 0)
    D/Unity (13498):
    D/Unity (13498): Unloading 180 unused Assets to reduce memory usage. Loaded Ob
    jects now: 610. Operation took 80.261002 ms.
    D/Unity (13498): System memory in use: 2.3 MB.
    D/Unity (13498): Unloading 2 Unused Serialized files (Serialized files now loa
    ded: 0 / Dirty serialized files: 0)
    D/Unity (13498):
    D/Unity (13498): Unloading 88 unused Assets to reduce memory usage. Loaded Obj
    ects now: 350. Operation took 95.459000 ms.
    D/Unity (13498): System memory in use: 2.1 MB.
    D/Unity (13498): Watchdog wakeup : 1.02s has past without activity
    D/Unity (13498): Watchdog wakeup : 2.27s has past without activity
    D/Unity (13498): Unloading 3 Unused Serialized files (Serialized files now loa
    ded: 0 / Dirty serialized files: 0)
    D/Unity (13498):
    D/Unity (13498): Unloading 10 unused Assets to reduce memory usage. Loaded Obj
    ects now: 11610. Operation took 345.244995 ms.
    D/Unity (13498): System memory in use: 8.8 MB.
    I/Unity (13498): Unity Calling Start
    I/Unity (13498): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity (13498): UnityEngine.Debug:Log(Object)
    I/Unity (13498): AdmobPluginCall:Start() (at E:\GameMakingShared\Plan B From B
    eyond Lite Version - Dev\Assets\Script\Misc\AdmobPluginCall.cs:44)
    I/Unity (13498):
    I/Unity (13498): (Filename: E Line: 0)
    I/Unity (13498):
    I/Unity (13498): Initiating Admob
    I/Unity (13498): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity (13498): UnityEngine.Debug:Log(Object)
    I/Unity (13498): AdvertisementManager:Instantiate(String, AdvSize, AdvOrientat
    ion, Position, Position, Boolean, AnimationInType, AnimationOutType) (at E:\Game
    MakingShared\Plan B From Beyond Lite Version - Dev\Assets\Script\Misc\Advertisem
    entManager.cs:68)
    I/Unity (13498): AdmobPluginCall:Start() (at E:\GameMakingShared\Plan B From B
    eyond Lite Version - Dev\Assets\Script\Misc\AdmobPluginCall.cs:45)
    I/Unity (13498):
    I/Unity (13498): (Filename: E Line: 0)
    I/Unity (13498):
    I/Unity (13498): Complete Process EnableAds
    I/Unity (13498): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity (13498): UnityEngine.Debug:Log(Object)
    I/Unity (13498): AdvertisementManager:Instantiate(String, AdvSize, AdvOrientat
    ion, Position, Position, Boolean, AnimationInType, AnimationOutType) (at E:\Game
    MakingShared\Plan B From Beyond Lite Version - Dev\Assets\Script\Misc\Advertisem
    entManager.cs:109)
    I/Unity (13498): AdmobPluginCall:Start() (at E:\GameMakingShared\Plan B From B
    eyond Lite Version - Dev\Assets\Script\Misc\AdmobPluginCall.cs:45)
    I/Unity (13498):
    I/Unity (13498): (Filename: E Line: 0)
    I/Unity (13498):
    I/Unity (13498): Starting EnableAds
    I/Unity (13498): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity (13498): UnityEngine.Debug:Log(Object)
    I/Unity (13498): AdvertisementManager:EnableAds() (at E:\GameMakingShared\Plan
    B From Beyond Lite Version - Dev\Assets\Script\Misc\AdvertisementManager.cs:122
    )
    I/Unity (13498): AdmobPluginCall:Start() (at E:\GameMakingShared\Plan B From B
    eyond Lite Version - Dev\Assets\Script\Misc\AdmobPluginCall.cs:46)
    I/Unity (13498):
    I/Unity (13498): (Filename: E Line: 0)
    I/Unity (13498):
    I/Unity (13498): Complete Process EnableAds
    I/Unity (13498): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity (13498): UnityEngine.Debug:Log(Object)
    I/Unity (13498): AdvertisementManager:EnableAds() (at E:\GameMakingShared\Plan
    B From Beyond Lite Version - Dev\Assets\Script\Misc\AdvertisementManager.cs:134
    )
    I/Unity (13498): AdmobPluginCall:Start() (at E:\GameMakingShared\Plan B From B
    eyond Lite Version - Dev\Assets\Script\Misc\AdmobPluginCall.cs:46)
    I/Unity (13498):
    I/Unity (13498): (Filename: E Line: 0)
    I/Unity (13498):
    I/Unity (13498): Unity End Calling Start
    I/Unity (13498): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity (13498): UnityEngine.Debug:Log(Object)
    I/Unity (13498): AdmobPluginCall:Start() (at E:\GameMakingShared\Plan B From B
    eyond Lite Version - Dev\Assets\Script\Misc\AdmobPluginCall.cs:47)
    I/Unity (13498):
    I/Unity (13498): (Filename: E Line: 0)
    I/Unity (13498):
    D/Unity (13498): Watchdog wakeup : 1.80s has past without activity
    I/Unity (13498): Starting DisableAds
    I/Unity (13498): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    I/Unity (13498): UnityEngine.Debug:Log(Object)
    I/Unity (13498): AdvertisementManager:DisableAds() (at E:\GameMakingShared\Pla
    n B From Beyond Lite Version - Dev\Assets\Script\Misc\AdvertisementManager.cs:14
    5)
    I/Unity (13498): AdmobPluginCall:OnGUI() (at E:\GameMakingShared\Plan B From B
    eyond Lite Version - Dev\Assets\Script\Misc\AdmobPluginCall.cs:21)
    I/Unity (13498):
    I/Unity (13498): (Filename: E Line: 0)
    I/Unity (13498):
    D/Unity (13498): Watchdog wakeup : 1.08s has past without activity
    D/Unity (13498): Watchdog wakeup : 2.33s has past without activity
    I/ActivityManager(10785): Start proc com.htc.calendar for broadcast com.htc.cale
    ndar/.app.widget.CalendarAppWidgetService$CalendarFactory: pid=13768 uid=10014 g
    ids={2001, 3003, 1015, 1006, 5001}
    D/Unity (13498): Watchdog wakeup : 3.58s has past without activity
    I/ActivityManager(10785): No longer want com.android.smith (pid 13426): hidden #
    16, adj=12
    D/Unity (13498): Watchdog wakeup : 5.10s has past without activity
    D/Unity (13498): Watchdog wakeup : 7.73s has past without activity
    D/Unity (13498): Watchdog wakeup : 8.98s has past without activity
    I/ActivityManager(10785): Process com.PlanBFromBeyondLite (pid 13498) has died.
    W/ActivityManager(10785): Force removing ActivityRecord{4186f030 com.PlanBFromBe
    yondLite/com.unity3d.player.UnityPlayerNativeActivity}: app died, no saved state

    E/ActivityManager(10785): fail to set top app changed! (2)
    E/ActivityManager(10785): java.lang.NullPointerException
    E/ActivityManager(10785): at com.android.server.am.ActivityManagerService.
    handleTopAppChanged(ActivityManagerService.java:15563)
    E/ActivityManager(10785): at com.android.server.am.ActivityManagerService.
    updateOomAdjLocked(ActivityManagerService.java:15041)
    E/ActivityManager(10785): at com.android.server.am.ActivityManagerService.
    updateLruProcessInternalLocked(ActivityManagerService.java:1944)
    E/ActivityManager(10785): at com.android.server.am.ActivityManagerService.
    updateLruProcessLocked(ActivityManagerService.java:1951)
    E/ActivityManager(10785): at com.android.server.am.ActivityStack.resumeTop
    ActivityLocked(ActivityStack.java:1511)
    E/ActivityManager(10785): at com.android.server.am.ActivityManagerService.
    handleAppDiedLocked(ActivityManagerService.java:3000)
    E/ActivityManager(10785): at com.android.server.am.ActivityManagerService.
    appDiedLocked(ActivityManagerService.java:3079)
    E/ActivityManager(10785): at com.android.server.am.ActivityManagerService$
    AppDeathRecipient.binderDied(ActivityManagerService.java:908)
    E/ActivityManager(10785): at android.os.BinderProxy.sendDeathNotice(Binder
    .java:417)
    E/ActivityManager(10785): at dalvik.system.NativeStart.run(Native Method)
    D/ActivityManager(10785): Config after re-evaluted by window manager: {1.0 0mcc0
    mnc (no locale) layoutdir=0 sw360dp w360dp h614dp nrml long port ?uimode ?night
    finger -keyb/v/h -nav/h skin=default fontsize=3}
    I/ActivityManager(10785): Config changed: {1.0 310mcc410mnc en_US layoutdir=0 sw
    360dp w360dp h614dp nrml long port finger -keyb/v/h -nav/h s.94 skin=default fon
    tsize=3}
     
  25. KMI

    KMI

    Joined:
    Jul 11, 2012
    Posts:
    9
    Hi MicroEyes,

    I managed to find the problem with the sudden force close on starting my game: it seems it can't find the class "AdmobActivity" which is strange because it should work.

    From the log i see there is an warning with superclass:

    07-11 22:22:05.768: W/dalvikvm(19321): Unable to resolve superclass of Lcom/thekmi/it/games/fingermaster/AdmobActivity; (154)

    07-11 22:22:05.768: W/dalvikvm(19321): Link of class 'Lcom/thekmi/it/games/fingermaster/AdmobActivity;' failed


    after which the class i guess is not created and comes this error:
    07-11 22:22:05.768: E/AndroidRuntime(19321): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.thekmi.it.games.fingermaster/com.thekmi.it.games.fingermaster.AdmobActivity}: java.lang.ClassNotFoundException: com.thekmi.it.games.fingermaster.AdmobActivity


    I'm on the third cycle of doing everything by your great tutorial but i'm running out of ideas.

    If you can give me another hint it would be appreciated. I feel i'm close but i might have done something wrong, i'll keep seeking

    btw, after importing the project I fixed the imported 2 libraries and changed the android API level to 15 in project properties (so high because of the property: android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" )

    but <uses-sdk android:minSdkVersion="7" /> remains.

    Project has no errors but running it on the device it fails with the classexception error (after install on the device and running it) - same problem is in the unity logs.

    Greetings,
    KMI
     
  26. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    MicroEyes,
    Yes, after I change the parm to Banner, the ad shows up in my portrait mode game. However, when I pause my game (by pressing the home key in phone) and then come back to the app, the banner shifted downward with the camera. So the upper portion of my screen (about 1/12) has nothing and the whole app including the banner shifted down. btw, I did not implement anything in OnApplicationPause(). I also noticed if I restart my game, everything looks good. Is there anything I need to do to properly restore the app with the correct banner positioning?

    The other question I got is that I noticed the ad is not changing when my app is active, I have to stop my app and restart to get a new ad banner, is there any way to 'refresh' or get a new ad banner? I been working with Inmobi before and they got a 'interval' parameter to refresh the ad. Is this is how the Admod suppose to work?
    Thanks for your time in advance.

    For those getting class not find issue, you can use the winzip to open your generated jar file and see if 2 classes are there. For me, one is R class (generated) the other one is Admodactivity class. I was not able to get these classes generated properly but after I tweaked the Eclipse for the correct API and Libraries. These classes generated fine. Just fyi.

    >>Edit. I also noticed if I clicked on the ad banner and exit to the browser then come back to the app, everything looks ok. Here is the log trace on the flow:
    1. I fired up the app and click on the ad banner.
    2. The ad web page shows.
    3. I press the escape (return sign) button and get back to the app, everything is fine.
    4. I press the home button to exit and pause the app
    5. I tap the app icon to get back to the app. The app screen got shift down alone with the banner.
    ....trace log....
    07-11 20:42:40.778 I/Ads (25534): onReceiveAd()
    07-11 20:42:40.778 I/ADMOB (25534): Adv Received
    07-11 20:42:40.788 D/skia (25534): SwapPlugins [MainUrl] http://googleads.g.doubleclick.net:80/mads/gma?preqs=0&u_sd=......
    07-11 20:42:45.893 D/webview (25534): [WebView::UPDATE_SELECTION] ====== start
    07-11 20:42:46.504 D/PhoneWindow(25534): couldn't save which view has focus because the focused view com.unity3d.player.UnityPlayer$17@4055c328 has no id.
    07-11 20:42:46.504 I/ActivityManager( 1310): Starting activity: Intent { .... } from pid 25534
    07-11 20:42:46.514 I/Unity (25534): onPause <=== Clicked on the ad banner<<<<<<<<
    07-11 20:42:46.524 I/AudioPolicyManagerBase( 1213): setOutputDevice() output 1 device 0 delayMs 0
    07-11 20:42:46.524 I/AudioPolicyManagerBase( 1213): setOutputDevice() setting same device 0 or null device for output 1
    07-11 20:42:46.544 I/Unity (25534): Unity Paused
    07-11 20:42:46.544 I/Unity (25534): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    07-11 20:42:46.544 I/Unity (25534): UnityEngine.Debug:Log(Object)
    07-11 20:42:46.544 I/Unity (25534): AdmobPluginCall:OnApplicationPause(Boolean) (at C:\Documents and Settings\tumix\My Documents\MushAttacks\Assets\Scripts\Ads\AdmobPluginCall.cs:71)
    07-11 20:42:46.544 I/Unity (25534):
    07-11 20:42:46.544 I/Unity (25534): (Filename: C Line: 0)
    07-11 20:42:46.544 I/Unity (25534):
    07-11 20:42:46.584 D/Unity (25534): onDetachedFromWindow
    07-11 20:42:46.584 D/Sensors ( 1310): Enable akm: en = 0
    07-11 20:42:46.584 D/SensorService( 1310): noteStopSensor: uid = 0x277b, handle = 0x1
    07-11 20:42:46.584 D/Sensors ( 1310): Enable akm: en = 0
    07-11 20:42:46.584 D/SensorService( 1310): noteStopSensor: uid = 0x277b, handle = 0x0
    07-11 20:42:46.664 D/dalvikvm(25534): GC_CONCURRENT freed 376K,......al 2K/514K, paused 3ms+5ms
    07-11 20:42:46.664 D/InputManagerService( 1310): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@40b08880 (uid=10107 pid=25534)
    07-11 20:42:46.674 I/Ads (25534): onPresentScreen()
    07-11 20:42:46.674 D/ADMOB (25534): Present Screen
    07-11 20:42:46.674 I/Ads (25534): onLeaveApplication()
    07-11 20:42:46.674 D/ADMOB (25534): Leaving Application
    07-11 20:42:46.674 I/ActivityManager( 1310): Starting activity: Intent { act=android.intent.action.VIEW dat=market://details?.............. } from pid 25534
    07-11 20:42:46.684 D/Sensors ( 1310): Enable akm: en = 1
    07-11 20:42:46.684 D/SensorService( 1310): noteStartSensor: uid = 0x3e8, handle = 0x0
    07-11 20:42:46.794 D/ConnectivityService( 1310): startUsingNetworkFeature for net 0: enableHIPRI by 14296/10019
    ...
    07-11 20:42:51.739 D/ConnectivityService( 1310): getMobileDataEnabled returning true
    07-11 20:42:51.839 I/vending (14296): [369] RadioHttpClient.isRadioActiveElseWait(): mobile_hipri connection hasn't come up, trying mms...
    07-11 20:42:51.839 D/ConnectivityService( 1310): startUsingNetworkFeature for net 0: enableMMS by 14296/10019
    07-11 20:42:51.839 D/ConnectivityService( 1310): Disconnect in 420000ms
    07-11 20:42:51.839 D/ConnectivityService( 1310): reconnecting to special network 2
    07-11 20:42:51.839 D/ConnectivityService( 1310): issue reconnect to special network:2
    07-11 20:42:51.849 D/DataConnectionTracker( 1450): enableApnType(mms), isApnTypeActive = false and state = IDLE
    07-11 20:42:51.849 D/DataConnectionTracker( 1450): setEnabled(1, true) with old state = false and enabledCount = 1
    07-11 20:42:51.859 I/vending (14296): [369] RadioHttpClient.isRadioActiveElseWait(): MMS APN request started: Thread[GetProvisioningThread,5,main]
    ...
    07-11 20:43:30.186 D/InputManagerService( 1310): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@40b08880 (uid=10107 pid=25534)
    07-11 20:43:30.186 D/InputManagerService( 1310): Client not active, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@408c4100
    07-11 20:43:30.196 I/Ads (25534): onDismissScreen() <==== I think this is where I return to the app by escape key==<<
    07-11 20:43:30.196 D/ADMOB (25534): Dismiss Screen
    07-11 20:43:30.216 I/Unity (25534): onResume
    07-11 20:43:30.216 D/Sensors ( 1310): Enable akm: en = 1
    07-11 20:43:30.216 D/SensorService( 1310): noteStartSensor: uid = 0x277b, handle = 0x0
    07-11 20:43:30.216 D/Sensors ( 1310): Enable akm: en = 1
    07-11 20:43:30.216 D/SensorService( 1310): noteStartSensor: uid = 0x277b, handle = 0x1
    07-11 20:43:30.236 I/Unity (25534): onSurfaceChanged 480x800
    07-11 20:43:30.236 I/Unity (25534): view is 480x800
    07-11 20:43:30.236 I/Unity (25534): onSurfaceChanged 480x800
    07-11 20:43:30.236 I/Unity (25534): view is 480x800
    07-11 20:43:30.246 W/InputManagerService( 1310): [unbindCurrentClientLocked] Disable input method client.
    07-11 20:43:30.246 W/InputManagerService( 1310): [startInputLocked] Enable input method client.
    07-11 20:43:30.256 I/AudioPolicyManagerBase( 1213): setOutputDevice() output 1 device 2 delayMs 0
    ...
    07-11 20:43:30.256 I/Unity (25534): Unity Un-pause <===my script tells me the un-pause is received <<<<<<
    07-11 20:43:30.256 I/Unity (25534): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    07-11 20:43:30.256 I/Unity (25534): UnityEngine.Debug:Log(Object)
    07-11 20:43:30.256 I/Unity (25534): AdmobPluginCall:OnApplicationPause(Boolean) (at C:\Documents and Settings\tumix\My Documents\MushAttacks\Assets\Scripts\Ads\AdmobPluginCall.cs:78)
    07-11 20:43:30.256 I/Unity (25534):
    07-11 20:43:30.256 I/Unity (25534): (Filename: C Line: 0)
    07-11 20:43:30.256 I/Unity (25534):
    07-11 20:43:30.266 D/StreamProcess( 1213): +ProcessAOLC ResetAOLC delta=43757 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    07-11 20:43:30.266 D/StreamProcess( 1213): OutputStreamProcess::ResetAOLC()
    07-11 20:43:30.266 D/AudioHardwareMSM7X30( 1213): acquire output wakelock
    07-11 20:43:30.266 I/AudioHardwareMSM7X30( 1213): do_aic3254_control (1, 0, 0)
    07-11 20:43:30.266 I/AudioHardwareMSM7X30( 1213): aic3254: change rx mode to 13
    ..
    07-11 20:43:40.496 D/PhoneWindow(25534): couldn't save which view has focus because the focused view com.google.ads.h@40560ee8 has no id.
    07-11 20:43:40.496 I/Unity (25534): onPause
    07-11 20:43:40.496 I/AudioPolicyManagerBase( 1213): setOutputDevice() output 1 device 0 delayMs 0
    07-11 20:43:40.496 I/AudioPolicyManagerBase( 1213): setOutputDevice() setting same device 0 or null device for output 1
    07-11 20:43:40.506 I/Unity (25534): Unity Paused <===Home key <<<
    07-11 20:43:40.506 I/Unity (25534): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    07-11 20:43:40.506 I/Unity (25534): UnityEngine.Debug:Log(Object)
    07-11 20:43:40.506 I/Unity (25534): AdmobPluginCall:OnApplicationPause(Boolean) (at C:\Documents and Settings\tumix\My Documents\MushAttacks\Assets\Scripts\Ads\AdmobPluginCall.cs:71)
    07-11 20:43:40.506 I/Unity (25534):
    07-11 20:43:40.506 I/Unity (25534): (Filename: C Line: 0)
    07-11 20:43:40.506 I/Unity (25534):
    07-11 20:43:40.526 D/Unity (25534): onDetachedFromWindow
    07-11 20:43:40.526 D/Sensors ( 1310): Enable akm: en = 0
    07-11 20:43:40.526 D/SensorService( 1310): noteStopSensor: uid = 0x277b, handle = 0x1
    07-11 20:43:40.526 D/Sensors ( 1310): Enable akm: en = 0
    07-11 20:43:40.526 D/SensorService( 1310): noteStopSensor: uid = 0x277b, handle = 0x0
    07-11 20:43:40.586 D/StatusBarPolicy( 1412): onSignalStrengthsChanged
    07-11 20:43:40.586 D/StatusBarPolicy( 1412): ATT SignalStrength: asu=6 signalDbm=102 ecno=28
    07-11 20:43:40.626 I/[POST_RESELECT]( 1442): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4012ceb0,-1,0,-1,0)
    07-11 20:43:40.626 I/[POST_RESELECT]( 1442): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@40140890,-1,0,-1,0)
    ..
    07-11 20:43:47.583 D/AK8975 ( 1219): Compass Start
    07-11 20:43:47.643 I/Unity (25534): onSurfaceChanged 480x800
    07-11 20:43:47.643 I/Unity (25534): view is 480x800
    07-11 20:43:47.643 I/Unity (25534): onSurfaceChanged 480x800
    07-11 20:43:47.643 I/Unity (25534): view is 480x800
    07-11 20:43:47.653 W/dalvikvm( 1442): disableGcForExternalAlloc: false
    07-11 20:43:47.653 W/dalvikvm( 1442): disableGcForExternalAlloc: false
    07-11 20:43:47.673 I/AudioPolicyManagerBase( 1213): setOutputDevice() output 1 device 2 delayMs 0
    07-11 20:43:47.673 I/Unity (25534): Unity Un-pause <===After clicked on the app icon again=====<<<
    07-11 20:43:47.673 I/Unity (25534): UnityEngine.Debug:Internal_Log(Int32, String, Object)
    07-11 20:43:47.673 I/Unity (25534): UnityEngine.Debug:Log(Object)
    07-11 20:43:47.673 I/Unity (25534): AdmobPluginCall:OnApplicationPause(Boolean) (at C:\Documents and Settings\tumix\My Documents\MushAttacks\Assets\Scripts\Ads\AdmobPluginCall.cs:78)
    07-11 20:43:47.673 I/Unity (25534):
    07-11 20:43:47.673 I/Unity (25534): (Filename: C Line: 0)
    07-11 20:43:47.673 I/Unity (25534):
    07-11 20:43:47.673 W/InputManagerService( 1310): [unbindCurrentClientLocked] Disable input method client.
    07-11 20:43:47.683 D/StreamProcess( 1213): +ProcessAOLC ResetAOLC delta=7178 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    07-11 20:43:47.683 D/StreamProcess( 1213): OutputStreamProcess::ResetAOLC()
    ...
    It looks like there are extra work done when exit to the ad page compares to what was done in a home key pressed. I am not sure if this help to find the problem or not but thanks.
     
    Last edited: Jul 12, 2012
  27. KMI

    KMI

    Joined:
    Jul 11, 2012
    Posts:
    9
    Hi again,

    It's seems i can't run the basic android project you provided also. It still can't resolve the AdmobActivity's superclass :/ Any kind of hind would be good, I ran out of ideas for this time
     
  28. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    Just my 2 cents. Make sure the classes.jar (from the Unity install folder) and GoogleAdMobAdsSdk-6.0.1.jar(or whatever version you are using) are in your project's reference lib. Do a rebuild or close the project and re-open again just to make sure, cuz sometime when I change the reference lib, I forgot to do apply :p. The superclass should be resolved.
     
  29. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hi hawkeyeul,
    Thankx for using this tutorial. According to log you provided me shows me that, jar file you have made from eclipse project can't find by your game. This can be happened by two reasons:
    1. package name in eclipse is different from bundle identifier name in Unity. Please cross this and it shud be case based.
    2. In unity script AdvertisementManager, please check you wrote correct bundle identifier name in line.
    cls_OurAppNameActivityClass = AndroidJNI.FindClass("org/admob/test/AdmobTestActivity");
    in every function.


    Thankx.
     
  30. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hi KMI,
    Please read this post. i think you have the same problem.
     
    Last edited: Jul 13, 2012
  31. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hey tumitoto,
    In AdvertisementManager.cs, Create an Event OnApplicationPause() hide advertisement in this event. And OnApplicationFocus(), you can make your admob visible.

    If still you have that issue, make admob disable on OnApplicationPause() enable again on OnApplicationFocus().

    Hope this might help you.

    Answer of your next question: Admob plugin is not controlling to refresh your advertisement. By default its 60sec. You can change this timer in your Site App setting in Admob website.

    What you can track in my plugin is, whenever my plugin receives an advertisement, onReceiveAd(Ad ad) is get called, i have added a log in it, here you can track after what time you are receiving a new advertisement.


    If your are still not receiving a new advertisment after 60secs, Please check your FILL RATE in Admob website or decrease your new advertisement delay in Admob website recheck again.

    Please share with me, if above solutions doesn't help you.
    Thankx
     
  32. KMI

    KMI

    Joined:
    Jul 11, 2012
    Posts:
    9
    Hi again,

    Well, thank you for all your help so far, you guys keep the wheels spinning. I managed to get some progress.


    I'll post my project view:
    $project.PNG

    This won't compile because of the ClassNotFoundException.
    However, when I rearranged like this (I moved the two .jar's in front of the Android Library - any idea why is that?):

    $build_path.PNG

    the error disappeared and a new one became, but i think this is OK, it shows the class is found:


    07-13 11:54:41.453: I/ADMOB(24069): onCreate
    07-13 11:54:41.468: E/Unity(24069): Unable to locate player settings. bin/Data/settings.xml
    07-13 11:54:41.498: D/AndroidRuntime(24069): Shutting down VM
    07-13 11:54:41.498: W/dalvikvm(24069): threadid=1: thread exiting with uncaught exception (group=0x40c551f8)
    07-13 11:54:41.498: E/AndroidRuntime(24069): FATAL EXCEPTION: main
    07-13 11:54:41.498: E/AndroidRuntime(24069): java.lang.UnsatisfiedLinkError: Couldn't load mono: findLibrary returned null
    07-13 11:54:41.498: E/AndroidRuntime(24069): at java.lang.Runtime.loadLibrary(Runtime.java:365)
    07-13 11:54:41.498: E/AndroidRuntime(24069): at java.lang.System.loadLibrary(System.java:535)
    07-13 11:54:41.498: E/AndroidRuntime(24069): at com.unity3d.player.UnityPlayer.<init>(Unknown Source)
    07-13 11:54:41.498: E/AndroidRuntime(24069): at com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source)
    07-13 11:54:41.498: E/AndroidRuntime(24069): at com.thekmi.it.games.fingermaster.AdmobActivity.onCreate(AdmobActivity.java:40)


    And the jar file also exists :
    $jar.PNG

    (and again, there are no errors in my project)
    $noErrors.PNG

    So, now i wan't to run my Unity project and the logcat show the good old classNotFoundException comes up :(

    E/AndroidRuntime(25735): FATAL EXCEPTION: main
    E/AndroidRuntime(25735): java.lang.RuntimeException: Unable to instantiate activ
    ity ComponentInfo{com.thekmi.it.games.fingermaster/com.thekmi.it.games.fingermas
    ter.AdmobActivity}: java.lang.ClassNotFoundException: com.thekmi.it.games.finger
    master.AdmobActivity
    E/AndroidRuntime(25735): at android.app.ActivityThread.performLaunchActiv
    ity(ActivityThread.java:1892)
    E/AndroidRuntime(25735): at android.app.ActivityThread.handleLaunchActivi
    ty(ActivityThread.java:1993)
    E/AndroidRuntime(25735): at android.app.ActivityThread.access$600(Activit
    yThread.java:127)

    So, getting closer i think :) All suggestions welcome at this point.
     
  33. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Possible reasons:
    1. Register activity in your AndroidManifest.xml - When you want to making new activity, you should register it in your AndroidManifest.xml
    2. Change Package name in AndroidManifest.xml
    3. Eclipse is taking old class files. Clean your project by Project menu -> Clean. Select your project clean it.
    4. Open your jar file with 7zip cross the jar you have created contains right file structure.


    Reply soon..
     
  34. phard

    phard

    Joined:
    Jul 5, 2012
    Posts:
    26
    I have download your test project, I have create a new unity project in which I have pasted your asset folder...then what I have to do to test the game ?
     
  35. phard

    phard

    Joined:
    Jul 5, 2012
    Posts:
    26
    the problem is that when I load on my device the app crashes!!
     
  36. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    Hey MicroEyes,
    I tried the enable and disable plus the hide and showAd, neither works. After the trace log I found every time when one of these functions was invoked, the system shows:
    ...
    07-13 11:47:25.452 I/Unity (27126): AdvertisementManager:OnApplicationPause(Boolean) (at C:\Documents and Settings\tumix\My Documents\myappName\Assets\Scripts\Ads\AdvertisementManager.cs:241)
    07-13 11:47:25.452 I/Unity (27126):
    07-13 11:47:25.452 I/Unity (27126): (Filename: C Line: 0)
    07-13 11:47:25.452 I/Unity (27126):
    07-13 11:47:25.452 W/dalvikvm(27126): JNI WARNING: 0x40523238 is not a valid JNI reference
    07-13 11:47:25.452 W/dalvikvm(27126): in Lcom/unity3d/player/UnityPlayer;.nativePause ()Z (GetMethodID)
    07-13 11:47:25.452 I/dalvikvm(27126): "GLThread 10" prio=5 tid=9 RUNNABLE
    07-13 11:47:25.452 I/dalvikvm(27126): | group="main" sCount=0 dsCount=0 obj=0x4055d908 self=0x343d18
    07-13 11:47:25.462 I/dalvikvm(27126): | sysTid=27134 nice=0 sched=0/0 cgrp=default handle=3423824
    07-13 11:47:25.462 I/dalvikvm(27126): | schedstat=( 10862426762 7040832494 20866 )
    07-13 11:47:25.462 I/dalvikvm(27126): at com.unity3d.player.UnityPlayer.nativePause(Native Method)
    07-13 11:47:25.462 I/dalvikvm(27126): at com.unity3d.player.UnityPlayer.f((null):-1)
    07-13 11:47:25.462 I/dalvikvm(27126): at com.unity3d.player.UnityPlayer$21.run((null):-1)
    07-13 11:47:25.462 I/dalvikvm(27126): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1326)
    07-13 11:47:25.462 I/dalvikvm(27126): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
    07-13 11:47:25.462 I/dalvikvm(27126):
    07-13 11:47:25.462 E/dalvikvm(27126): VM aborting
    ....
    Pretty much the same issue when either of these function was called in when paused. If I leave it alone without any changes, the banner shows and looks good when clicked (exit out to web browser) and come back. Just when the Home key is press and then come back, the problem occurs (whole app window got shifted down, upper 1/12 of the screen is blank). I also tried this in Kindle and it had similar problem when I click on the ad and come back. I think the best way might be stop and dispose the Ad components whenever a pause is detected and then re-initialize again when un-pause/resume is detected?
     
    Last edited: Jul 13, 2012
  37. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hey Guys, Thankx for using my plugin.

    I m going to start my work on standalone independent Admob Plugin.
    No more Eclipse or Export headaches.



    Just Add Plugin scripts in Unity Thats IT..

    Give me some time.
     
    Last edited: Jul 16, 2012
  38. KMI

    KMI

    Joined:
    Jul 11, 2012
    Posts:
    9
    These are great news MicroEyes! Can't wait to see the result!

    I haven't had any luck so far to get the current library working but now i'll wait for the Admob plugin instead. Meanwhile i can add some more interesting levels for my game :)
     
  39. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    New Plugin is Out.
    Just one step unity integration with new google admob sdk 6.0.1
     
  40. DreamingP

    DreamingP

    Joined:
    Jul 18, 2012
    Posts:
    3
    Hello Microeyes.
    I'm so happy I find this post!!
    but the new plugin does not work in my side.
    I just open the sample project, and build and run.
    Running is ok. 4 buttons are showed.
    But the function does not work.
    So I changed publishID for mine.
    The result is same.
    is there anything to do?

    my device is android 2.3.6 gingerbread.
    and I'm using Unity 3.5.3
     
    Last edited: Jul 18, 2012
  41. KMI

    KMI

    Joined:
    Jul 11, 2012
    Posts:
    9
    Ohmy, MicroEyes, you are the man! It works, can't believe it, after the 3 days trying to get the previous plugin work this one worked like a charm. Just import, add to gameobject and it instantly works!

    Once again, great work!
    Ill be back with my Google Play link to my game in a few days to show what you helped to accomplish.

    Hat's down to you!

    KMI
     
  42. KMI

    KMI

    Joined:
    Jul 11, 2012
    Posts:
    9
    Hi DreamingP, for me the ad's did not appear on the emulator but when i ran the test project on my real device it showed ad's perfectly (I used my own ID)
     
  43. DreamingP

    DreamingP

    Joined:
    Jul 18, 2012
    Posts:
    3
    I tested on my real device, too.

    btw, on my admob webpage, the request field goes up.
    i cant understand.
    so i changed arguments of Instantiate() function and build n run several times.
    but the ad did not appear.
     
  44. Abomb

    Abomb

    Joined:
    Feb 20, 2010
    Posts:
    27
    Hi!
    first of all thanks for your hard work with this plugin!
    Including it in a project couldn't be easier, but when I run the testscene on my device (Galaxy Nexus), I get the following error in logcat:

    I/Ads (11270): onReceiveAd()
    I/ADMOB (11270): Adv Received
    I/ADMOB (11270): Adv displaying
    I/ADMOB (11270): hasGotAdv is false
    I/ADMOB (11270): leaving is false
    W/Ads (11270): Not enough space to show ad! Wants: <640, 100>, Has: <720, 75>
    I/ADMOB (11270): First time Adv STARt
    I/ADMOB (11270): First time Adv END

    Not sure why it should not have enough space ... did I forget to change / configure something?

    Thanks!
     
  45. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hi Adomb,
    Ohh.. i m really apologizing for this issue. I have updated my plugin. Please use it.
     
  46. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hi DreamingP,
    I think you have the same problem what Abomb had. Please use new uploaded package project.


    Thankx
     
  47. DreamingP

    DreamingP

    Joined:
    Jul 18, 2012
    Posts:
    3
    Oh!! It works!!
    Thanks!!!

    was it resolution problem on device?

    anyway, i'll add it on my project.
    Thanks again!!
     
  48. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    No DreamingP, It was my mistake.
     
  49. Abomb

    Abomb

    Joined:
    Feb 20, 2010
    Posts:
    27
    Everything works perfectly now! Thanks again for this awesome unity package!

    One small thing, whenever a new ads load it uses the fade out / fade in animation. is it possible to disable the animations?
    Also can the ad refresh time be set / changed?
     
    Last edited: Jul 19, 2012
  50. MicroEyes_old

    MicroEyes_old

    Joined:
    Jun 9, 2011
    Posts:
    188
    Hey Adomb,
    I will add these two following features in later build.
    1. Change refresh time.
    2. Ads without animation.
     
unityunity