Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADS not working after updated to latest SDK #418

Closed
flashmandv opened this issue Apr 26, 2023 · 23 comments
Closed

ADS not working after updated to latest SDK #418

flashmandv opened this issue Apr 26, 2023 · 23 comments
Labels
details requested Details requested for the issue timeout and closed A month passed after the solution was given.

Comments

@flashmandv
Copy link

flashmandv commented Apr 26, 2023

So I updated our game to v 2.3.2 with Unity 2020.3
I still could not make the ads work (trying with Interestitial).
Here is my logcat:

[HMS] HMSAdsKitManager Loading Ads
[HMS] HMSAdsKitManager Loading Interstitial Ad.
 I/HiAdSDK.InterstitialAdManager:  loadAd
04-26 08:45:12.479 9597-9638/net.boardgamesonline.Rento.huawei W/HiAdSDK.z:  toObject JSONException
04-26 08:45:12.479 9597-9638/net.boardgamesonline.Rento.huawei W/HiAdSDK.AdSlotParam:  contentBundle info is empty or not json string
04-26 08:45:12.480 9597-9746/net.boardgamesonline.Rento.huawei I/HiAdSDK.LocationUtils:  loc_tag isGpsSwitchOpen locationMode is 3
04-26 08:45:12.480 9597-9638/net.boardgamesonline.Rento.huawei I/HiAdSDK.LocationUtils:  loc_tag media allow: true
04-26 08:45:12.481 9597-9746/net.boardgamesonline.Rento.huawei I/HiAdSDK.LocationUtils:  loc_tag sendAsyncLocationByNative failed because switch is off
04-26 08:45:12.481 9597-9638/net.boardgamesonline.Rento.huawei I/HiAdSDK.LocationUtils:  loc_tag isGpsSwitchOpen locationMode is 3
04-26 08:45:12.481 9597-9638/net.boardgamesonline.Rento.huawei I/HiAdSDK.LocationUtils:  loc_tag isLocationAvailable = false, return null
04-26 08:45:12.482 9597-9638/net.boardgamesonline.Rento.huawei W/HiAdSDK.ReflectAPI:  class not found for com.huawei.hag.abilitykit.api.KitSdkManager
04-26 08:45:12.483 9597-9638/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call remote method: interstitial_ad_load
04-26 08:45:12.483 9597-9638/net.boardgamesonline.Rento.huawei I/HiAdSDK.Monitor_Decouple.PPSApiServiceManager:  inc count: 5
04-26 08:45:12.485 9597-9638/net.boardgamesonline.Rento.huawei I/Unity: [HMS] HMSAdsKitManager LoadRewardedAd
W/HiAdSDK.HiAdTools:  inner pps core service not available
04-26 08:45:12.487 9597-9758/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call remote method: reqConfig
04-26 08:45:12.487 9597-9758/net.boardgamesonline.Rento.huawei I/HiAdSDK.Monitor_Decouple.PPSApiServiceManager:  inc count: 6
04-26 08:45:12.487 9597-9638/net.boardgamesonline.Rento.huawei I/HiAdSDK.RewardAdLoader:  loadAds
04-26 08:45:12.487 9597-9638/net.boardgamesonline.Rento.huawei W/HiAdSDK.z:  toObject JSONException
04-26 08:45:12.487 9597-9638/net.boardgamesonline.Rento.huawei W/HiAdSDK.AdSlotParam:  contentBundle info is empty or not json string
04-26 08:45:12.487 9597-9638/net.boardgamesonline.Rento.huawei I/HiAdSDK.LocationUtils:  loc_tag media allow: true
04-26 08:45:12.488 9597-9638/net.boardgamesonline.Rento.huawei I/HiAdSDK.LocationUtils:  loc_tag isGpsSwitchOpen locationMode is 3
04-26 08:45:12.488 9597-9638/net.boardgamesonline.Rento.huawei I/HiAdSDK.LocationUtils:  loc_tag isLocationAvailable = false, return null
04-26 08:45:12.488 9597-9749/net.boardgamesonline.Rento.huawei I/HiAdSDK.LocationUtils:  loc_tag isGpsSwitchOpen locationMode is 3
04-26 08:45:12.488 9597-9749/net.boardgamesonline.Rento.huawei I/HiAdSDK.LocationUtils:  loc_tag sendAsyncLocationByNative failed because switch is off
04-26 08:45:12.488 9597-9638/net.boardgamesonline.Rento.huawei W/HiAdSDK.ReflectAPI:  class not found for com.huawei.hag.abilitykit.api.KitSdkManager
04-26 08:45:12.489 9597-9638/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call remote method: reqRewardAd
04-26 08:45:12.489 9597-9638/net.boardgamesonline.Rento.huawei I/HiAdSDK.Monitor_Decouple.PPSApiServiceManager:  inc count: 7
04-26 08:45:12.492 9597-9743/net.boardgamesonline.Rento.huawei W/HiAdSDK.HiAdTools:  inner pps core service not available
04-26 08:45:12.492 9597-9743/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call remote method: reqConfig
04-26 08:45:12.492 9597-9743/net.boardgamesonline.Rento.huawei I/HiAdSDK.Monitor_Decouple.PPSApiServiceManager:  inc count: 8
04-26 08:45:12.492 9597-9638/net.boardgamesonline.Rento.huawei I/Unity: [HMS] HMSAdsKitManager SetTestAdStatus set to False
HMSSDK_HMSBIInitializer: Builder->biInitFlag :false
04-26 08:45:12.563 9597-9638/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: Enter getHMSPackageNameForMultiService
04-26 08:45:12.565 9597-9638/net.boardgamesonline.Rento.huawei E/HMSSDK_JsonUtil: createJsonString error, the input IMessageEntity is null
04-26 08:45:12.579 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: Enter getHMSPackageNameForMultiService
04-26 08:45:12.580 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HuaweiApi: No setInnerHms, hms pkg name is com.huawei.hwid
04-26 08:45:12.581 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HuaweiApi: sendRequest
04-26 08:45:12.581 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
04-26 08:45:12.590 9597-9784/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call reqConfig code: -1 msg: 
04-26 08:45:12.598 9597-9784/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call interstitial_ad_load code: 499 msg: 
04-26 08:45:12.599 9597-9746/net.boardgamesonline.Rento.huawei I/HiAdSDK.InterstitialAdManager:  onAdFailed, errorCode:499
04-26 08:45:12.604 9597-9749/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call remote method: apistatistics
04-26 08:45:12.604 9597-9749/net.boardgamesonline.Rento.huawei I/HiAdSDK.Monitor_Decouple.PPSApiServiceManager:  inc count: 9
04-26 08:45:12.606 9597-9784/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call reqRewardAd code: 499 msg: 
04-26 08:45:12.606 9597-9748/net.boardgamesonline.Rento.huawei I/HiAdSDK.RewardAdLoader:  onAdFailed, errorCode:499
04-26 08:45:12.608 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
04-26 08:45:12.609 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: <initHmsPackageInfo> Succeed to find HMS apk: com.huawei.hwid version: 61000330
04-26 08:45:12.609 9597-9597/net.boardgamesonline.Rento.huawei E/Unity: [HMS] HMSAdsKitManager Rewarded ad loading failed with error $0
                                                                        HmsPlugin.RewardAdListener:OnRewardAdFailedToLoad(Int32)
                                                                        System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
                                                                        UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
                                                                        UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
04-26 08:45:12.609 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: HMS Core version :61000330, needUpdate: false
04-26 08:45:12.610 9597-9746/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call remote method: apistatistics
04-26 08:45:12.610 9597-9746/net.boardgamesonline.Rento.huawei I/HiAdSDK.Monitor_Decouple.PPSApiServiceManager:  inc count: 10
04-26 08:45:12.618 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HuaweiApi: isConnected:false.
04-26 08:45:12.619 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_BaseHmsClient: ====== HMSSDK version: 60900301 ======
04-26 08:45:12.620 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_BaseHmsClient: Enter connect, Connection Status: 1
04-26 08:45:12.622 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_BaseHmsClient: connect minVersion:30000000 packageName:com.huawei.hwid
04-26 08:45:12.623 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_Util: available exist: true
04-26 08:45:12.623 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_Util: available exist: true
04-26 08:45:12.627 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: enter checkHmsIsSpoof
04-26 08:45:12.628 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: quit checkHmsIsSpoof cached state: SUCCESS
04-26 08:45:12.628 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
04-26 08:45:12.629 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: HMS Core version :61000330, needUpdate: false
04-26 08:45:12.629 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: current versionCode:61000330, minimum version requirements: 30000000
04-26 08:45:12.637 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
04-26 08:45:12.639 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
04-26 08:45:12.639 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HMSPackageManager: MinApkVersion is disabled.
04-26 08:45:12.640 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_BaseHmsClient: check available result: 0
04-26 08:45:12.640 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_BaseHmsClient: enter bindCoreService, packageName is com.huawei.hwid, serviceAction is com.huawei.hms.core.aidlservice
04-26 08:45:12.641 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_OuterBinderAdapter: OuterBinderAdapter getInstance.
04-26 08:45:12.649 9597-9597/net.boardgamesonline.Rento.huawei I/HMSSDK_BinderAdapter: BinderAdapter Enter onServiceConnected.
04-26 08:45:12.650 9597-9597/net.boardgamesonline.Rento.huawei I/HMSSDK_BaseHmsClient: Enter onServiceConnected.
04-26 08:45:12.654 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_RequestManager: RequestManager handleMessage.
04-26 08:45:12.655 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_BaseHmsClient: getAdapter:isInner:false, mInnerBinderAdapter:null, mOuterBinderAdapter:com.huawei.hms.adapter.OuterBinderAdapter@3f0d9c8
04-26 08:45:12.655 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HuaweiApi: onConnected
04-26 08:45:12.661 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_RequestManager: addToConnectedReqMap
04-26 08:45:12.662 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_HmsClient: post msg api_name:iap.isBillingSupported, app_id:101046261|, pkg_name:net.boardgamesonline.Rento.huawei, sdk_version:60900301, session_id:*, transaction_id:101046261ported20230426084512563956508, kitSdkVersion:60400301, apiLevel:1
04-26 08:45:12.664 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_BaseAdapter: In constructor, activityWeakReference is java.lang.ref.WeakReference@814845b, activity is com.playrento.deeplink.RentoUnityPlayerActivity@ac4b03d
04-26 08:45:12.665 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_BaseAdapter: in baseRequest + uri is :iap.isBillingSupported, transactionId is : 101046261ported20230426084512563956508
04-26 08:45:12.667 9597-9784/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call reqConfig code: -1 msg: 
04-26 08:45:12.673 9597-9784/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call apistatistics code: 200 msg: null
04-26 08:45:12.675 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_PendingResultImpl: init uri:iap.isBillingSupported
04-26 08:45:12.676 9597-9797/net.boardgamesonline.Rento.huawei I/HMSSDK_PendingResultImpl: setResultCallback
04-26 08:45:12.680 9597-9784/net.boardgamesonline.Rento.huawei I/HiAdSDK.Decouple.PPSApiServiceManager:  call apistatistics code: 200 msg: null
04-26 08:45:12.726 9597-9823/net.boardgamesonline.Rento.huawei D/Unity: Setting up 1 worker threads for Enlighten.
04-26 08:45:12.727 9597-9824/net.boardgamesonline.Rento.huawei D/Unity:   Thread -> id: 79d5d8ecb0 -> priority: 1 
04-26 08:45:12.770 9597-9638/net.boardgamesonline.Rento.huawei I/Unity: initialScreenWidth: 2400 ScreenW: 1280
                                                                        RentoUICamera:Update()
04-26 08:45:12.771 9597-9638/net.boardgamesonline.Rento.huawei E/Unity: [HMS] HMSAdsKitManager OnInterstitialAdFailed reason:0
                                                                        HmsPlugin.InterstitialAdListener:OnAdFailed(Int32)
                                                                        System.Action:Invoke()
                                                                        HuaweiMobileServices.Utils.HMSDispatcher:Update()

As you can see from the logs ad failed:

 [HMS] HMSAdsKitManager OnInterstitialAdFailed reason:0 
  HmsPlugin.InterstitialAdListener:OnAdFailed(Int32)

and this class is not found:

W/HiAdSDK.z:  toObject JSONException
W/HiAdSDK.AdSlotParam:  contentBundle info is empty or not json string
HiAdSDK.ReflectAPI:  class not found for com.huawei.hag.abilitykit.api.KitSdkManager

I also had Huawei ID login problem, but fixed it by adding this to my mainTemplate.gradle implementation 'com.huawei.agconnect:agconnect-auth:1.6.1.300'
Is this an issue with missing gradle implementation line?

Please help

@alihan98ersoy alihan98ersoy added the investigating We are investigating the current problem label Apr 27, 2023
@alihan98ersoy
Copy link
Collaborator

Hello,

  1. Are you testing with a physical device and Is it Huawei? If you are testing with Cloud Debugging can you change the user to the owner?

499 seems to be related to your region. Is your region the US?

  1. Please open your phone settings -> Language & Region and please check the phone's current region. If it is the US please change it to any supported country.
  2. Please open your phone settings -> Language & Region and please check the phone's current language. If is it English(US) please change it to any supported country.
  3. If these solutions do not work. You can test ads on a phone that has a sim card inserted.

@flashmandv
Copy link
Author

Thank you for your reply.
It seems the ads are working in Huawei device, but not in any other device (despite having the HMS Core and services).
That is strange as in one of the oldest versions of the SDK that was working.
Anyway, closing this

@alihan98ersoy
Copy link
Collaborator

Maybe you can try to implement ads-prime SDK for non-Huawei devices.

@alihan98ersoy alihan98ersoy added solved Developer confirm that issue solved. and removed investigating We are investigating the current problem labels Apr 27, 2023
@flashmandv
Copy link
Author

Actually I did, but it did not work on my samsung and oneplus devices

@alihan98ersoy
Copy link
Collaborator

alihan98ersoy commented Apr 28, 2023

I just tested it with a Samsung phone and it is working for me. If you want, we can investigate the problem together. You can reopen this issue

@flashmandv
Copy link
Author

flashmandv commented Apr 29, 2023

Hello,
Sure, lets see why ads are not showing. I've built dev apk of the game. Here is the link:
https://drive.google.com/file/d/1bE5FlmKqkKTKxnELoayWf_2W7lGD2g0o/view?usp=sharing

You can check the LogCat. Ads are shown when you start new game (solo is easiest) and then exit the game after 5 seconds.

And btw these spam errors are coming from the SDK. I think the old managers were instances of MonoBehavior and these new ones are not so some editor script is throwing these errors:
image

'HmsPlugin.HMSIAPManager' is missing the class attribute 'ExtensionOfNativeClass'!
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

@flashmandv flashmandv reopened this Apr 29, 2023
@alihan98ersoy alihan98ersoy added investigating We are investigating the current problem and removed solved Developer confirm that issue solved. labels May 2, 2023
@alihan98ersoy
Copy link
Collaborator

Hello,

On my Huawei Phone(p40 lite) it is working. And I am seeing real ads.
But on my Samsung phone, I am getting error 3. This is a typical situation for non-released games. You should test Ads with test ID before releasing the game.

  • Everything seems to be working but to ensure you can test with testID on non-Huawei devices.

image
image

@alihan98ersoy alihan98ersoy added waiting for confirmation The solution has been given and removed investigating We are investigating the current problem labels May 2, 2023
@flashmandv
Copy link
Author

Thanks for the update. I could not see ads in my Samsung S21+ even though I checked the "Use Test Ads" checkbox.
I even tried with both interestitial AD ID set with test as prefix and without test as prefix.
The version I've sent you you is a development release version with "Use Test Ads" unchecked

@alihan98ersoy alihan98ersoy added details requested Details requested for the issue and removed waiting for confirmation The solution has been given labels May 2, 2023
@alihan98ersoy
Copy link
Collaborator

Would you mind sharing the "Use Test Ads" checked APK with me? Maybe I can find the issue by testing it.

@flashmandv
Copy link
Author

Sure. Here is the dev apk with test ads ON. My interestitial ID is entered without "test" prefix. I'm not sure which is correct
https://drive.google.com/file/d/1zrNQmgvZHJX7yilqGOJhW7M1U6Q_hJpW/view?usp=sharing
image

@alihan98ersoy alihan98ersoy added investigating We are investigating the current problem and removed details requested Details requested for the issue labels May 2, 2023
@alihan98ersoy
Copy link
Collaborator

With this APK it is getting error 3 on both devices.

  • If you tick use test ads, it uses the testIDs we defined earlier. For example
  • Are you defining Ads id from a script or letting the plugin define it? If you are not defining this can be a temporary situation.
  • Or maybe you can try to disable "Use Test Ads" and then you can try to fill the id parts manually with test ids.
    Testing an Interstitial Ad
    Testing a Rewarded Ad

@flashmandv
Copy link
Author

These are the test ad IDs that I used in HMSAdsKitManager:

private const string TestInterstitialAdId = "testb3ltpi8wg4";
private const string TestRewardedAdId = "testr7r1yk97jh";

should they be without the test prefix? I tested with and without test prefix but no ads were shown in any case (the builds I've sent you have the test prefix)

@alihan98ersoy
Copy link
Collaborator

Your test ID seems wrong. And test prefix included.
Can you test with these test IDs?

        private const string TestBannerAdId = "testw6vs28auh3";
        private const string TestInterstitialAdId = "testb4znbuh3n2";
        private const string TestRewardedAdId = "testx9dtjwj8hp";
        private const string TestSplashImageAdId = "testq6zq98hecj";
        private const string TestSplashVideoAdId = "testd7c5cewoj6";

image
image

@flashmandv
Copy link
Author

Hello,

I tried it but it still refuses to show ads. I remember I changed these default values after my initial tests did not show working ads...so that's not the problem

@alihan98ersoy
Copy link
Collaborator

Hello,

Can you try to build our demo scene(Huawei/Demos/Ads/AdsDemo.unity) with these kit settings [Picture]? If it works maybe the problem can be in the scripts. So you can refer to our demo scene to solve the problem.
image

@flashmandv
Copy link
Author

I tried the demo but still no test ads are shown. The splash image and splash video are flashing black screen for parts of a second but no actual (test)ad is shown.

Here is my AndroidManifest if you see something wrong:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.boardgamesonline.Rento.huawei" android:installLocation="preferExternal" android:versionCode="0" android:versionName="1.0" xmlns:amazon="http://schemas.amazon.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
  <supports-screens android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application  android:usesCleartextTraffic="true" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false" android:allowBackup="true">
    <activity android:exported="true" android:name="com.playrento.deeplink.RentoUnityPlayerActivity" android:label="@string/app_name" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize" android:launchMode="singleTask" 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>
      <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="http" android:host="playrento.com" android:pathPrefix="/inv" />
        <data android:scheme="https" android:host="playrento.com" android:pathPrefix="/inv" />
      </intent-filter>
      <intent-filter android:autoVerify="false">
        <action android:name="android.intent.action.VIEW" />
        <data android:scheme="rento" android:host="inv/" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
      <meta-data android:name="android.app.lib_name" android:value="unity" />
      <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />

    </activity>
	<activity android:exported="false"
    android:name="com.astricstore.imageandvideopicker.AndroidPickerActivity"
    android:configChanges="orientation|keyboardHidden|screenSize">
    </activity>
     <activity android:exported="false"
    android:name="eu.janmuller.android.simplecropimage.CropImage"
    android:configChanges="orientation|keyboardHidden|screenSize">
    </activity>
    <meta-data android:name="com.huawei.hms.client.appid" android:value="appid=101046261" />
    <meta-data android:name="com.huawei.hms.client.cpid" android:value="cpid=890359200004000064" />
    <meta-data android:name="com.huawei.hms.version" android:value="2.6.1" />
    <provider android:name="com.huawei.updatesdk.fileprovider.UpdateSdkFileProvider" android:authorities="net.boardgamesonline.Rento.huawei.updateSdk.fileProvider" android:exported="false" android:grantUriPermissions="true" />

    <service android:exported="false" android:name=".MyFirebaseMessagingService">
      <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT" />
      </intent-filter>
    </service>
    <service android:exported="false" android:name=".MyFirebaseInstanceIDService">
      <intent-filter>
        <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
      </intent-filter>
    </service>
   
  </application>
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- used by image picker -->
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- used by image picker -->
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="com.huawei.appmarket.service.commondata.permission.GET_COMMON_DATA" />
  <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
 
</manifest>

@alihan98ersoy
Copy link
Collaborator

These 2 line did not work for me. I delete these 2 line and it is working.

<meta-data android:name="com.huawei.hms.version" android:value="2.6.1" />
<provider android:name="com.huawei.updatesdk.fileprovider.UpdateSdkFileProvider" android:authorities="net.boardgamesonline.Rento.huawei.updateSdk.fileProvider" android:exported="false" android:grantUriPermissions="true" />

@flashmandv
Copy link
Author

Unfortunately deleting these lines does not solve it for me. I also tried deleting the other ID metadatas for the Huawei SDK..still no ads on my Samsung (tried test ads and prod).
Here is my mainTemplate.gradle:

buildscript {
	repositories {
		google()
		jcenter()
		 maven {url 'https://developer.huawei.com/repo/'}
	}

	dependencies {
		//classpath 'com.huawei.agconnect:agcp:1.6.1.300'
	}
}

allprojects {
    repositories {
        google()
        jcenter()
        // Configure the Maven repository address for the Petal Ads SDK.
        maven {url 'https://developer.huawei.com/repo/'}
    }
} 

apply plugin: 'com.android.library'

**APPLY_PLUGINS**

dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    
**DEPS**}

android {
    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion **MINSDKVERSION**
        targetSdkVersion **TARGETSDKVERSION**
        ndk {
            abiFilters **ABIFILTERS**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
        consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
		multiDexEnabled true
    }

    lintOptions {
        abortOnError false
    }

    aaptOptions {
		noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }**PACKAGING_OPTIONS**
}**REPOSITORIES****SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**

And here is my launcherTemplate.gradle:

apply plugin: 'com.android.application'
buildscript {
	repositories {
		google()
		jcenter()
		maven {url 'https://developer.huawei.com/repo/'}
	}

	dependencies {
		//classpath 'com.huawei.agconnect:agcp:1.6.1.300'
	}
}

allprojects {
    repositories {
        google()
        jcenter()
        // Configure the Maven repository address for the Petal Ads SDK.
        maven {url 'https://developer.huawei.com/repo/'}
    }
} 

dependencies {

    implementation 'androidx.multidex:multidex:2.0.1'
    implementation project(':unityLibrary')
    }

android {
    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion **MINSDKVERSION**
        targetSdkVersion **TARGETSDKVERSION**
		multiDexEnabled true
        applicationId '**APPLICATIONID**'
        ndk {
            abiFilters **ABIFILTERS**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
    }

    aaptOptions {
        noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**] + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }**SIGN**

    lintOptions {
        abortOnError false
    }

    buildTypes {
        debug {
            minifyEnabled **MINIFY_DEBUG**
            
            proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
            jniDebuggable true
        }
        release {
            minifyEnabled **MINIFY_RELEASE**
            
            proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
        }
    }**PACKAGING_OPTIONS****SPLITS**
**BUILT_APK_LOCATION**
    bundle {
        language {
            enableSplit = false
        }
        density {
            enableSplit = false
        }
        abi {
            enableSplit = true
        }
    }
}**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP**

And the settings in Unity:

image

image

image

@Andronovo-bit
Copy link
Collaborator

We put your settings through their paces on several devices. We will keep you updated on the outcome.

@Andronovo-bit
Copy link
Collaborator

Andronovo-bit commented May 8, 2023

Hello,

Following our testing, we did not encounter the Reason:$3 error; however, we did come across various other errors.

It is possible that these errors are due to a change in the testID. The error we encountered may differ from error code 3.

  • Could you please login the AppGallery store with your Huawei ID? (for Region change)
  • Could you please perform a test using the provided IDs and share the APK with us?

This will allow us to determine if the error corresponds to the one we encountered, and if so, we can provide a solution. If not, we will continue our investigation.

@flashmandv
Copy link
Author

Hello @Andronovo-bit ,
The "Use Test Ads" apk I've sent is using exactly these default IDs from the SDK.
I'm also logging in with huawei ID and still no ad is shown.

@Andronovo-bit
Copy link
Collaborator

I got it @flashmandv. Could the error you get be different when you use default test ids and when you say "Use Test Ads" ?

For example, before you were getting Reason:$3 error for Interstitial ads, could you be getting network error or Reason:$2 error now?

If the error has changed, you may probably not be able to see the ads due to another problem.

Did you try to change the region in AppGallery after using the default test ids and checking the ""Use Test Ads"" checkbox?

The application you gave in this app link contains the following ids and "Use Test Ads" is checked. Is this is right?

@alihan98ersoy alihan98ersoy added details requested Details requested for the issue and removed investigating We are investigating the current problem labels May 9, 2023
@alihan98ersoy alihan98ersoy added the timeout and closed A month passed after the solution was given. label Jun 22, 2023
@salman714
Copy link

I just tested it with a Samsung phone and it is working for me. If you want, we can investigate the problem together. You can reopen this issue

can you share the sdk which is working on samsung phone if yes
reply me on salmanmadni10@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
details requested Details requested for the issue timeout and closed A month passed after the solution was given.
Projects
None yet
Development

No branches or pull requests

4 participants