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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Has somone succesfull intergrated heyzap Ad??

Discussion in 'Editor & General Support' started by MrGky93, Aug 21, 2015.

  1. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    hi
    i want to test it use the doc but it say me that it cant merge them with applovin and chartboost :(
    Have somone a solution ?


    CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    C:/Program Files/Java/jdk1.8.0_25\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/android programm/adt-bundle-windows-x86_64-20140702/adt-bundle-windows-x86_64-20140702/sdk\tools" -Dfile.encoding=UTF8 -jar "
    /Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

    stderr[
    Error: [Temp\StagingArea\AndroidManifest-main.xml:12,
    Temp\StagingArea\android-libraries\Heyzap\AndroidManifest.xml:3] Trying to merge incompatible /manifest/application/activity[@name=com.heyzap.sdk.ads.MediationTestActivity] element:
    <activity
    -- @android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize"
    -- @android:name="com.heyzap.sdk.ads.MediationTestActivity">
    --</activity>
    <activity
    ++ @android:name="com.heyzap.sdk.ads.MediationTestActivity">
    ++</activity>
    ++(end reached)
    Error: [Temp\StagingArea\AndroidManifest-main.xml:21,
    Temp\StagingArea\android-libraries\Heyzap\AndroidManifest.xml:5] Trying to merge incompatible /manifest/application/activity[@name=com.heyzap.sdk.ads.VASTActivity] element:
    <activity
    -- @android:name="com.heyzap.sdk.ads.VASTActivity">
    --</activity>
    --(end reached)
    <activity
    ++ @android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize"
    ++ @android:name="com.heyzap.sdk.ads.VASTActivity">
    ++</activity>
    ]
    stdout[
    Warning: [Temp\StagingArea\AndroidManifest-main.xml:39] Manifest has more than one /manifest/uses-permission[@name=android.permission.WRITE_EXTERNAL_STORAGE] element.
    [Temp\StagingArea\AndroidManifest-main.xml:28,
    \Temp\StagingArea\android-libraries\ChartboostSDK\AndroidManifest.xml:11] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] element.
    [Temp\StagingArea\AndroidManifest-main.xml:20, \Temp\StagingArea\android-libraries\Heyzap\AndroidManifest.xml:4] Skipping identical /manifest/application/activity[@name=com.heyzap.sdk.ads.HeyzapProxyActivity] element.
    [Temp\StagingArea\AndroidManifest-main.xml:18,Temp\StagingArea\android-libraries\Heyzap\AndroidManifest.xml:6] Skipping identical /manifest/application/activity[@name=com.heyzap.sdk.ads.HeyzapInterstitialActivity] element.
    [Temp\StagingArea\AndroidManifest-main.xml:19, \Temp\StagingArea\android-libraries\Heyzap\AndroidManifest.xml:7] Skipping identical /manifest/application/activity[@name=com.heyzap.sdk.ads.HeyzapVideoActivity] element.
    [Temp\StagingArea\AndroidManifest-main.xml:22, \Temp\StagingArea\android-libraries\Heyzap\AndroidManifest.xml:8] Skipping identical /manifest/application/receiver[@name=com.heyzap.sdk.ads.PackageAddedReceiver] element.
    Warning: [Temp\StagingArea\AndroidManifest-main.xml:39] Manifest has more than one /manifest/uses-permission[@name=android.permission.WRITE_EXTERNAL_STORAGE] element.
    ]
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.HostView:OnGUI()
     
  2. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    pls help thx
     
  3. Jell92

    Jell92

    Joined:
    Apr 3, 2015
    Posts:
    14
    Hey Rayleigh, Don't worry this happened to me too (I believe it is exactly the same error). The reason is simple: Unity has troubles merging all the android manifest files in your projects. Try and do a search on "android manifest" and you will see that you propably have quite a few. The information in these files has to match, so go check that where it says "MinSDKversion =" is equal to the same number in all of the files. Tell me if it worked:)
     
  4. uzairamirs

    uzairamirs

    Joined:
    Jan 7, 2015
    Posts:
    8
    Hi Rayleigh2116,
    This is such a frustrating error.....
    Just tell me once please that have you Configured Heyzap by clicking Heyzap in editor bar and Heyzap Android Setup?
     
  5. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    yeah fixed the applovin problem but now the chartboost dont working and the heyzap support are to are too stupid they cant help you !!
     
  6. Chetim

    Chetim

    Joined:
    Jan 30, 2013
    Posts:
    12
    Seems like I finally got it working in Android with AdColony, AdMob, AppLoving, Chartboost, Unity Ads, and Vungle. The process was:

    1) Install the HeyZap SDK.

    2) Do HeyZap Android Setup.

    3) Then, on HeyZap’s sdk guide, select your ad providers and download the Android Manifest. Copy the manifest to Plugins/Android.

    4) Then install all other SDKs. If you get an error that the plugin “is already mapped to” then go to Assets and select "Reimport All” ignore it. Some of them will also install another Android Manifest in Plugins/Android, so you'll have several named Android Manifest, Android Manifest 1, Android Manifest 2, etc.

    5) You'll need to manually take the unique elements from the numbered Android Manifests and copy them into the original Android Manifest you downloaded from HeyZap's site. Then delete the numbered Android Manifests.

    6) I’m not sure if these issues are unique to Vungle or simply occur because Vungle is last in the list… Vungle installs 2 Android Manifests. One is in Plugins/Android/google-play-services_lib. You can just delete the whole thing if you have one already. There’s another one in Plugins/Android/Vungle_lib. Copy the one activity it has to your main Android Manifest. Placement in the main manifest is important, you might have to play around with it a bit. I put it in after the 3 AdColony activities, before the list of single line activities for the other ad providers. Now, delete that activity from the Plugins/Android/Vungle_lib manifest and save the change. You can’t delete the entire manifest or building will fail while Unity searches for android libraries.

    Also, if you get any repackaging errors, run the Android setup for Chartboost (and HeyZap again if you haven't). Once it starts working it might stop working, but just repeat the setup for Chartboost (and possibly HeyZap).

    For package name at the top of the manifest just use your app’s bundle/package name. Even though some of the different manifests have different package names it doesn’t seem to matter.

    After all that, everything works fine in HeyZaps test mediation suite. Hopefully everything continues fine in the live product!


    Notes: Several activities have a launch intent. You don't need more than 1 of those. If you have more than 1 then when you build the app to your device you'll have multiple icons show up.
    This was with Unity 5.2.0f3 Personal, HeyZap 9.0.6, AdColony 2.0.12, AdMob 7.4.0, AppLoving ios 3.0.2/android 6.0.1, Chartboost 5.5.3, UnityAds 1.3.0, Vungle ios 3.1.2/android 3.3.1 on Windows Vista Ultimate SP 2.
     
    Last edited: Sep 28, 2015
    uyesilmen and MrGky93 like this.
  7. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    dont work i become every time f** errors when i make a apk
    ok work thx
     
    Last edited: Sep 12, 2015
  8. Chetim

    Chetim

    Joined:
    Jan 30, 2013
    Posts:
    12
    There's a few more steps to get banner's working. I'm not 100% sure this is the correct/best way to do things but it seems to be working so far.

    First, for banner's on iPhone, make sure, in your Privacy settings, you've turned off Limit Ad Tracking.

    Second, I switched to the beta sdk and added code for callback handling. I'm not sure if the beta sdk is absolutely necessary (or even the callback handling) but I'll describe those steps if simply turning Limit Ad Tracking off didn't work.

    The rest applies to Android and iOS.

    Now, besides the steps on the SDK page already (like including the HZAdMobBannerSupport files) you should add some banner callback code they have on their advanced document page https://developers.heyzap.com/docs/unity_sdk_advanced

    What I did was after each time I try to call a banner (basically once at the start of the game) I call another method that has the callback code inside it. If It fails to load a banner I have it run the banner code and the method again until it is finally successful (I limit the number of attempts as well using a counter).

    The code to call banners is much different in the beta than in the regular sdk:
    Code (CSharp):
    1.  
    2.   HZBannerShowOptions showOptions = new HZBannerShowOptions();
    3.   showOptions.Position = HZBannerShowOptions.POSITION_TOP;
    4.   HZBannerAd.ShowWithOptions(showOptions);
    If you switch to the beta sdk you'll have to update all your other code as well for initializing and interstitials, but just following Unity's warnings should take care of all of that.
     
    Last edited: Sep 15, 2015
  9. rahulohri

    rahulohri

    Joined:
    Dec 30, 2014
    Posts:
    3
    I have got interstial and video ads to work but banner ads do not work , please help , I have used heyzap sdk 9.3 (beta) and unity 5.1.1 , I am not getting any callback either :/
     
  10. festival

    festival

    Joined:
    Feb 3, 2011
    Posts:
    80
    @Chetim I never got Unity Ads working with Heyzap. Using Google Play Services plugin 0.9.30 and the Google Play Services SDK 8.4 in my Android SDK folder.

    When Unity Ads likes to load ads my Android app crashes with Unity Ads enabled In Unity 5.3
     
  11. bhatiarohan156

    bhatiarohan156

    Joined:
    Feb 23, 2015
    Posts:
    3
    For those who are not able to build with Heyzap and google play services.

    CommandInvokationFailure: Unable to convert classes into dex format.

    The most important line is this:

    trouble writing output: Too many method references: 70130; max is 65536.

    Well it clearly shows that you have exceeded max number of method(65536) references for dex conversion.


    Screen Shot 2016-06-23 at 2.46.43 PM.png

    Q : So how to solve this?
    A: By decreasing number of method reference to <=65536.

    Q: How to decrease it?
    A: Go to "google-play-services.jar"(As shown is image below).

    "google-play-services.jar" is a very fat guy with a lot of methods in it and he's not able to get into the dex converter. We just need to remove some unwanted methods(Those which are not required in our project).

    Screen Shot 2016-06-23 at 2.42.53 PM.png

    1) Open "google-play-services.jar"

    A jar file is just like a compressed folder. You can open it using any tool that you use for uncompressing a compressed folder (yeah, just like you do with those zip folders).

    This is how i do it on Mac. Right click the jar file->open with-> Archive Utility
    Screen Shot 2016-06-23 at 3.06.17 PM.png

    After uncompressing, it would look something like this. Goto com->google->android->gms.
    gms folder contains so many modules provided by google these are classes for all the services that google provide.
    We just need to remove the unwanted modules and compress our google-play-services folder back to jar.
    Screen Shot 2016-06-23 at 3.09.18 PM.png
    2) Remove modules

    Its pretty simple, we just need to delete some folder that we don't need. Just make sure you don't delete any folder that is required by your project.

    Here a list of folder(modules) that i deleted

    wearable
    wallet
    plus
    panorama
    maps
    fitness
    drive

    3)Compress google-play-services folder back to jar

    Use the jar tool provided with jdk.

    1)Go to the path where your jar the tool is located.
    2)Type jar in terminal
    3)Follow the example that it would give you at the end of jar help doc that would get printed on the terminal.
    4)supply it the manifest that is there in google-play-services->META-INF->MANIFEST.MF

    Note: you can name the jar anything you like i have named it cl.jar. The name doesn't matter.

    Screen Shot 2016-06-23 at 3.23.34 PM.png

    4) Replace the new jar with the old jar in unity

    Just delete the old jar and put the new jar just right there and try to build the apk.


    I HOPE IT HELPS.
     
    javier11om likes this.
  12. bhatiarohan156

    bhatiarohan156

    Joined:
    Feb 23, 2015
    Posts:
    3
    you have declared more than one "android.permission.WRITE_EXTERNAL_STORAGE" just keep one and delete the others.
     
  13. ahmadshabbir

    ahmadshabbir

    Joined:
    Nov 12, 2017
    Posts:
    3

    Can You please elaborate how to use it because it dangerous for account to send 2,3 calls at same time ?
    Either this way is correct ???? i just switch to heyzap with 3 networks (admob, applovin,Unityads) and per day earning is very low while admob alone was Paying high
    Please guide me

    Firstly i Call Simple Banner Ad and test either Banner loaded successfully If yes then break loop
    otherwise try up to 3 times by calling banner


    // Simple Banner Call
    HZBannerShowOptions showOptions = new HZBannerShowOptions();
    showOptions.Position = HZBannerShowOptions.POSITION_TOP;
    HZBannerAd.ShowWithOptions(showOptions);

    counter =3;
    // Call Back within Loop
    for (i=0;i<counter;i++){

    HZBannerAd.AdDisplayListener listener = delegate(string adState, string adTag){
    if (adState == "loaded") { break; //stop Calling new ads As 1 Ad is already showing }
    if (adState == "error") { HZBannerAd.ShowWithOptions(showOptions); //Again Call Ad }

    HZBannerAd.SetDisplayListener(listener);

    }
     
    Last edited: Jul 28, 2018
  14. ahmadshabbir

    ahmadshabbir

    Joined:
    Nov 12, 2017
    Posts:
    3
    Hi All

    i just switch to heyzap with 3 networks (admob, applovin,Unityads) and per day earning is very low 0.04 $

    while admob alone was Paying high $3.5
    And i found that Once Heyzap Start showing All type of Ads (Banner, VIdeo and interstitial ) But when its not showing not even 1 single ads type (banner /Video /Interstitial )are showing ?

    Actually filtrate is very low .Heyzap Only shows 2 time ads out of 10 times

    I am very worried and Basically I am indie developer and just step in game creation Please guide me Because this is very very Important for me

    unfortunately admob closed my account they said someone click on ads multiple time ? i request them but they don't listen Sad But no worry so i switch to Heyzap