Search Unity

Facebook Audience Network for Android

Discussion in 'Android' started by Thanitsak, Oct 5, 2019.

  1. Thanitsak

    Thanitsak

    Joined:
    Jan 4, 2016
    Posts:
    117
    Hello! I am using Audience Network 5.5.1 with Unity 2019.2.6, it was working fine when building to iOS but not for Android. There are many errors messages as in the picture below.
    I also wasn't sure about Manifest as in Facebook document say that I need to add
    <activity android:name="com.facebook.ads.AudienceNetworkActivity" android:configChanges="keyboardHidden|orientation|screenSize" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    as well but there was the one for UnityPlayerActivity already so I'm not sure what to do.


     
  2. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    Share screenshot of Assets/Plugins/Android folder.
     
    Thanitsak likes this.
  3. Thanitsak

    Thanitsak

    Joined:
    Jan 4, 2016
    Posts:
    117
    Here you are @Voxel-Busters ! Thank you very much for the reply!

     
  4. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    Please search for “classes” in the project view and send me a screenshot.
     
    Thanitsak likes this.
  5. Thanitsak

    Thanitsak

    Joined:
    Jan 4, 2016
    Posts:
    117
    Sure! but there is nothing there
     
  6. Thanitsak

    Thanitsak

    Joined:
    Jan 4, 2016
    Posts:
    117
    @Voxel-Busters I think I got something but still can't show ads. I created new project and build without any error (but ads won't show up). So I guessed that in my old project inside Assets/Plugins/Android folder there was some files that might caused the errors, also I don't know where these files come from as in the pictures I sent you before (If you know please provide me knowledge ☺️). So instead of deleting those file in Assets/Plugins/Android folder I delete these 4 files instead because I guessed they duplicated with that files.

    After I removed these, I can simply build to my android phone without any errors (No changes to Manifest yet). BUT now I can't load rewarded video ads to show and it say error about "no fill". So I modify Manifest as Facebook documents said need to add these 2 lines.
    Code (CSharp):
    1. <activity android:name="com.facebook.ads.AudienceNetworkActivity" android:configChanges="keyboardHidden|orientation|screenSize" />
    2. <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    I added above my old <activity android:name="com.unity3d.player.UnityPlayerActivity"> and another below my old <uses-permission android:name="android.permission.INTERNET" />.
    But still no ads was showing up. Also I use my real placement ID.
    I already searched about this but still not able to fix. Do you have any idea about this?

    Again really appreciate for your time with my question @Voxel-Busters !
     
  7. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    You did it right!. I was looking for support files which exist as duplicates in your project.

    I'm not exactly sure about the current issue but do share me the complete logcat log to look into. Make sure you are in development mode.
     
    Thanitsak likes this.
  8. Thanitsak

    Thanitsak

    Joined:
    Jan 4, 2016
    Posts:
    117
    Wow nice thank you! Oh wait I couldn't add my payment method for both of my placement platform because it said "This platform isn't supported in this payment account's region." so I asked them and they said I couldn't able to use Audience Network because not supported my country. Have you faced this problem before @Voxel-Busters ? Btw I lived in Thailand but so confused that this is the reason why I can not use it!
     
  9. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,968
    Sorry, I'm not sure about this part. Would be better if you check with FB support team on this.
     
    Thanitsak likes this.
  10. Thanitsak

    Thanitsak

    Joined:
    Jan 4, 2016
    Posts:
    117
    Thank you very much! I already contacted them but they just told me that my region is not support for payment now so can't use audience network at the moment.