Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Not working Advertisements

Discussion in 'Unity Ads & User Acquisition' started by DeniShed, Aug 11, 2020.

Thread Status:
Not open for further replies.
  1. DeniShed

    DeniShed

    Joined:
    Aug 11, 2020
    Posts:
    6
    Hello, there is a problem with Advertisements 3.4.7 from Package Manager
    Unity version: 2019.2.6f1
    When starting the project, a message appears in the console:

    E/Unity: java.lang.ClassNotFoundException: Didn't find class "com/unity3d/services/banners/IUnityBannerListener"


    After that the plugin is not initialized
     
  2. Unity_Adamski

    Unity_Adamski

    Unity Technologies

    Joined:
    Jul 20, 2020
    Posts:
    110
    Could you try removing the package and instead try adding it via the services tab. If that doesn't fix your problem could you post up your ads code?
     
  3. DeniShed

    DeniShed

    Joined:
    Aug 11, 2020
    Posts:
    6
    As I know, in plugin version from services tab not avalivle IUnityAdsListener and banners
     
  4. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    Hey @solarsheduler could you post a screenshot of the full error you're getting? Is it happening on project launch or when you press play?
     
  5. DeniShed

    DeniShed

    Joined:
    Aug 11, 2020
    Posts:
    6
    I export a project from Unity and build it using Android Studio. When launching a project, at the stage of Advertisements initialization, this error appears.

    2020-08-11 15:18:57.483 8395-8442/? E/Unity: java.lang.ClassNotFoundException: Didn't find class "com/unity3d/services/banners/IUnityBannerListener" on path: DexPathList[[zip file "/data/app/biz.company.test.biz.company.test-je-UuxYUAUE3HFsqJvq8-w==/base.apk"],nativeLibraryDirectories=[/data/app/biz.company.test.biz.company.test-je-UuxYUAUE3HFsqJvq8-w==/lib/arm64, /data/app/biz.company.test.biz.company.test-je-UuxYUAUE3HFsqJvq8-w==/base.apk!/lib/arm64-v8a, /system/lib64]]
     

    Attached Files:

  6. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    Ahh I see, so this error is in Android Studio. It sounds like the SDK isn't being pulled into the Android project properly. Does it only happen with 3.4.7?
     
  7. DeniShed

    DeniShed

    Joined:
    Aug 11, 2020
    Posts:
    6
    On all versions above 2.0.8
     
  8. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    Most of our Android developers build directly from Unity rather than export to Android Studio so I'm unfortunately not familiar with the specifics of what happens with the SDK in this case.

    Can you open a support ticket by emailing the information above along with any other relevant project details to unityads-support@unity3d.com? We can then look into this properly for you.
     
  9. sbankhead

    sbankhead

    Unity Technologies

    Joined:
    Jul 27, 2014
    Posts:
    97
    So this is an interesting error. Can you confirm how you installed the unity ads sdk, via package manager or the asset store? Can you confirm if things are working for you in editor playmode and you are able to see the placeholder images?
     
  10. DeniShed

    DeniShed

    Joined:
    Aug 11, 2020
    Posts:
    6
    I have tried both plugin options from package manager and from asset store. The results are the same. In editor playmode appears placeholder and everything works.

    I also use Grandle for assembly, maybe the problem is somewhere there...
     
  11. sbankhead

    sbankhead

    Unity Technologies

    Joined:
    Jul 27, 2014
    Posts:
    97
    So I just re-read through the thread, and this very much looks related to the custom gradle build process your running. Likely you just need to add a reference to the UnityAds.aar in to your build steps so that it gets linked in during the build and is available at runtime.
     
  12. DeniShed

    DeniShed

    Joined:
    Aug 11, 2020
    Posts:
    6
    Problem solved. On the old plugin version (Unity Ads 2.0.8) his name is "unity-ads.aar". New version - "UnityAds.aar". In gradle file i change implementation strings.
    From

    implementation(name: 'unity-ads, ext:'aar')

    To

    implementation(name: 'UnityAds', ext:'aar')
    implementation(name: 'UnityAdsAndroidPlugin', ext:'aar')


    And now advertising is working.Thanks everyone for the help)
     
    sbankhead likes this.
Thread Status:
Not open for further replies.