I have read every single question on here about the "you must have AdActivity declared in AndroidManifest.xml with configChanges" error.
I've also tried every single solution offered. Changed the target sdk in project.properties, etc.
I'm stumped. Not that it is any different than all the others, but here is my manifest:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
>
<activity
android:name=".Main"
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.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>
/>
</application>
Using version 4.3.1. Have created the libs folder, added the jar, did project clean, exited and restarted eclipse, EVERYTHING I could think of. Any suggestions?
adMob AdActivity should be like this...
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" >
</activity>
Related
From the documentation on google play I learned that the android:name is also important when searching for and application. My application is called "Bike Dice", but will only appear when searched as "BikeDice", which is the name in the AndroidManifest.xml file. I tried changing it to "Bike Dice", which breaks the code and the application crashes on launch, but when I tried updating it like that in google play, I found out that it appears first when searching for "Bike Dice".
So my question is: Is there a hack or something, that allows you to have two words as android:name?
EDIT: Here is my AndroidManifest.xml file:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:versionCode="102" android:versionName="0.1.2" android:windowSoftInputMode="adjustPan" package="com.dice.bike" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<application android:debuggable="false" android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="#string/app_name" android:launchMode="singleTop" android:name="BikeDice" android:screenOrientation="portrait" android:theme="#android:style/Theme.Black.NoTitleBar">
<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" />
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:name="com.google.android.gms.ads.AdActivity" android:theme="#android:style/Theme.Translucent" />
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
Notice that your manifest already has an attribute called android:label which was automatically generated.
android:name="BikeDice"
android:icon="#drawable/icon"
android:label="#string/app_name"
So you just need to select the res/values/string.xml file and replace the content of app_name with Bike Dice within the <resources> set of tags
<string name="app_name">Bike Dice</string>
Right now, it may just be saying BikeDice, because that's probably what you specified as an application name when you first used the new Android Project wizard.
Ok, this has taken over a week, but I finally found the cause of why I can't seem to log in to facebook using the Facebook SDK (v4.3.4) with Unity3d (v4.3) on my android devices. Now to figure out how to fix it... ?
Symptom:
I run the application on the android device. When I press the login button, it opens the permissions prompt from facebook. Then... nothing. The login doesn't complete, and looking through the logs, its clear that the LoginCallback isn't being called. (Although Facebook appcenter does record that you've granted permission to the app). If I asked for multiple permissions, it only prompts for the first one. (normally it will prompt for the first one, appear to go back to the application for a split second, then prompt again for the second).
Cause:
The manifest file is being incorrectly generated.
Here's an example of the one manifest file for FriendSmash when its generated CORRECTLY:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:theme="#android:style/Theme.NoTitleBar" android:versionCode="1" android:versionName="1.0" package="com.mycompany.mygame" android:installLocation="preferExternal">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
<application android:icon="#drawable/app_icon" android:label="#string/app_name" android:debuggable="true">
<activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="#string/app_name" android:launchMode="singleTask" android:name="com.facebook.unity.FBUnityPlayerActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="#string/app_name" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity">
</activity>
<activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="#string/app_name" android:launchMode="singleTask" android:screenOrientation="reverseLandscape" android:name="com.mycompany.mygame.UnityPlayerNativeActivity">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
<activity android:configChanges="keyboardHidden|orientation" android:name="com.facebook.LoginActivity" android:screenOrientation="portrait">
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 586438214724597" />
</application>
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.touchscreen" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>
Here's an example of the manifest file for FriendSmash when its generated INCORRECTLY:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:theme="#android:style/Theme.NoTitleBar" android:versionCode="1" android:versionName="3.0" package="com.mycompany.mygame" android:installLocation="preferExternal">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
<application android:icon="#drawable/app_icon" android:label="#string/app_name" android:debuggable="true">
<activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="#string/app_name" android:launchMode="singleTask" android:screenOrientation="reverseLandscape" android:name="com.mycompany.mygame.UnityPlayerNativeActivity">
<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="false" />
</activity>
<activity android:configChanges="keyboardHidden|orientation" android:name="com.facebook.LoginActivity" android:screenOrientation="portrait">
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 586438214724597" />
</application>
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.touchscreen" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>
Two main differences: (1) The main activity for the correct manifest file is named "com.facebook.unity.FBUnityPlayerActivity" and for the incorrect file its "com.mycompany.mygame.UnityPlayerNativeActivity", and (2) the correct file also has a "com.unity3d.player.UnityPlayerActivity" and the "com.mycompany.mygame.UnityPlayerNativeActivity" appears after it.
But unfortunately, most of the time, Unity is generating the incorrect version of the file. I've tested it with the FriendSmash game, tested a custom app that adds the facebook sdk, and tested another sample app that only contains the facebook SDK (all on both windows and mac). They all generated the wrong version, except by chance, the first time I downloaded the FriendSmash complete project. And when I downloaded FriendSmash fresh to test on mac, it started generating the file incorrectly as well.
Additionally, if you just try to build the apk file in unity without creating the Google Android Project, it uses the wrong manifest and builds a broken app.
Solution:
No Idea. Anyone have any thoughts on how to fix this?
Ok, so it seems the manifest file being provided in the new version of the sample project and in the new SDK unity package are used to build the custom manifest file that the Google Android Project uses. It must have been updated incorrectly and is what is causing the problems.
To fix, after you import the Facebook SDK, just replace the file at Assets/Plugins/Android/AndroidManifest.xml with the old version:
<?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:theme="#android:style/Theme.NoTitleBar" 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.facebook.unity.FBUnityPlayerActivity" android:launchMode="singleTask" 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:launchMode="singleTask" 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:launchMode="singleTask" 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="false" />
</activity>
<activity android:name="com.facebook.LoginActivity" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation">
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 586438214724597" />
</application>
</manifest>
I haven't yet tested this with building a new Google Android Project, but I was able to directly build the apk file and run it on the phone.
I created an Android app with Phonegap. When the app runs and I flip the phone into landscape it simply crashes. I already tried adding this to my manifest:
android:configChanges="orientation|keyboardHidden"
also tried:
android:configChanges="orientation|screenSize|keyboardHidden"
No effect. Any suggestions?
Update:
This is what logcat tells me when the app crashes: http://dl.dropbox.com/u/17844821/zeug/logcat.txt
Update:
This is my manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.foo.bar"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="15" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:configChanges="orientation|keyboardHidden"
android:name=".MainActivity"
android:label="#string/title_activity_main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Make sure that put those in the activity tag like this:
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize
|locale">
and close it after them.
I have this problem once and I made this mistake.
Do you have the INTERNET permission in your AndroidManifest.xml? Based on the exception it looks like the CallbackServer can't open a socket which would cause a bunch of problems.
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.
I have an app that works fine from emulator or on device testing, but when installed from the market it can't install with the fllowing error:
"package file has bad manifest"
what could be causing this? I've been checking through the manifest dozens of time without results.
[EDIT]
Here is the manifest with some sensitive parts edited
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.xxx"
android:versionCode="7"
android:versionName="1.55">
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="8" />
<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true"/>
<application android:label="My App"
android:icon="#drawable/icon"
>
<activity
android:label="My App"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation"/>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>
'