nabrozidhs / unity_admob_android

Basic Unity3D plugin for AdMob Google Play Services version.
MIT License
25 stars 13 forks source link

Banner is not clickable #7

Closed ugur2372 closed 10 years ago

ugur2372 commented 10 years ago

Hello,

Firstly, thank you for this plugin. I got the plugin. I added into my unity game but i have a problem. The ads shows up without a problem. The interstitial ad is clickable but i can't click to the banner. I have tried this

http://forum.unity3d.com/threads/195169-Google-Admob-plugin-for-Unity-ad-is-not-clickable

but nothing's changed.

You told about UnityPlayerNativeActivity in Readme. There isn't any activity block in my manifest like this. I have tried to add something like this:

``` ```

But when i add this in manifest file, it gets compile error like this:

Error building Player: CommandInvokationFailure: Unable to merge android manifests. Trying to merge incompatible /manifest/application/activity[@name=com.unity3d.player.UnityPlayerNativeActivity] element:

Could you give me an advice or simple example how i can solve this. I'm a newbie and sorry for bad English.

Thanks..

nabrozidhs commented 10 years ago

Can you upload your AndroidManifest.xml?

My guess is that you are not adding the tag meta-data as a child of the UnityPlayerNativeActivity activity tag.

ugur2372 commented 10 years ago

This is my manifest:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.example.games.mainlibproj" android:versionCode="1" android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" /> 

<application>
    <meta-data android:name="com.google.android.gms.games.APP_ID"
            android:value="\ 123456789123" /> 
    <meta-data android:name="com.google.android.gms.appstate.APP_ID"
            android:value="\ 123456789123" /> 
    <meta-data android:name="com.google.android.gms.version" 
            android:value="@integer/google_play_services_version" /> 
    <activity android:name="com.google.example.games.pluginsupport.SignInHelperActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    <activity android:name="com.google.example.games.pluginsupport.SelectOpponentsHelperActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    <activity android:name="com.google.example.games.pluginsupport.InvitationInboxHelperActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

    <activity android:name="com.google.android.gms.ads.AdActivity"
      android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>        

    <activity android:name ="com.unity3d.player.UnityPlayerProxyActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">             
        <meta-data  android:name ="unityplayer.ForwardNativeEventsToDalvik" android:value ="true" />
    </activity>

</application>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

nabrozidhs commented 10 years ago

Replace the UnityPlayerProxyActivity activity with the following:

<activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
ugur2372 commented 10 years ago

I tried but gives me this error when building:

Error building Player: CommandInvokationFailure: Unable to merge android manifests. See the Console for more details. C:\Program Files (x86)\Java\jdk1.8.0\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

stderr[ Error: [Temp\StagingArea\AndroidManifest-main.xml:4, C:\Users\UĞUR\Documents\DefendTheCore\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml:23] Trying to merge incompatible /manifest/application/activity[@name=com.unity3d.player.UnityPlayerNativeActivity] element: <activity -- @android:name="com.unity3d.player.UnityPlayerNativeActivity"> -- -- <action <activity ++ @android:name="com.unity3d.player.UnityPlayerNativeActivity" ++ @android:screenOrientation="landscape"> ++ <meta-data ] stdout[

]

nabrozidhs commented 10 years ago

That's weird are you on the latest Unity3D version? I would also try to remove the Temp folder on your unity project root directory.

ugur2372 commented 10 years ago

Yes, i updated the Unity3d to 4.3.4 but still the same error. I used this https://github.com/playgameservices/play-games-plugin-for-unity plugin too. It may be related?

nabrozidhs commented 10 years ago

The other plugin shouldn't affect (the point of this plugin to work with the google play services).

Have you tried removing or renaming the Temp folder on your project root directory? Close Unity before doing that (just in case).

ugur2372 commented 10 years ago

Yes, i have tried remove the Temp folder on my project root directory. But still gives me the same error when building:

Error building Player: CommandInvokationFailure: Unable to merge android manifests. See the Console for more details. C:\Program Files (x86)\Java\jdk1.8.0\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

stderr[ Error: [Temp\StagingArea\AndroidManifest-main.xml:4, C:\Users\UĞUR\Documents\DefendTheCore\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml:23] Trying to merge incompatible /manifest/application/activity[@name=com.unity3d.player.UnityPlayerNativeActivity] element: <activity -- @android:label="@string/app_name" -- @android:name="com.unity3d.player.UnityPlayerNativeActivity"> -- <activity ++ @android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" ++ @android:label="@string/app_name" ++ @android:launchMode="singleTask" ] stdout[

]

manjunaths242 commented 10 years ago

Could you please make a video tutorial for this? I am not actually getting how to use the plugin. I am stuck because of this.

lhes commented 10 years ago

Doesn't the manifest merging issue come up when the min sdk values are not the same in different manifest files? Just make sure they are all 8 (or 9).

ugur2372 commented 10 years ago

The manifest merging issue doesn't come up. I set all manifest files min sdk version is 9. But still doesn't clickable. Thanks anyway.

nabrozidhs commented 10 years ago

I'm closing this issue since it seems that it's a user specific problem.