Unity Plugin Issues: ClassNotFoundException : com.google.unity.ads.UnityAdListener

4,450 views
Skip to first unread message

Dom Drysdale

unread,
Jul 10, 2014, 7:10:36 AM7/10/14
to google-adm...@googlegroups.com
Hi guys,

I've receiving this issue when I try to use the example scene. I'm using Unity 4.3.

I've added the google-play-services_lib to my project, and am using the default AndroidManifest.

What are the possible causes of this issue? Is there a step I have forgotten or an issue with my Manifest?

Thanks

Full logs from logcat:

 AndroidJavaException: java.lang.ClassNotFoundException: com.g
oogle
.unity.ads.UnityAdListener
I
/Unity   (29103):   at UnityEngine.AndroidJNISafe.CheckException () [0x00000] i
n
<filename unknown>:0
I
/Unity   (29103):   at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPt
r clazz
, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unkn
own
>:0
I
/Unity   (29103):   at UnityEngine.AndroidJavaObject._CallStatic[AndroidJavaObj
ect
] (System.String methodName, System.Object[] args) [0x00000] in <filename unk
nown
>:0
I
/Unity   (29103):   at UnityEngine.AndroidJavaObject.CallStatic[AndroidJavaObje
ct
] (System.String methodName, System.Object[] args) [0x00000] in <filename unkn
own
>:0
I
/Unity   (29103):   at UnityEngine.AndroidJavaObject.FindClass (System.String n
ame
) [0x00000] in <filename unknown>:0
I
/Unity   (29103):   at UnityEngine.AndroidJavaClass._AndroidJavaClass (System.S
tring className
) [0x00000] in <filename unknown>:0
I
/Unity   (29103):   at UnityEngine.AndroidJavaClass..ctor (System.String classN
ame
) [0x00000] in <filename unknown>:0
I
/Unity   (29103):   at UnityEngine.AndroidJavaProxy..ctor (System.String javaIn
terface
) [0x00000] in


Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.example.admobtest" android:versionName="1.0" android:versionCode="1">
 
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
 
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false">
   
<!-- meta-data tag for Google Play services -->
   
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
 
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
   
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
     
<intent-filter>
       
<action android:name="android.intent.action.MAIN" />
       
<category android:name="android.intent.category.LAUNCHER" />
     
</intent-filter>
   
</activity>
   
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
   
</activity>
   
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
     
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
     
<meta-data android:name="android.app.lib_name" android:value="unity" />
   
</activity>
   
<activity android:name="com.unity3d.player.VideoPlayer" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
   
</activity>
   
<!-- Google Mobile Ads Activity -->
 
<activity android:name="com.google.android.gms.ads.AdActivity"
             
android:label="@string/app_name"
             
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
   
</activity>
   
<activity android:label="@string/app_name" android:name="BannerExample">
     
<intent-filter>
       
<action android:name="android.intent.action.MAIN"/>
       
<category android:name="android.intent.category.LAUNCHER"/>
     
</intent-filter>
   
</activity>
 
</application>
 
<uses-feature android:glEsVersion="0x00020000" />
 
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
   
<uses-permission android:name="android.permission.INTERNET"/>
 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>


Eric Leichtenschlag

unread,
Jul 10, 2014, 4:58:29 PM7/10/14
to google-adm...@googlegroups.com
Hello,

The com.google.unity.ads.UnityAdListener class comes from the unity-plugin-library project that's a part of the Android component of the plugin. It looks like you're missing this jar, which should live in Assets/Plugins/Android. You can reimport the jar by importing the asset from GoogleMobileAds.unitypackage, or alternatively you could build the unity-plugin-library yourself and stick the resulting binary into Assets/Plugins/Android.

Thanks,
Eric

 
<uses-sdk android:minSdkVersion=<span style="color: #080;" clas
...
Reply all
Reply to author
Forward
0 new messages