Java Question Exception Ljava/lang/NoClassDefFoundError; thrown while initializing

Johnmcenroy

Active Member
Licensed User
Longtime User
I am developing library of Millennial Media ad network for B4A , banners work ok but something wrong
with interstitial when showing. Here is log:
B4X:
Millennial Interstitial Ad - Ad loaded splendidly
Interstitial Loaded
VFY: unable to resolve static field 20519 (mmadsdk_mraid_resize_close_area_size) in Lcom/millennialmedia/R$dimen;
VFY: replacing opcode 0x60 at 0x0010
Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/millennialmedia/internal/SizableStateManager;
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0xa4b5a648)
main_btnshow_click (java line: 446)
java.lang.NoClassDefFoundError: com.millennialmedia.R$dimen
    at com.millennialmedia.internal.SizableStateManager.<clinit>(SizableStateManager.java:98)
    at com.millennialmedia.internal.adcontrollers.WebController.getSizableStateManager(WebController.java:185)
    at com.millennialmedia.internal.adcontrollers.WebController$4.run(WebController.java:162)
    at com.millennialmedia.internal.utils.ThreadUtils.runOnUiThread(ThreadUtils.java:90)
    at com.millennialmedia.internal.adcontrollers.WebController.showExpanded(WebController.java:158)
    at com.millennialmedia.internal.adadapters.InterstitialWebAdapter.show(InterstitialWebAdapter.java:124)
    at com.millennialmedia.InterstitialAd.show(InterstitialAd.java:551)
    at com.millennialmedia.InterstitialAd.show(InterstitialAd.java:519)
    at com.mopub.mobileads.MillennialInterstitial.showInterstitial(MillennialInterstitial.java:109)
    at com.mopub.mobileads.CustomEventInterstitialAdapter.showInterstitial(CustomEventInterstitialAdapter.java:100)
    at com.mopub.mobileads.MoPubInterstitial.showCustomEventInterstitial(MoPubInterstitial.java:96)
    at com.mopub.mobileads.MoPubInterstitial.show(MoPubInterstitial.java:89)
    at mopublibfull.MoPubLibFull.ShowMopub_Interstitial(MoPubLibFull.java:155)
    at mopub.test.main._btnshow_click(main.java:446)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
    at android.view.View.performClick(View.java:4240)
    at android.view.View$PerformClick.run(View.java:17721)
    at android.os.Handler.handleCallback(Handler.java:730)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5103)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.millennialmedia.R$dimen
    at com.millennialmedia.internal.SizableStateManager.<clinit>(SizableStateManager.java:98)
    at com.millennialmedia.internal.adcontrollers.WebController.getSizableStateManager(WebController.java:185)
    at com.millennialmedia.internal.adcontrollers.WebController$4.run(WebController.java:162)
    at com.millennialmedia.internal.utils.ThreadUtils.runOnUiThread(ThreadUtils.java:90)
    at com.millennialmedia.internal.adcontrollers.WebController.showExpanded(WebController.java:158)
    at com.millennialmedia.internal.adadapters.InterstitialWebAdapter.show(InterstitialWebAdapter.java:124)
    at com.millennialmedia.InterstitialAd.show(InterstitialAd.java:551)
    at com.millennialmedia.InterstitialAd.show(InterstitialAd.java:519)
    at com.mopub.mobileads.MillennialInterstitial.showInterstitial(MillennialInterstitial.java:109)
    at com.mopub.mobileads.CustomEventInterstitialAdapter.showInterstitial(CustomEventInterstitialAdapter.java:100)
    at com.mopub.mobileads.MoPubInterstitial.showCustomEventInterstitial(MoPubInterstitial.java:96)
    at com.mopub.mobileads.MoPubInterstitial.show(MoPubInterstitial.java:89)
    at mopublibfull.MoPubLibFull.ShowMopub_Interstitial(MoPubLibFull.java:155)
    at mopub.test.main._btnshow_click(main.java:446)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
    at android.view.View.performClick(View.java:4240)
    at android.view.View$PerformClick.run(View.java:17721)
    at android.os.Handler.handleCallback(Handler.java:730)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5103)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)

I have attached SizableStateManger class

UPDATE: Found a solution. There must be additional resource dimens.xml with the following text:
B4X:
<resources>
    <dimen name="mmadsdk_mraid_resize_close_area_size">50dp</dimen>
</resources>
in res\values folder for package com.millennialmedia.
B4X:
#AdditionalRes: C:\AdsTest\MopubLib\B4A TEST\res, com.millennialmedia

Thanks
 

Attachments

  • SizableStateManager.java.txt
    28.1 KB · Views: 302
Last edited:
Top