Skip to main content

Android FAQ

Load Failed

1.Integration error

  • Adapter Not Integrated

Developers need to confirm that the integrated SDK is correctly added to the project according to SDK DownLoad Platform.If the third-party Adapter cannot be found, an error adapter not found or Couldn't locate or instantiate custom event null will be reported;

  • ProGuard Configuration Not Set

Add obfuscation according to the "SDK Configuration" document.

  • Confirm whether the integrated advertising source requires passing in Activity

Some third-party sources require activity to successfully request. If no activity is passed in, it will always fail.

  • New Object Error

Confirm that the TP advertising slot type is consistent with the new TPObject type. For example, you cannot create an open-screen advertising slot ID, but use the rewarded video API to request it.

2.Platform Configuration

  • No advertising source is added in the background

Confirm that the third-party advertising network has been added under the advertising slot ID created by TradPlus. If the configuration cannot be pulled, no config will be reported

  • Configure different APPIDs for the same advertising platform
  • Confirm whether the third-party advertising sources configured in the TradPlus backend have multiple APPIDs.
  • Backend configuration error. Even if they are of different types, only the same APPID can be configured.
  • For example, the appId and appkey of the Mintegral open screen type are inconsistent with the appId and appkey of the rewarded video type. The third-party platform only supports the initialization of the same APPID. Initialization of multiple APPIDs will cause the request to fail.

3.Requesting a certain source has never been filled

  • Developers need to cooperate with "Error Codes" to locate error issues.

  • Developers can view log information by filteringTradPlusLog or set up LoadAdEveryLayerListenerlistening oneLayerLoadFailed(TPAdError adError, TPAdInfo adInfo) callback to print the reason why each ad source failed to load.

(1)Meta or Admob has not been filled
  • *Meta must use test ads for testing, otherwise there will be a risk of account ban..**You need to use the test ID provided by the third party to test, and you can use the test mode to test.

  • Admob must use test ads for testing, otherwise there is a risk of account suspension.(See screenshot below) For TradPlus test mode testing, the TradPlus backend has configured Admob test ads into the backend, and developers can use it directly.

  • If the network is not good, there will occasionally be a black screen during interstitial video playback, or there will be no display event in the native ad display.

  • Too many requests and no fills even with test ads.

(2)Bidding source official advertisement cannot be configured
The error log is:
waterfall bean is null
or
Bidding Failed
  • Due to the TradPlus server policy, networks that can access domestic IP addresses cannot pull overseas Bidding configurations.

  • Developers can use the TradPlus test mode for testing. If the test ad request is successful and displayed, it means that the internal process has been run through and you can go online directly.

  • If there is a demand that formal advertising testing must be used before going online, the IP must be Bidding overseas to pull the configuration.

(3)TapTap request is not filled
  • Since OAID is particularly important for the advertising conversion effect of TapADN SDK, developers must pass OAID before requesting ads.

  • V9.9.10.1+ supports developers to set oaid

  • Set when requesting an advertisement for the first time, take rewarded video as an example

TPReward mTpReward = new TPReward(activity, "AdUnitId");
Map<String, Object> mLocalExtras = new HashMap<>();
mLocalExtras.put("tap_oaid","oaid of mobile device");
mTpReward.setCustomParams(mLocalExtras);

mTpReward.loadAd();
  • For versions before V9.9.10.1, developers need to rewrite the TapAdCustomController class, pass in oaid, and request advertisements to be forwarded to TP. Developers can refer to the Demo to setting.
TapTapInitManager.getInstance().setTTCustomController(new TapTapUserDataCustomController());

Display Failed

1.After the ad is loaded successfully, showAd is not called

2.Whether the API requested by the advertising slot type matches the type

  • For example, create an open-screen advertising space, but use the rewarded video API to request it.
  • Developers can print onAdVideoError(TPAdInfo tpAdInfo, TPAdError tpAdError) or onAdShowFailed(TPAdError error, TPAdInfo tpAdInfo)view the error reason.

3. Incentive videos and interstitials

  • (1)The showAd call does not pass in the activity

    showAd(Activity activity, String sceneId) Whether display ads are passed into Activity and context will cause some ad sources to fail to display.

  • (2)Backend configuration issues

    errorMsg is frequency limit whether frequency limit is set for the TP advertising slot.

4. NativeAds

  • (1)showAd(ViewGroup adContainer, int layoutId) Whether the container is empty

  • (2)Whether the developer has modified the android🆔 resource ID in the layout file, which will cause the element of the self-rendered advertisement to be unable to find the corresponding ID and fail to display.

  • (3)Backend configuration issues

    errorMsg is frequency limit whether frequency limit is set for the TP advertising slot.

5.SplashAds

  • (1)Developers need to confirm whether the paired API is used to load and display ads and correctly passed into the container. For details, please check the " SplashAds Document"

  • (2)Backend configuration issues

    errorMsg is frequency limit whether frequency limit is set for the TP advertising slot.

6.Meta’s nativebanner

  • The width of the container must be match_parent and cannot be wrap_content, otherwise the display will fail.

AppId not match this AdUnitId

Generally, this prompt occurs in the following situations:

  • Loading is done without calling the initialization of tradplus. In this case, the appid used when loading advertisements is empty.
  • The initialization of calling tradplus is after loading the advertisement, the same as the above situation.
  • If the initialization is not successful, the advertisement will be loaded, the same as the above situation.
  • The test mode of tradplus is turned on. The default configuration of tradplus is delivered in the test mode, which will indeed be different. This can be ignored
  • The initialization is also adjusted in advance, but load still prompts this, so it may be that the appid and advertising slot id used are not under the same app. You need to go to the tradplus background to check the application management.

Compile Error

1.Failed to gralde TP SDK or third-party Adapter Gradle corresponding to TP

  • Step 1 : Developers need to confirm that the integrated SDK is correct according to SDK DownLoad Platform

    • (1)**Whether you are a user who has updated to 5 **:Since the JCenter warehouse has stopped serving, the warehouses of TP and third-party platforms have been updated. Customers who have upgraded from the old version are asked to modify the references one by one according to the packaging platform.
    • (2)Whether the version number can correspond one to one or whether there are typos in the letters
    • (3) Android Studio HTTP Proxy status is normal
    • (4) Whether Gradle belongs to "offline mode" - building projects in 'offline mode' will not pull third-party dependency packages online
  • Step 2:mavenCentral() Confirm that and are correctly introduced in build.gradle at the Module level and Project level google()

	repositories {
mavenCentral()
google()
jcenter()
...
}
}
  • (1) Regarding Module and Project, Unity developers can refer to the Android Studio Module Structure instructions on Google’s official website.
  • (2) Please pay attention to whether mavenCentral() is written as mavenLocal(). mavenLocal() is the local Maven warehouse. The first time you pull TP Gradle, you need to pull it from online.
  • (3) The order in which each code library is listed determines the order in which Gradle searches for each project's dependencies in these code libraries. A situation similar to the picture below indicates that tradplusad ran the wrong warehouse and failed to pull. At this time, the developer needs to adjust the position of mavenCentral() to the highest position and pull again.

  • Step 3:Is Android Studio Gradle offline?
    • I don’t know how to judge. Developers who are new to Android can directly Google or Baidu, "gradle switches online/offline mode".
  • Step 4:Is the agent enabled on the computer? Resulting in "All packages are not available for download" error
    • If you don’t know how to turn it off, developers who are new to Android can directly Google or Baidu, "How to turn off the proxy in Android Studio".
  • Step 5:Some overseas sources were successfully pulled, but some failed to be pulled. Most of them were network problems. Try opening a VPN and switching countries.

2.unexpected element <queries> found

unexpected element <queries> found in <manifest> or Error: Missing package key attribute on element package
  • Since the integrated third-party advertising platform SDK has requirements for the Gradle plugin version, the old version of the Android Gradle plugin cannot find the corresponding element, causing an error.

  • Developers need to first confirm the Gradle version used. Then based on Android Gradle plugin release notes. Find the available Gradle plugin version range and update the Gradle plugin version according to Android Gradle plugin fixes to solve the error problem.

3.try name ‘AndroidManifest.xml’ collided`

Developers need to add in build.gradle

    android {
packagingOptions {
exclude 'AndroidManifest.xml'
}
}

4.java.lang.NoClassDefFoundError:Failed resolution of:Lcom/google/android/gms/ads/rewarded/RewardedAd

  • Reason:Introduce AdMob and Firebase at the same time

  • Solution: Only one can be introduced, and firebase must introduce the same version as the recommended Admob Adapter.

// Version number, just for example, the specific version connected to Firebase must be consistent with the version number recommended by TP Admob
// implementation 'com.google.android.gms:play-services-ads:21.0.0'
implementation 'com.google.firebase:firebase-ads:21.0.0'

5.The Google Mobile Ads SDK was initialized incorrectly

  • Reason:After integrating Google Admob, starting from Google Mobile Advertising SDK v17.0.0, this <meta-data> tag must be added. If not added, the application will crash and receive the above Log.

  • Solution: According to the third-party configuration statement in the "Integration Document", integrate the SDK normally

6.AAPT: error: resource android:attr/lStar not found.

Locat:

Execution failed for task ':app:checkDebugAarMetadata'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.core:core-ktx:1.7.0.
AAR metadata file: .gradle/caches/transforms-2/files-2.1/14c9ccd33a3c43ada608a2400c01e86e/jetified-core-ktx-1.7.0/META-INF/com/android/build/gradle/aar-metadata.properties.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> The minCompileSdk (31) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-30).
Dependency: androidx.core:core:1.7.0.
AAR metadata file:.gradle/caches/transforms-2/files-2.1/ac6a4373db31c761b96c2d467c311f0a/core-1.7.0/META-INF/com/android/build/gradle/aar-metadata.properties.
  • Reason:The core-ktx, core version and project version referenced in the SDK version of the integrated third-party platform are different
  • Solution 1: You need to change the compiled version compileSdkVersion to upgrade to 31, and then recompile
  • Solution 2: Add the following to the app's build.gradle to force the project to use a specific version. The code example is as follows:
configurations.all {
resolutionStrategy {
// Developers need to introduce existing versions in the project
force 'androidx.core:core-ktx:1.5.0','androidx.core:core:1.6.0'
}
}

7.Duplicate reference com.tencent.mm.opensdk

  • MTG supports the mini program jump function starting from SDK 16.1.7 version

  • Unlisted GP Market SDK will automatically import opensdk. There will be conflicts if developers access GDT at the same time. You can use exclude to exclude.

implementation ("com.mbridge.msdk.china:reward:${sdkVersion}"){
exclude group: "com.tencent.mm.opensdk", module: "wechat-sdk-android"
}
implementation ("com.mbridge.msdk.china:mbsplash:${sdkVersion}"){
exclude group: "com.tencent.mm.opensdk", module: "wechat-sdk-android"
}
implementation ("com.mbridge.msdk.china:mbbanner:${sdkVersion}"){
exclude group: "com.tencent.mm.opensdk", module: "wechat-sdk-android"
}
implementation ("com.mbridge.msdk.china:mbnative:${sdkVersion}"){
exclude group: "com.tencent.mm.opensdk", module: "wechat-sdk-android"
}
implementation ("com.mbridge.msdk.china:mbnativeadvanced:${sdkVersion}"){
exclude group: "com.tencent.mm.opensdk", module: "wechat-sdk-android"
}
implementation ("com.mbridge.msdk.china:newinterstitial:${sdkVersion}"){
exclude group: "com.tencent.mm.opensdk", module: "wechat-sdk-android"
}
implementation ("com.mbridge.msdk.china:mbbid:${sdkVersion}"){
exclude group: "com.tencent.mm.opensdk", module: "wechat-sdk-android"
}

8. Updating Google Admob SDK to V21.0.0, there is a conflict with Firebase and an error is reported

Duplicate class com.google.android.gms.measurement.internal.zzhe found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.1-runtime (com.google.android.gms:play-services-measurement-impl:19.0.1)
  • Solution: Update FireBase to the latest version

9.Error:AAPT: error: unexpected element <property> found in <manifest><application>

  • Reason:Google Admob has been updated to 22.4.0 or Yandex has been updated to 6.0.1. These two platforms have requirements for the Android Gradle version. The lower version of Android Gradle cannot find the corresponding element, causing an error.

  • Solution: Update the Gradle plugin version to 4.2.0+

Runtime Exception

1.Adx Crash:android.content.res.Resources$NotFoundException: String resource ID #0x0.

  • Resources prefixed with tp need to be added to the whitelist. Learn more about the "SDK Configuration - Resource Optimization" document

2.Caused by: android.view. InflateException: Binary XML file line #34:Error inflating class com. kwad.components.ad.reflux. KsRefluxView

Caused by: android.view. InflateException: Binary XML file line #34:Error inflating class com. kwad.components.ad.reflux. KsRefluxView Caused by: android. view. InflateException: Binary XML file line #34: Error inflating class com.kwad.components.ad.reflux. KsRefluxView.

  • Integrate Kuaishou SDK and crash when displaying videos.

  • Reason:Lack of recyclerview introduction

  • Solution: Check the packaging platform and fill in any missing dependencies.

3.java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion

  • Reason:In Android 6.0, the SDK removed support for the Apache HTTP client. Starting with Android 9, this content library has been removed from the bootclasspath, and apps cannot use it by default.
  • Solution:configure apache in the manifest file
<application>
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
</application>

4.java.lang.RuntimeException: Manifest merger failed with multiple errors

  • Reason:The network security configuration of version V9.2.0.1 is written into the SDK. Projects upgraded from old versions will report errors because this configuration has been added to the manifest file.

  • Solution

  • Method 1: Delete the network security configuration added in the original project

<application
// Delete this configuration
android:networkSecurityConfig="@xml/network_security_config">
</application>
  • Method 2: Specify attribute replacement and use the configuration in the project
<application
android:networkSecurityConfig="@xml/network_security_config"
tools:replace="android:networkSecurityConfig"
>
</application>

Unity3D Access

When the incentive (interstitial) ad is playing, the ad does not continue to play when the screen is switched and then returned to the game.

  • Unity uses the singletask mode when compiling, so switching to the desktop and clicking the icon to enter will clear all the upper layers of the game interface. If the task manager comes back, there will be no exception.
  • Singletask is Unity’s official recommended mode. If you need to modify it, you can find relevant articles online.

Release GooglePlay

1.Permission

Developers need to confirm whether to integrate domestic sources according to SDK DownLoad Platform. Domestic sources cannot be listed on GP.

2.Issue a warning that "play-services-tasks (com.google.android.gms:play-services-tasks)" version 18.0.0 has serious problems and requires an update

  • Reasonplay-services-tasks Caused by the introduction of version V18.0.0 into a certain overseas source pom file.

  • **Solution **: Remove the specified version from the configuration in build.gradle

android {
...
configurations.all{
resolutionStrategy.force 'com.google.android.gms:play-services-tasks:18.0.0'
}
}

3.Error reported when releasing com.my.tracker:mytracker-sdk The SDK will collect personal data or sensitive data

  • Reason:A certain reference in MyTarget SDK caused
  • Solution: Remove the specified mytracker-sdk version from the configuration in build.gradle
implementation ('com.my.target:mytarget-sdk:5.15.0') {
exclude group: 'com.my.tracker', module: 'mytracker-sdk'
}
implementation 'com.my.tracker:mytracker-sdk:3.0.9'

Other

1. Kotlin calls java code

If the kotlin project integrates tp, you need to pay attention to the null judgment of various interface parameters.

  • It is recommended to initialize the SDK in Application, otherwise the background cannot accurately count DAU.
  • If the application DAU statistics are UI DAU, that is, the application has keep-alive or notifications, then it is recommended to initialize the SDK in the activity.
  • Multi-process applications are only initialized in one process.

For more questions, please contact us at: tech_support@tradplus.com