title: Appodeal Banner Ads in LibGDX "Wrong Package Name"
body: <p>I’m trying to test Appodeal’s demo banner ads inside of LibGDX and I get this banner that displays a “You provided a wrong package name” error.</p>
  <p><a href="https://i.stack.imgur.com/5a0Ll.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5a0Ll.jpg" alt="enter image description here" /></a></p>
  <p>I’ve googled that error message but cannot find anything. I have downloaded the Appodeal test app and their test ads display correctly. I am using the same test ID’s for Appodeal and Admob that their test app uses. I have gone through their setup tutorial and looked at the code for their test app, but I cannot figure out what I’m doing wrong. Any help figuring this out will be greatly appreciated!</p>
  <p>I created a small test app, here is my code.</p>
  <p><strong>AndroidLauncher.java</strong></p>
  <pre><code>package com.mygdx.adtest;
  
  import android.os.Bundle;
  import android.view.View;
  import android.view.Window;
  import android.view.WindowManager;
  import android.widget.RelativeLayout;
  
  import com.appodeal.ads.Appodeal;
  import com.appodeal.ads.BannerView;
  import com.badlogic.gdx.backends.android.AndroidApplication;
  import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
  
  public class AndroidLauncher extends AndroidApplication {
      @Override
      protected void onCreate (Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
          
          // LAYOUT: combines LibGDX View and Ad View
          RelativeLayout relativeLayout = new RelativeLayout(this);
          
          // Ad View
          Appodeal.initialize(this, &quot;fee50c333ff3825fd6ad6d38cff78154de3025546d47a84f&quot;, Appodeal.BANNER);
          Appodeal.setTesting(true);
          Appodeal.show(this, Appodeal.BANNER);
          
          BannerView bannerView = new BannerView(this, null);
          Appodeal.setBannerViewId(bannerView.getId());
          
          // LibGDX View
          requestWindowFeature(Window.FEATURE_NO_TITLE);
          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
          getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);     
          View libgdxView = initializeForView(new AppodealTest(), config);
          
          // add to view
          relativeLayout.addView(bannerView);
          relativeLayout.addView(libgdxView);
          
          // set layout
          setContentView(relativeLayout);
      }
  }
  </code></pre>
  <p><strong>AppodealTest.java</strong></p>
  <pre><code>package com.mygdx.adtest;
  
  import com.badlogic.gdx.ApplicationAdapter;
  import com.badlogic.gdx.utils.ScreenUtils;
  
  public class AppodealTest extends ApplicationAdapter {
      @Override public void create () { }
      @Override public void render () { ScreenUtils.clear(0.2f, 0.3f, 0.4f, 1); }
      @Override public void dispose () { }
  }
  </code></pre>
  <p><strong>AndroidManifest.xml</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      package=&quot;com.mygdx.adtest&quot; &gt;
      
      &lt;!-- APPODEAL --&gt;
      &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
  
      &lt;application
          android:allowBackup=&quot;true&quot;
          android:icon=&quot;@drawable/ic_launcher&quot;
          android:isGame=&quot;true&quot;
          android:appCategory=&quot;game&quot;
          android:label=&quot;@string/app_name&quot;
          android:theme=&quot;@style/GdxTheme&quot; &gt;
          
          &lt;activity
              android:name=&quot;com.mygdx.adtest.AndroidLauncher&quot;
              android:label=&quot;@string/app_name&quot; 
              android:screenOrientation=&quot;fullUser&quot;
              android:configChanges=&quot;keyboard|keyboardHidden|navigation|orientation|screenSize|screenLayout&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
                  &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      
          &lt;!-- ADMOB --&gt;
          &lt;meta-data
                  android:name=&quot;com.google.android.gms.ads.APPLICATION_ID&quot;
                  android:value=&quot;ca-app-pub-3940256099942544~3347511713&quot;/&gt;
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  <p><strong>PROJECT: build.gradle</strong></p>
  <pre><code>buildscript {
      repositories {
          mavenLocal()
          mavenCentral()
          gradlePluginPortal()
          maven { url &quot;https://oss.sonatype.org/content/repositories/snapshots/&quot; }
          google()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:7.0.4'
      }
  }
  
  allprojects {
      apply plugin: &quot;eclipse&quot;
      version = '1.0'
      ext {
          appName = &quot;AppodealTest&quot;
          gdxVersion = '1.10.0'
          roboVMVersion = '2.3.12'
          box2DLightsVersion = '1.5'
          ashleyVersion = '1.7.3'
          aiVersion = '1.8.2'
          gdxControllersVersion = '2.1.0'
      }
      repositories {
          mavenLocal()
          mavenCentral()
          google()
          gradlePluginPortal()
          maven { url &quot;https://oss.sonatype.org/content/repositories/snapshots/&quot; }
          maven { url &quot;https://oss.sonatype.org/content/repositories/releases/&quot; }
      }
  }
  
  project(&quot;:desktop&quot;) {
      apply plugin: &quot;java-library&quot;
      dependencies {
          implementation project(&quot;:core&quot;)
          api &quot;com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion&quot;
          api &quot;com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop&quot;
      }
  }
  
  project(&quot;:android&quot;) {
      apply plugin: &quot;com.android.application&quot;
      configurations { natives }
      dependencies {
          implementation project(&quot;:core&quot;)
          api &quot;com.badlogicgames.gdx:gdx-backend-android:$gdxVersion&quot;
          natives &quot;com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a&quot;
          natives &quot;com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a&quot;
          natives &quot;com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86&quot;
          natives &quot;com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64&quot;
      }
  }
  
  project(&quot;:core&quot;) {
      apply plugin: &quot;java-library&quot;
      dependencies {
          api &quot;com.badlogicgames.gdx:gdx:$gdxVersion&quot;
      }
  }
  </code></pre>
  <p><strong>ANDROID: build.gradle</strong></p>
  <pre><code>android {
      buildToolsVersion &quot;30.0.2&quot;
      compileSdkVersion 30
      sourceSets {
          main {
              manifest.srcFile 'AndroidManifest.xml'
              java.srcDirs = ['src']
              aidl.srcDirs = ['src']
              renderscript.srcDirs = ['src']
              res.srcDirs = ['res']
              assets.srcDirs = ['assets']
              jniLibs.srcDirs = ['libs']
          }
      }
      packagingOptions {
          exclude 'META-INF/robovm/ios/robovm.xml'
      }
      defaultConfig {
          applicationId &quot;com.mygdx.adtest&quot;
          minSdkVersion 16
          targetSdkVersion 30
          multiDexEnabled true
          versionCode 1
          versionName &quot;1.0&quot;
      }
      buildTypes {
          release {
              minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      
      // APPODEAL
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  }
  
  // called every time gradle gets executed, takes the native dependencies of
  // the natives configuration, and extracts them to the proper libs/ folders
  // so they get packed with the APK.
  task copyAndroidNatives {
      doFirst {
          file(&quot;libs/armeabi/&quot;).mkdirs()
          file(&quot;libs/armeabi-v7a/&quot;).mkdirs()
          file(&quot;libs/arm64-v8a/&quot;).mkdirs()
          file(&quot;libs/x86_64/&quot;).mkdirs()
          file(&quot;libs/x86/&quot;).mkdirs()
          configurations.natives.copy().files.each { jar -&gt;
              def outputDir = null
              if (jar.name.endsWith(&quot;natives-arm64-v8a.jar&quot;)) outputDir = file(&quot;libs/arm64-v8a&quot;)
              if (jar.name.endsWith(&quot;natives-armeabi-v7a.jar&quot;)) outputDir = file(&quot;libs/armeabi-v7a&quot;)
              if(jar.name.endsWith(&quot;natives-armeabi.jar&quot;)) outputDir = file(&quot;libs/armeabi&quot;)
              if(jar.name.endsWith(&quot;natives-x86_64.jar&quot;)) outputDir = file(&quot;libs/x86_64&quot;)
              if(jar.name.endsWith(&quot;natives-x86.jar&quot;)) outputDir = file(&quot;libs/x86&quot;)
              if(outputDir != null) {
                  copy {
                      from zipTree(jar)
                      into outputDir
                      include &quot;*.so&quot;
                  }
              }
          }
      }
  }
  
  tasks.whenTaskAdded { packageTask -&gt;
      if (packageTask.name.contains(&quot;package&quot;)) {
          packageTask.dependsOn 'copyAndroidNatives'
      }
  }
  
  task run(type: Exec) {
      def path
      def localProperties = project.file(&quot;../local.properties&quot;)
      if (localProperties.exists()) {
          Properties properties = new Properties()
          localProperties.withInputStream { instr -&gt;
              properties.load(instr)
          }
          def sdkDir = properties.getProperty('sdk.dir')
          if (sdkDir) {
              path = sdkDir
          } else {
              path = &quot;$System.env.ANDROID_HOME&quot;
          }
      } else {
          path = &quot;$System.env.ANDROID_HOME&quot;
      }
      def adb = path + &quot;/platform-tools/adb&quot;
      commandLine &quot;$adb&quot;, 'shell', 'am', 'start', '-n', 'com.mygdx.adtest/com.mygdx.adtest.AndroidLauncher'
  }
  
  eclipse.project.name = appName + &quot;-android&quot;
  
  // APPODEAL
  repositories {
      // Add Appodeal repository
      maven { url &quot;https://artifactory.appodeal.com/appodeal&quot; }
  }
  
  dependencies {
      implementation 'androidx.multidex:multidex:2.0.1'
      
      // APPODEAL
      implementation 'com.appodeal.ads:sdk:2.10.3.+'
  }
  </code></pre>
  <p><strong>network_security_config.xml</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;network-security-config&gt;
      &lt;base-config cleartextTrafficPermitted=&quot;true&quot;&gt;
          &lt;trust-anchors&gt;
              &lt;certificates src=&quot;system&quot; /&gt;
              &lt;certificates src=&quot;user&quot; /&gt;
          &lt;/trust-anchors&gt;
      &lt;/base-config&gt;
      &lt;domain-config cleartextTrafficPermitted=&quot;true&quot;&gt;
          &lt;domain includeSubdomains=&quot;true&quot;&gt;127.0.0.1&lt;/domain&gt;
      &lt;/domain-config&gt;
  &lt;/network-security-config&gt;
  </code></pre>