AdMob wont repond to Clicks - Unity - android

I have recently finished an android game and I am struggling to enable my ads. They show just fine whenever I want them to, but I can't seem to click them at all. I think the issue may be within my manifest file, but through all my googling I found no solutions that seemed to work for me.
Here is my AndroidManifest.xml:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<application
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:debuggable="true">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name="com.unity3d.player.VideoPlayer"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>
This is located within Assets > Plugins > Android, the files I have located within here are as such:
AndroidManifest.xml
com.microeyes.admob.jar
GoogleAdMobAdsSdk-6.0.1.jar
There are no objects in front of the ad. My game consists of an empty screen with few objects falling occasionally. These objects can (read: can't) be seen behind the Ad.
This line is one that I found from Unity Answers and may or may not be used properly here (Line 18):
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
I used This source (Android version) to create the ads. They generate just fine using the cs scripts, only touching them takes me to no source.
Within my Ad Manager file, I have input my AdMob code. However, I'm unsure if I need all of the information that I have put here. I am using the format:
ca-app-pub-XXXXXXXXXXXXXXXXX/XXXXXXXXXX
Each X representing a number (can't link that thing) - is this the correct format? I am unsure or if I should be using the "ca-app-pub" section, or if I need only the numbers from one side of the /.
Any help would be greatly appreciated, thanks. Any more required information can be given, but I believe this is all that is required.
AdvertisementManager.cs
AdvertisementHandler.cs

Try to add this line
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
In to UnityPlayerActivity:
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>

Related

Activity restarts after showing Admob Rewarded Video ad

I want to update my Activity UI inside onRewardedVideoAdClosed() if user Rewarded , but unable to update any view of my activity due to activity is destroying when rewarded video ad open,
If I'm doing anything wrong, then what? can anyone let me know? because same issue I'm getting in this SampleCode as well.
Finally, I have fixed the issue,
Just added this property in my activity android:configChanges="orientation|screenSize"
Now my activity looks like
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
A nice sample is here
If you are using Unity this also works!
You need to edit the AndroidManifest.xml template that can be found in:
OSX: ~/Applications/Unity/PlaybackEngines/AndroidPlayer/Apk/AndroidManifest.xml
Windows: installation\Editor\Data\PlaybackEngines\androidplayer
*See more details in this Unity Question
Here is my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<application
android:theme="#style/UnityThemeSelector"
android:icon="#drawable/app_icon"
android:label="#string/app_name">
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:label="#string/app_name"
android:configChanges="orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
</application>
</manifest>
As you can see I added android:configChanges="orientation|screenSize" to the activity.
Please note you could instead copy that AndroidManifest.xml file into your Assets/Plugins/Android folder as a per project solution, otherwise this will affect all your Unity projects (if I understand correctly).

SDKBOX Unable to login into facebook on an android device

I've used SDKBOX to integrate facebook in my cocos2dx project but I am unable to login into facebook on android device. I think I am missing a minor thing. Can somebody help me on this?
Ps I have so far managed to login and share on ios devices but when i try to do the same thing on android i face issues.
Cocos2dx 3.9
Latest Sdkbox.
Device Nexus 4.
Android Manifest file.
<uses-sdk android:minSdkVersion="9" />
<uses-feature android:glEsVersion="0x00020000" />
<application hardwareAccelerated="true" android:icon="#drawable/icon" android:label="#string/app_name">
<meta-data android:name="android.app.lib_name" android:value="cocos2dcpp" />
<activity android:configChanges="orientation" android:label="#string/app_name" android:name="org.cocos2dx.cpp.AppActivity" android:screenOrientation="portrait" android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="#string/app_name" android:name="com.facebook.FacebookActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar" /><meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id" />
<provider android:authorities="com.facebook.app.FacebookContentProvider1602801803302391" android:exported="true" android:name="com.facebook.FacebookContentProvider" />
</application>
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
Your AndroidManifest.xml seems fine.
Could you please check Manual Integration For Android and Android Studio section in this link and make sure that all things are there for you ?
Best,
Pabitra

Soomla GooglePlayIabService

Hi I have used the older version of soomla plugin in my android app and it was working fine, but when i try to integrate into the latest version(core version : 1.0, StoreVersion : 1.7.3) available this error pops up.
SOOMLA GooglePlayIabService
(launchPurchaseFlow) Error purchasing item calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
SOOMLA SoomlaStore
ERROR : SoomlaStore failure(launchPurchaseFlow) Error purchasing item Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. is this really what you want?
When i created an empty project and tried the plugin i could make the purchase successfully. Same is not happening for the project i want it to work with. Also using Facebook unity plugin. Unity version is 4.5.3.
11-24 16:38:39.497: E/SOOMLA GooglePlayIabService(12139): (launchPurchaseFlow) Error purchasing item Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
11-24 16:38:39.497: E/SOOMLA SoomlaStore(12139): ERROR: SoomlaStore failure: (launchPurchaseFlow) Error purchasing item Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
AndroidManifest file is below.
![<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_TASKS" />
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<uses-sdk android:targetSdkVersion="21" android:minSdkVersion="9" />
<application android:icon="#drawable/app_icon" android:label="#string/app_name" android:debuggable="true" android:name="com.soomla.SoomlaApp">
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
<activity android:name="com.unity3d.player.VideoPlayer" android:label="#string/app_name" android:screenOrientation="behind" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.soomla.store.billing.google.GooglePlayIabService$IabActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<meta-data android:name="billing.service" android:value="google.GooglePlayIabService" />
<activity android:name="com.facebook.unity.FBUnityLoginActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<activity android:name="com.facebook.LoginActivity" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true">
</activity>
<activity android:name="com.TeenPatti.RoyalIndianPoker.MainActivity" android:label="#string/app_name">
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 1499084616994189" />
</application>
</manifest>][1]
Here is the screenshot for the logcat error
There seemed to be an issue with AndroidStoreGooglePlay.jar. Changing it to the latest commit fixed the issue for me latest commit. Hope it might help others too.

Android app is shown as not compatible in play store

I have published a new update of my App. After publishing it got a warning like "Warning: Your active APK supports less devices then the previous APK. Some users won't get the update."
So i've compared the details of the current and the prior APK. There is only one difference: The new one has the additional entry "Native Platform: simple-xml.2.6.9.jar".
Do you think that there is a problem with it? Acutally i've intergrated the .jar into my android project.
Additionally, the developer console shows me that the app is now compatible with 0 devices... if i search for a certain device i get a notice that it's because of my manifest settings.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.kit.aifb.nukit"
android:versionCode="8"
android:versionName="#string/app_versionName" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="17" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.KIT.Styled"
android:allowBackup="true" >
<activity
android:name="edu.kit.aifb.nukit.gui.SplashScreenActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/Theme.Sherlock.Light.NoActionBar"
android:clearTaskOnLaunch="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="edu.kit.aifb.nukit.gui.ChooseCourseActivity"
android:screenOrientation="portrait"></activity>
<activity
android:name="edu.kit.aifb.nukit.gui.QuestioningAndVotingActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden"></activity>
<activity
android:name="edu.kit.aifb.nukit.gui.AnswerQuestionActivity"
android:screenOrientation="portrait"></activity>
<activity
android:name="edu.kit.aifb.nukit.gui.ShowResultsActivity"
android:screenOrientation="portrait"></activity>
<activity
android:name="edu.kit.aifb.nukit.gui.ImpressumActivity"
android:screenOrientation="portrait"></activity>
<activity
android:name="edu.kit.aifb.nukit.gui.LicensesActivity"
android:screenOrientation="portrait"
android:hardwareAccelerated="false"></activity>
<activity
android:name="edu.kit.aifb.nukit.gui.survey.SurveyListActivity"
android:screenOrientation="portrait"></activity>
<activity
android:name="edu.kit.aifb.nukit.gui.survey.QuestionActivity"
android:screenOrientation="portrait"
android:parentActivityName=".SurveyListActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".SurveyListActivity" />
</activity>
<activity
android:name="edu.kit.aifb.nukit.gui.survey.SurveyResultsActivity"
android:label="SurveyResultsActivity"
android:parentActivityName=".SurveyListActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".SurveyListActivity" />
</activity>
</application>
if i install the apk directly on my device, it works fine.
This should probably be due to changes done in your Android Manifest relating to max and min sdk versions
<uses-sdk android:minSdkVersion="integer"
android:targetSdkVersion="integer"
android:maxSdkVersion="integer" />
If this SDK version range has been altered, your new updated app might support lesser number of devices.
Alright, i fixed it.
The problem was that actualy only the SurveyLib.jar is using simple-xml-2.6.9.jar and the simplexml.jar was included within the SurveyLib.jar. So i think there was a problem dexing the simplexml.jar within surveylib.jar.
i've created the surveylib.jar again without simplexml.jar but included the simplexml.jar to the libs folder of my app.
now it works fine. thanks to you all for your help.

Friends android devices cannot install my android app, I cant even do it for my own

I recently uploaded my android app to the marketplace https://market.android.com/details?id=com.DGNT yet my friends cannot install it on their devices (says their phone is incompatible). The site even says my own phone is incompatible for my own app, even though i have compiled it through eclipse and sucessfully installed the apk on my phone and tablet. (telus LGE LG-p500h and asus transformer tf101)
Is there something wrong with my app or should i just wait a little longer to see what happens? Ive been told my manifest could have something to do with it so here is what i got.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.DGNT"
android:versionCode="2"
android:versionName="1.01">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.SEND_SMS"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="com.DGNT.MainScreenActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.DGNT.QuickStartActivity"
android:label="Quick Start"
android:screenOrientation="portrait">
</activity>
<activity android:name="com.DGNT.ManagePlayersActivity"
android:label="Manage Players">
</activity>
<activity android:name="com.DGNT.PlayerListActivity"
android:label="Start From Player List"
android:screenOrientation="portrait">
</activity>
<activity android:name="com.DGNT.EditPlayersActivity"
android:label="Edit Players">
</activity>
<activity android:name="com.DGNT.CreditsActivity"
android:label="Credits">
</activity>
<activity android:name="com.DGNT.HelpActivity"
android:label="Help">
</activity>
<activity android:name=".AboutActivity"
android:label="About">
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
</manifest>
You should definitely have a <supports-screens /> element in your manifest to list the screen sizes your app is compatible with. Try adding this just after your opening manifest tag:
<supports-screens
android:xlargeScreens="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true" />
That should open up the app for any type of screen. Obviously I'm assuming here that you want it available for any screen size, so tweak as needed! More details here.
Hope that solves it for you

Categories

Resources