Hello,
I am trying to implement Facebook Audience Network to my unity project. When I try sample scenes that is provided by sdk, I get an null object reference error.
NullReferenceException: Object reference not set to an instance of an object
AudienceNetwork.AdViewBridgeAndroid.Create (System.String placementId, AudienceNetwork.AdView adView, AudienceNetwork.AdSize size) (at Assets/AudienceNetwork/Library/AdView.cs:470)
AudienceNetwork.AdView..ctor (System.String placementId, AudienceNetwork.AdSize size) (at Assets/AudienceNetwork/Library/AdView.cs:117)
AdViewScene.LoadBanner () (at Assets/AudienceNetwork/Scenes/Banner/AdViewScene.cs:39)
I looked at the line of error and as I understand, object of AndroidJaveObject class can't be instantiated.
public override int Create(string placementId,
AdView adView,
AdSize size)
{
AdUtility.prepare();
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = unityPlayer.GetStatic("currentActivity");
if(currentActivity==null){
//CURRENT ACTIVITY IS THE VARIABLE THAT CAUSES ERROR WHILE IT IS NULL
Debug.LogError("No current activity");
}
AndroidJavaObject context = currentActivity.Call("getApplicationContext");
AndroidJavaObject bridgedAdView = new AndroidJavaObject("com.facebook.ads.AdView",
context,
placementId,
javaAdSizeFromAdSize(size));
AdViewBridgeListenerProxy proxy = new AdViewBridgeListenerProxy(adView, bridgedAdView);
bridgedAdView.Call("setAdListener", proxy);
AdViewContainer adViewContainer = new AdViewContainer(adView);
adViewContainer.bridgedAdView = bridgedAdView;
adViewContainer.listenerProxy = proxy;
int key = AdViewBridgeAndroid.lastKey;
AdViewBridgeAndroid.adViews.Add(key, adViewContainer);
AdViewBridgeAndroid.lastKey++;
return key;
}
Maybe I am missing initialization of a facebook service, but I followed documentation completely.
Do you have any idea about the cause of this error?
↧
Facebook Audience Network null object reference when creating banner
↧
Unity Facebook plugin FacebookContentProvider not found runtime exception.
I add facebook plugin to my project, follow all the steps.It is working fine in unity editor. when i tried exporting a build and tested on android device it is not working. The app crash on the initial launch itself.It closes immediately.
I tried connecting the app to the adb logcat and found some errors on the log, which is follows.
java.lang.RuntimeException: Unable to get provider com.facebook.FacebookContentProvider: java.lang.ClassNotFoundException: Didn’t find class “com.facebook.FacebookContentProvider” on path: DexPathList[[zip file “/data/app/com.studio.halfo-1/base.apk”],nativeLibraryDirectories=[/data/app/com.studio.halfo-1/lib/arm, /data/app/com.studio.halfo-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
at android.app.ActivityThread.installProvider(ActivityThread.java:5175)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4767)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.access$1600(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.facebook.FacebookContentProvider” on path: DexPathList[[zip file “/data/app/com.studio.halfo-1/base.apk”],nativeLibraryDirectories=[/data/app/com.studio.halfo-1/lib/arm, /data/app/com.studio.halfo-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.ActivityThread.installProvider(ActivityThread.java:5160)
… 10 more
Suppressed: java.lang.ClassNotFoundException: com.facebook.FacebookContentProvider
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
If i tried commenting the FacebookContentProvider in the AndroidManifest.xml file then the app fails on the facebook initialisation. It throws Facebook is not initialised error.
Anyone Please let me know what i am missing on this. My Unity Version is 2018.4.3f1.
,I add facebook plugin to my project, follow all the steps.It is working fine in unity editor. when i tried exporting a build and tested on android device it is not working. The app crash on the initial launch itself.It closes immediately.
I tried connecting the app to the adb logcat and found some errors on the log, which is follows.
java.lang.RuntimeException: Unable to get provider com.facebook.FacebookContentProvider: java.lang.ClassNotFoundException: Didn’t find class “com.facebook.FacebookContentProvider” on path: DexPathList[[zip file “/data/app/com.studio.halfo-1/base.apk”],nativeLibraryDirectories=[/data/app/com.studio.halfo-1/lib/arm, /data/app/com.studio.halfo-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
at android.app.ActivityThread.installProvider(ActivityThread.java:5175)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4767)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.access$1600(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.facebook.FacebookContentProvider” on path: DexPathList[[zip file “/data/app/com.studio.halfo-1/base.apk”],nativeLibraryDirectories=[/data/app/com.studio.halfo-1/lib/arm, /data/app/com.studio.halfo-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.ActivityThread.installProvider(ActivityThread.java:5160)
… 10 more
Suppressed: java.lang.ClassNotFoundException: com.facebook.FacebookContentProvider
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
If i tried commenting the FacebookContentProvider in the AndroidManifest.xml file then the app fails on the facebook initialisation. It throws Facebook is not initialised error.
Anyone Please let me know what i am missing on this. My Unity Version is 2018.4.3f1.
↧
↧
Multiple precompiled assemblies with the same name. Only one assembly with the same name is allowed per platform
it happenes when I import Facebook SDK in the project.
I previously used unity 2019.1.6, then I updated to 2019.1.9 thinking it will make the problem go away. but no.
I have already tried.
1 - remove unity.ads from package manager.
2 - removing ad package from \Packages\mainfest.jason file
these are the only solutions I could find on the internet, but none worked. please help.
↧
Android app crashes on launch after removing Facebook SDK
In order to solve a previous issue (https://answers.unity.com/questions/1648610/no-android-apk-is-made-when-building-64-bit-il2cpp.html?childToView=1648753#answer-1648753), I needed to get rid of Facebook SDK (which isn't use anyway). The app builds and installs fine. However, it crashes as soon as it's launched.
A while back before I tried to build to 64-bit, I attempted to remove Facebook SDK and this same problem occurred. I ended up just keeping it. However, to build to 64-bit I need to remove it. Any help is much appreciated!
↧
Social media assets
I'm trying to find an asset that allows the player to add their score to their social media accounts
Does you know of any?
↧
↧
RegisterMonoModules.h not found iOS facebook SDK
I have this issue when building unity project on xcode, the project includes facebook SDK, unity version is 2019.3.0a6> /Volumes/Samsung_T3/jenkins/workspace/LKF-game-iOS/iOS/Libraries/FacebookSDK/SDK/Editor/iOS/FBUnityInterface.h:22:10:> fatal error: 'RegisterMonoModules.h'> file not found> #include "RegisterMonoModules.h"
↧
can i use unity ads as well as facebook ads in my unity android project?
Currently i am using unity ads .But i want to use unity ads and facebook ads both.Is it good to use both type of ads in my project in order to get more ads?Is it good to use both ads network?
↧
Firebase anonymous account hanging around after facebook sign in.
Hi,
Im using Firebase Authenticate to handle my users social logins, when a user first runs the app an anonymous account is created for them and after logging into facebook their anonymous account is linked to the facebook account and is deleted/merged. When signing into the same facebook account on a different device the user is signed into the facebook account but the anonymous account is still hanging around and will be in the database forever.
It is my understanding that when a user logs into the facebook account from the 2nd device, that we are to handle the "already linked to another user account" by just signing the user in with the facebook credential. This doesnt merge the anonymous account from the second device?
How do I handle the left over anonymous account?
Cheers.
↧
Could not load file or assembly 'Facebook.Unity.Gameroom' Exception occurs on IL2CPP build.
We are getting the following exception while running our game on Facebook Gameroom and calling FB.Init() function.
We are using Unity 2019.1.8f1 and IL2CPP build. If we use mono build this works fine but we want to use IL2cpp only.
FileNotFoundException: Could not load file or assembly 'Facebook.Unity.Gameroom' or one of its dependencies at System.AppDomain.Load (System.String assemblyString) [0x00000] in <00000000000000000000000000000000>:0 at System.Reflection.Assembly.Load (System.String assemblyString) [0x00000] in <00000000000000000000000000000000>:0 at Facebook.Unity.Gameroom.GameroomFacebookLoader.get_FBGameObject () [0x00000] in <00000000000000000000000000000000>:0 at Facebook.Unity.FB+CompiledFacebookLoader.Start () [0x00000] in <00000000000000000000000000000000>:0
We have verified that Facebook.Unity.Gameroom.dll is getting copied to Library/PlayerDataCache\Win\Data\Managed folder but this exception still occurs as soon as game calls FB.Init method.
Let us know if someone knows what causes this issue or any fixes for the same.
We are using Unity 2019.1.8f1 and IL2CPP build. If we use mono build this works fine but we want to use IL2cpp only.
FileNotFoundException: Could not load file or assembly 'Facebook.Unity.Gameroom' or one of its dependencies at System.AppDomain.Load (System.String assemblyString) [0x00000] in <00000000000000000000000000000000>:0 at System.Reflection.Assembly.Load (System.String assemblyString) [0x00000] in <00000000000000000000000000000000>:0 at Facebook.Unity.Gameroom.GameroomFacebookLoader.get_FBGameObject () [0x00000] in <00000000000000000000000000000000>:0 at Facebook.Unity.FB+CompiledFacebookLoader.Start () [0x00000] in <00000000000000000000000000000000>:0
We have verified that Facebook.Unity.Gameroom.dll is getting copied to Library/PlayerDataCache\Win\Data\Managed folder but this exception still occurs as soon as game calls FB.Init method.
Let us know if someone knows what causes this issue or any fixes for the same.
↧
↧
2019.2.0f1 Facebook/SDK .dll not registered console errors on editor start.
Previously posted to forums, but no takers...
Upgraded a project to 2019.2.0f1 from 2018.3.0f2 and now receive the following 4 errors in the console each time the project is started from UnityHub. They readily clear and cause no observable issues, however, my attempts to fix this issue are ineffective to date.
Extension C:/Repos/2019.2.0f1/Editor/Data/PlaybackEngines/Facebook/SDK/7.9.4/Facebook.Unity.Arcade.dll was not registered, that means it relies on default UnityExtensions settings, please register extension and apply necessary settings for it in the callback.
Extension C:/Repos/2019.2.0f1/Editor/Data/PlaybackEngines/Facebook/SDK/7.9.4/Facebook.Unity.Settings.dll was not registered, that means it relies on default UnityExtensions settings, please register extension and apply necessary settings for it in the callback.
Extension C:/Repos/2019.2.0f1/Editor/Data/PlaybackEngines/Facebook/SDK/7.9.4/Facebook.Unity.dll was not registered, that means it relies on default UnityExtensions settings, please register extension and apply necessary settings for it in the callback.
Extension C:/Repos/2019.2.0f1/Editor/Data/PlaybackEngines/Facebook/SDK/7.9.4/FacebookNamedPipeClient.dll was not registered, that means it relies on default UnityExtensions settings, please register extension and apply necessary settings for it in the callback.
Ineffective fixes attempted include:
Running the executable "UnitySetup-Facebook-Games-Support-for-Editor-2019.2.0f1.exe"
From the command prompt (Windows 10, 64 bit):
"sfc /scannow" to fix any corrupt files - ran successfully.
C:\Windows\SysWOW64\REGSVR32 C:/Repos/2019.2.0f1/Editor/Data/PlaybackEngines/Facebook/SDK/7.9.4/Facebook.Unity.Arcade.dll
...and for good measure:
regsvr32 C:/Repos/2019.2.0f1/Editor/Data/PlaybackEngines/Facebook/SDK/7.9.4/Facebook.Unity.Arcade.dll
Tried on each of the above 4 .dll files that are "not registered". This included trying to un-register them first with the /U switch and then registering them. Each of these attempts is greeted with the below popup.
![errorpopup][1]
Any ideas on next steps or what might the issue be? Thanks!
[1]: /storage/temp/144601-capture.jpg
↧
Unity + Django + Facebook
Hello,
I have an application made in unity that communicates with a Django server.
Now I need to integrate facebook. Login works fine, but through this login, the user needs to be able to do the other things in the application, insert data in tables, read information and everything.
And this is the part that is complicating me, I don't know how to do it.
![alt text][1]
[1]: /storage/temp/144607-screenshot-10.png
↧
Facebook AppRequest in test mode
I have tried to look for a solution to this problem but don't seem to be able to find a definitive answer. I have an Android game with Facebook integration in development mode. I have added test users and can log into the app and retrieve Facebook user data (name, profile pic etc..) ok.
I am wanting, like so many others, to be able to send an AppRequest to another test user who is a friend from the editor. I can do this from a test version of the app on my Android device using my real Facebook account and it asks for the friends I want to share with ok, but they don't get the request as the app is in development mode (rightly so) on the Facebook dev app console. So I try to test this from in the Unity editor using a test account but it just comes up with a screen saying "Mock App Request, Test your app on one of the supported platforms".
Surely there must be a way to test this functionality from the Unity editor, without having to build the app, install it on a device and then change my Facebook account to a test one etc...
Do I need to log into Facebook with publish permissions or read ok? Am I missing something?
Any help greatly appreciated.
↧
Facebook SDK do not post any text, only link or picture
Hello. I have the problem with.Facebook SDK, it do not post any text, only link or picture. Also, if Im set link via FeedShare(string toId = "", Uri link = null, string linkName = "", string linkCaption = "", string linkDescription = "", Uri picture = null, string mediaSource = "", FacebookDelegate callback = null) method, it posts link, if link is null but it have picture link it posts picture, without text from linkDescription or linkCaption. ShareLink method worck the same way.
There is my script:
public class FacebookPostingController : MonoBehaviour
{
[SerializeField]
string linkParameter, nameParameter, descriptionParameter, pictureParameter;
AperolSpritzAPI aperolSpritzAPI;
AperolSpritzAPI AperolSpritzAPI
{
get
{
if (aperolSpritzAPI == null)
{
aperolSpritzAPI = GetComponent();
}
return aperolSpritzAPI;
}
}
private void Awake()
{
FB.Init();
FB.ActivateApp();
FB.LogInWithPublishPermissions(new List() { "publish_actions" }, AuthCallback);
if (!FB.IsInitialized)
{
MainMenuPageController.DebugMessage += " FB Activating problems ";
}
if (!FB.IsLoggedIn)
{
MainMenuPageController.DebugMessage += " FB Login problems ";
}
Debug.LogWarning("Hello console from AperolSpritz app");
}
private void OnDestroy()
{
FB.LogOut();
}
public void ShareToWall()
{
MainMenuPageController.DebugMessage += " ShareToWall ";
FB.FeedShare(
string.Empty, //toId
null, //app link
"PollyCube", //linkName
"LinkCaption", //linkCaption
"LinkDescription", //linkDescription
new System.Uri("https://images.pexels.com/photos/338713/pexels-photo-338713.jpeg"), //picture : new System.Uri("https://images.pexels.com/photos/338713/pexels-photo-338713.jpeg"),
string.Empty, //mediaSource
ShareCallback //callback or null
);
}
private void ShareCallback(IShareResult result)
{
if (!result.Cancelled)
{
AperolSpritzAPI.SetMyVoucher();
}
}
private void AuthCallback(ILoginResult result)
{
if (AccessToken.CurrentAccessToken.Permissions.Contains("publish_actions"))
{
MainMenuPageController.DebugMessage += " FB have publish actions ";
}
else
{
MainMenuPageController.DebugMessage += " FB dont have publish actions ";
}
if (!System.String.IsNullOrEmpty(result.Error))
{
MainMenuPageController.DebugMessage += " Auth fail ";
}
}
}
↧
↧
How to use YoLo AR screenshots Share facebook
This article has a saying but does not know how to integrate AR !!
https://stackoverflow.com/questions/20215946/upload-picture-to-facebook-from-unity
↧
Facebook Integration to Unity 2019.2 Android crashes
Good day,
I was trying to integrate Facebook, I used the sample package in Facebook's SDK download. When every time I ran the app on an Android device, it crashes. Error says that, the Class was not found, class name was Facebook.ContentFinder. When I checked the APK's Manifest, I can see the FacebookContentFinder. Any way to fix this?
↧
Importing Facebook SDK on project makes the build crash on Android
I have a simple 2D game that I want to use Facebook SDK to allow users to share information on social media. I tried importing the new version of Facebook SDK in the official website, set up the App Id and when I build my project, even if I'm not using anything related to Facebook on my project, the app simply crashes without even opening the Unity Splash Screen.
----------
I tried installing older versions, changing the Android Manifest file and lots of other things but nothing seems to help, does anyone know what may be causing it?
Extra info:
- Unity Version: 2019.1.14f1 (in External Tools for Android I'm using JDK, Android SDK, Android NDK, etc installed with Unity)
- Tested Facebook SDK versions: 7.17.2, 7.16.1, 7.15.1
↧
UNITY FACEBOOK 7.18.0 GET PROFILE PICTURE RETURNING A QUESTION MARK?
![alt text][1]
The program was working yesterday, today I have this error please help me :(
[1]: /storage/temp/147440-hata1.jpg
↧
↧
Share screenshot of game to Facebook with title and description
I'm working on a 2D mobile game for android and I'd like to share to Facebook a screenshot of the game with a simple text as a title and description, and if another Facebook user click's this it'll open the play store page of the game.
I tried looking at the documentation and it seems like there are some difficulties in doing so with the most recent Facebook SDK, like... Whenever I try to share a simple link with plain text and description (no image at all), the link takes up all the content and it never shows the title and description I tried to use.
I'm currently trying to use the FB.FeedShare method.
----------
Does anyone know how to share a post on Facebook with other information besides the link uri?
Thanks for the help!
↧
App freezes while getting user names from facebook
It mostly works, but for some reasons, my app sometimes freezes while getting user names from facebook. Shame I do not know why.
Can anyone help me? Any advice will be so appreciated.
My code is like this... I got this code from the internet.
IEnumerator GetFBuserName() {
for (int i = 0; i<15; i++) {
GetUserPhoto(user_id1);
yield return new WaitForSeconds(0.2f);
}
}
void GetUserPhoto(ulong id) {
string first_name;
FB.API("https" + "://graph.facebook.com/" + id.ToString() + "?fields=name&access_token=" + "******", HttpMethod.GET, delegate (IGraphResult result)
{
if (result.ResultDictionary.TryGetValue("name", out firstname))
{
first_name = firstname;
}
});
FB.API("https" + "://graph.facebook.com/" + id.ToString() + "/picture?type=small", HttpMethod.GET, delegate (IGraphResult result)
{
user_image = Sprite.Create(result.Texture, new Rect(0, 0, result.Texture.width, result.Texture.height), new Vector2(1f, 1f), 100);
});
}
}
↧
Gradle error after Facebook SDK update
Hi everyone i recently updated my Facebook SDK and keep getting this Gradle error when i try to build the apk
* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed : Attribute activity#com.facebook.FacebookActivity@theme value=(@style/com_facebook_activity_theme) from [:com.facebook.android.facebook-common-5.8.0:] AndroidManifest.xml:32:13-63
is also present at [:facebook-android-sdk-4.14.0:] AndroidManifest.xml:32:13-72 value=(@android:style/Theme.Translucent.NoTitleBar).
Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:29:9-32
:66 to override.
This is how my Manifest looks like.
Anyone know what I need to edit in my manifest so I can fix this?
↧