I registered on leadblot. Download their SDK.
Create folder in my project: Plugins->Android.
Copy AndroidManifest in this folder and sdk which i download.
That's all I did in the example that was in the folder with the SDK.
This file: https://docs.google.com/document/d/1plndrafMw-jBQT6RfUL8H9TfbJcHlh_LgtxPXnLLXIU/pub
My AndroidManifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.ALTIMGAMES.SUV" android:versionName="1.0" android:versionCode="1">
<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="false">
<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" android:screenOrientation="landscape">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<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" android:screenOrientation="landscape">
</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" android:screenOrientation="landscape">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
<receiver android:name="com.hewzyntzcrsflwjnemv.ReEngagement" />
<service android:name="com.hewzyntzcrsflwjnemv.ReEngagementService" />
<service android:name="com.hewzyntzcrsflwjnemv.AdBootReceiverService" />
</application>
<uses-feature android:glEsVersion="0x00020000" />
<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"/>
<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" />
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
</manifest>
My c# code(where i use adbolt):
using UnityEngine;
using System.Collections;
public class LeadBoltAD : MonoBehaviour {
// Use this for initialization
void Start () {
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("currentActivity");
using(AndroidJavaObject ad = new AndroidJavaObject("com.unity.wrapper.LeadBoltUnity", jo)){
ad.Call("loadAd","820080475");
}
}
// Update is called once per frame
void Update () {
}
}
I install my app. When app start he is crash..
Help me please...
You need to set
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
to
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
as explained in Step 6 of the readme file that you posted.
Besides that, I'd need more information to be able to help. From the command-line you can launch adb logcat with your test phone plugged into your computer to stream any error messages back to your console. That can be useful for finding specific errors.
Related
I am developing an app in Unity and exported it as an AAB file. When uploading it to Google Play Store it says 0 supported devices.
I use Unity version 2020.3.15
The size of the AAB file is around 45 MB
I have the same min and target API level settings as always (API level 24 and highest respectively).
When installing directly to my phone I can play the game and it works as expected.
I have previously released a game which got over 9000 supported device. The only difference is that the new app needs camera permission for the AR Foundation package.
I paste my AndroidManifest file below if that helps. Any idea on why no devices are supported?
<?xml version="1.0" encoding="utf-8"?>
<!-- GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.SGGames.SE"
android:installLocation="preferExternal"
android:versionCode="6"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="24"
android:targetSdkVersion="30" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-feature android:glEsVersion="0x00030000" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen.multitouch"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen.multitouch.distinct"
android:required="false" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature
android:name="android.hardware.camera.ar"
android:required="true" />
<uses-feature
android:name="com.google.ar.core.depth"
android:required="true" />
<queries>
<package android:name="com.google.ar.core" />
</queries>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:extractNativeLibs="true"
android:icon="#mipmap/app_icon"
android:label="#string/app_name" >
<activity
android:name="com.unity3d.player.UnityPlayerActivity"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density"
android:hardwareAccelerated="false"
android:launchMode="singleTask"
android:screenOrientation="landscape"
android:theme="#style/UnityThemeSelector" >
<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>
<meta-data
android:name="unity.splash-mode"
android:value="0" />
<meta-data
android:name="unity.splash-enable"
android:value="True" />
<meta-data
android:name="unity.build-id"
android:value="23094d1f-7ffd-4f03-8914-045a212a3e8c" />
<meta-data
android:name="unityplayer.SkipPermissionsDialog"
android:value="true" />
<meta-data
android:name="com.google.ar.core"
android:value="required" /> <!-- The minimal version code of ARCore APK required for an app using this SDK. -->
<meta-data
android:name="com.google.ar.core.min_apk_version"
android:value="202940000" /> <!-- This activity is critical for installing ARCore when it is not already present. -->
<activity
android:name="com.google.ar.core.InstallActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:excludeFromRecents="true"
android:exported="false"
android:launchMode="singleTop"
android:theme="#android:style/Theme.Material.Light.Dialog.Alert" />
<activity
android:name="com.unity3d.services.ads.adunit.AdUnitActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:hardwareAccelerated="true"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" />
<activity
android:name="com.unity3d.services.ads.adunit.AdUnitTransparentActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:hardwareAccelerated="true"
android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity
android:name="com.unity3d.services.ads.adunit.AdUnitTransparentSoftwareActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:hardwareAccelerated="false"
android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity
android:name="com.unity3d.services.ads.adunit.AdUnitSoftwareActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:hardwareAccelerated="false"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" />
</application>
</manifest>
I am having an issue when I publish my apps on Google Play store since I updated to NS 5.1/Angular 7. I am not an expert with the AndroidManifest.xml file but I will show you what I have added maybe you can figure out what is going on.
This is my old AndroidManifest.xml used in NS 4.X:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android" package="__PACKAGE__" android:versionCode="2070" android:versionName="2.0.7">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="__APILEVEL__" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="#drawable/icon" android:label="#string/app_name" android:theme="#style/AppTheme" android:hardwareAccelerated="true">
<activity android:name="com.tns.NativeScriptActivity" android:label="#string/title_activity_kimera" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="#style/LaunchScreenTheme" android:screenOrientation="portrait">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="#style/AppTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.tns.ErrorReportActivity" />
</application>
</manifest>
This is the new one I am using with NS 5.1/Angular 7:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" package="__PACKAGE__" android:versionCode="2101" android:versionName="2.1.1">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="__APILEVEL__" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="#drawable/icon" android:label="#string/app_name" android:theme="#style/AppTheme" android:hardwareAccelerated="true">
<provider android:name="android.support.v4.content.FileProvider" android:authorities="com.*.*.fileprovider" android:exported="false" android:grantUriPermissions="true" tools:replace="android:authorities">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="#xml/file_paths" tools:replace="android:resource" />
</provider>
<activity android:name="com.tns.NativeScriptActivity" android:label="#string/title_activity_kimera" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="#style/LaunchScreenTheme" android:screenOrientation="portrait">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="#style/AppTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.tns.ErrorReportActivity" />
</application>
</manifest>
Also, I have added these lines to app.gradle file:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == "com.android.support") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "26.+"
}
}
}
}
Since I am using this configuration, the app does not install on my Samsung Galaxy A Tablet.
Also, in some apps it shows a message saying: This app may not be optimized for your device. Not this case.
Any suggestion? Thanks!
I think is because your android support version. The latest version of Nativescript uses 28 so try to remove that change from your gradle
I don't understand why, I just try to push a beta version on google play and I have no compatible devices on this version (look at the screenshot). So when I download the apps, it's install me the current production version but not the beta like expected.
I have no problem to install it on my devices on dev mod with android studio so I know that this app working on my phone.
Someone can help me ? Thanks
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lgondor.simpledice"
>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera2.full" />
<uses-feature android:name="android.hardware.sensor.accelerometer" />
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true">
</supports-screens>
<application
android:allowBackup="true"
android:icon="#drawable/icon_small_shadow"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name="com.lgondor.simpledice.MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.lgondor.simpledice.AddCustomDiceActivity"
android:screenOrientation="portrait">
</activity>
<activity android:name="com.lgondor.simpledice.ManageSwitchActivity"
android:screenOrientation="portrait">
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
<service android:name="com.lgondor.simpledice.services.WearService">
<intent-filter>
<action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" />
</intent-filter>
</service>
</application>
</manifest>
i just want to add banner to mygame but when i build my game,i face to this bug in unity console.
AndroidManifest.xml:4: error: Error: No resource found that matches the given name (at 'banner' with value '#drawable/app_banner').
You can find my AndroidManifest.xml file,
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity.package" android:versionName="1.0" android:versionCode="1" android:installLocation="preferExternal">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:theme="#android:style/Theme.NoTitleBar" android:icon="#drawable/app_icon" android:label="#string/app_name" android:debuggable="false" android:isGame="true" android:banner="#drawable/app_banner">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="#string/app_name" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<!--
The unityplayer.ForwardNativeEventsToDalvik flag is the only difference
from Unity's auto-generated default AndroidManifest.xml. We require this
flag to be true for ads to be clickable.
If you are using another plugin that also ships with an
Assets/Plugins/AndroidManifest.xml, you can use their copy after setting
this flag to true.
-->
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
</application>
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="21" />
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>
#ugur error tells you what is missing as its not in your supplied file list, so you have to put that file in the drawable folder to remove the error..once you add he banner drawable the error will go away
There is a similar question in this link but this didn't work for me:
http://answers.unity3d.com/questions/935508/failed-to-re-package-resources-unity-5.html?sort=oldest
For me changing the AndroidManifest.xml with the following did the trick:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.example.admobtest" android:versionName="1.0" android:versionCode="1">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<!-- Google Mobile Ads Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:icon="#drawable/app_icon" android:label="#string/app_name">
<!-- meta-data tag for Google Play services -->
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"/>
<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" >
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</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="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="unity" />
</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>
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
</manifest>
I had banner.png at correct place and rest of the things were also ok.
It worked when I updated sdk to latest with help of "SDK Manager"
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.