Unity Admob Banner is not clickable - android

I'm developing an Android game with Unity. I used this plugin for Admob. The Interstitial ad is clickable but when i click the banner nothing's happen. I tried this but nothing's changed. Additionally, i tried add com.unity3d.player.UnityPlayerNativeActivity Activity in manifest file and i got this error:
Trying to merge incompatible
/manifest/application/activity[#name=com.unity3d.player.UnityPlayerNativeActivity]
element:
How can i solve this problem? Any suggestions will make me happy. Thanks.
Here is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<!-- This file was automatically generated by the Google Play Games plugin for Unity
Do not edit. -->
<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">
<intent-filter>
<action android:name ="android.intent.action.MAIN" />
<category android:name ="android.intent.category.LAUNCHER" />
</intent-filter>
<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"/>
</manifest>

Check your minimum sdk version in unity. You have declared it 8 and in google play services by default min sdk is 9. Try changing your sdk to 9 in the unity and hope it will work.

Related

Google maps android V2 error at manifest [duplicate]

This question already has answers here:
Google Play Services Library update and missing symbol #integer/google_play_services_version
(26 answers)
Closed 7 years ago.
Someone please help me, i have project to get current location latitude and longitude. i got the project from androidhive.
when i complie it, i got an error
java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4452000 but found 6587000. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
its my androidmanifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.koenb_fashion_fix"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<application
android:name="com.koen_bfashion.image.AppController"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/MyTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<meta-data
android:name="android.app.default_searchable"
android:value=".SearchResultsActivity" />
</activity>
<activity android:name="SplashScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="LoginLayout"></activity>
<activity android:name=".SearchResultsActivity" android:parentActivityName="com.koenb_fashion_fix.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
</activity>
<activity android:name="Tampil_Produk_Fragment"></activity>
<activity android:name="Transfer_Layout"></activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDG5xQBueWTP8GrXQbaRmnJdVZO73KwRAQ" />
<activity android:name="MainActivity2"></activity>
</application>
</manifest>
im sure the API KEY is correct, and i have added
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
and the library of the google-play-service-lib is 22
i'm confuse, can someone tell me why i still get that error?
You need to also include the google play services version that your app is referencing. So just add a reference to the integer where this is stored below your API_KEY meta-data.
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDG5xQBueWTP8GrXQbaRmnJdVZO73KwRAQ" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Just you need is to add the gms version information in manifest :
<activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDG5xQBueWTP8GrXQbaRmnJdVZO73KwRAQ" />
<activity android:name="MainActivity2"></activity>
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
If you do not add android:name="com.google.android.gms.version" in meta data then the wrong value is fetched and error comes :
The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4452000 but found 6587000
Try passing the values <meta-data android:name="com.google.android.gms.version"
android:value="6587000" /> but this may cause error in some api's

Android Google Map v2 signed apk doesn't work

Yet another question on GoogleMaps Api Key and release mode.
I have my API key, correctly added the SHA-1 in the allowed Android Applications, copied the key in the manifest and the same in both google_maps_api.xml (debug, release) in Android Studio.
In debug everything works fine, but when I install the app through the Signed Apk it shows me gray screen and google logo.
Anyone knows what I can do about that?
Any help would be much appreciated.
This is my AndroidManifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.permission.C2D_MESSAGE" />
<application
android:name=".app.AppController"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Welcome"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/FullscreenTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".MenuActivity"
android:label="#string/title_activity_menu"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".GalleryActivity"
android:label="#string/title_activity_gallery"
android:screenOrientation="portrait" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.MainActivity" />
</activity>
<activity
android:name=".TripActivity"
android:label="#string/title_activity_trip"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".PromoActivity"
android:label="#string/title_activity_promo"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".ContactActivity"
android:label="#string/title_activity_contact"
android:screenOrientation="portrait" >
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key" />
I think you generated SHA fingerprint key from machine A and compiled your android project in machine B. That's one of reason you may get blank screen. Please build your android project in machine A.
I think that you miss google play services. You need to have it in order to use Google Maps API v.2 You can get it from here or here.
Did you implement the map in xml code like this:
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
also implement map in java?
GoogleMap googleMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
googleMap.getUiSettings();
googleMap.getUiSettings().setZoomControlsEnabled(true);
There is more info about Google Maps here
Also if you have any question just ask
Update:
This part of the code:
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key" />
needs to implemented right after the activity of the class where the map is located/
For example if the map is located in Welcome class the the manifest should look like this:
<permission
android:name="com.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.permission.C2D_MESSAGE" />
<application
android:name=".app.AppController"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Welcome"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/FullscreenTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key" />
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".MenuActivity"
android:label="#string/title_activity_menu"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".GalleryActivity"
android:label="#string/title_activity_gallery"
android:screenOrientation="portrait" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.MainActivity" />
</activity>
<activity
android:name=".TripActivity"
android:label="#string/title_activity_trip"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".PromoActivity"
android:label="#string/title_activity_promo"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".ContactActivity"
android:label="#string/title_activity_contact"
android:screenOrientation="portrait" >
</activity>
Update
Check if you have updated google play services in android sdk and also check in gradle if you have added this line in dependencies :
compile 'com.google.android.gms:play-services:7.0.0'
I have just same issue and i know why.
Check the logcat if you find:
Google Maps Android API: Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
Google Maps Android API: Ensure that the "Google Maps Android API v2" is enabled.
Google Maps Android API: Ensure that the following Android Key exists:
Google Maps Android API: API Key: YOUR_KEY_HERE
Google Maps Android API: Android Application (<cert_fingerprint>;<package_name>): xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx;com.example
Check file google_maps_api.xml in folder
app\src\debug\res\valuess
and
app\src\release\res\values
For debug is another file with API that in release.

Android Manifest doesn't find <meta-data>

I'm trying to configure my app to program Chromecast featured button.
I'm reading all chromecast SDK and it says that i have to install Google Play Services.
I linked the library to my project, at the same workspace. I did it well because I have a new Android Dependencies library called google_play_services.jar
When I reach this point, I want to test if googlePlayServices are available, so I want to use:
GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
and print a Log with the result.
But the problem appeared here. When I run my app, it says that is not in my Android Manifest.
My Android Manifest has these lines already:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.chromecastAPP"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.chromecastAPP.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Any different solution?
Thank you
Meta-data must be in application tags.
"Edit your application's AndroidManifest.xml file, and add the following declaration within the <application> element. This embeds the version of Google Play services that the app was compiled with." Look this link.
Try this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.chromecastAPP"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.chromecastAPP.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
I also Faced this problem. I just updated my SDK Google Play Service with its update Version and it worked for me...
Try it may be it works for you also..

AndroidManifest.xml fails to run on device but compiles correctly

I have built an Android app using Unity3d, written in C#. I'm trying to integrate Inneractive (http://inner-active.com/) Ads, for it to work I need to change the Android Manifest.xml, I have absolutely no knowledge of this and can't find the answer via google.
The XML returns no errors in Unity when I compile my app, the app is pushed to the device but fails to run...I have attempted to merge 2 AndroidManifest.Xml to give my app access to both, I don't think I have done this correctly, as far as I can google it's not possible for me to simply have 2 AndroidManifest.xml's?
<?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">
<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">
<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">
</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:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name=".InneractivePluginActivity"
android:label="#string/app_name"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
</manifest>
Have you tried validating your AndroidManifest.xml? Reference: Validating AndroidManifest.xml file.
I'd use the aapt tool and see what error you get while compiling the application. That should help you pinpoint the problem.
Also, it might help to go through the different tags and the properties in the Manifest and verify that they exist in the corresponding API version of Android as some properties for tags are added in newer versions of Android.

Android app is not visible in mobile app store but from browser its is availabe

I have uploaded the android app in the android app store. The app is not visible from the mobile app store but from my browser it is visible.
The devices I have tried:
GT-S5360 (Samsung) gingerbread
A60 (Micromax) gingerbread
The AndroidManifest.xml code is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hyperwebenable.techpanels"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="4" />
<application android:icon="#drawable/sitelogo"
android:label="#string/app_name">
<activity android:name=".MessageList"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SecondActivity"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<meta-data android:name="com.mobclix.APPLICATION_ID"
android:value=""/>
<activity
android:name="com.mobclix.android.sdk.MobclixBrowserActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
</application>
<uses-sdk android:minSdkVersion="2" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission
android:name="android.permission.READ_PHONE_STATE">
</uses-permission>
</manifest>
Please let me know what I am doing wrong here.
I'm not sure if this could cause a problem, but your uses-sdk is defined twice (with a different minSdkVersion). Try removing the second one.

Categories

Resources