java - Amazon ads api crashing my app? -
the following classes not instantiated: - com.amazon.device.ads.adlayout (open class, show error log) see error log (window > show view) more details. tip: use view.isineditmode() in custom views skip code when shown in eclipse
java.lang.noclassdeffounderror: not initialize class android.os.environment @ com.amazon.device.ads.debugproperties.readdebugproperties(debugproperties.java:75) @ com.amazon.device.ads.internaladregistration.<init>(internaladregistration.java:52) @ com.amazon.device.ads.internaladregistration.getinstance(internaladregistration.java:64) @ com.amazon.device.ads.adlayout.initialize(adlayout.java:185) @ com.amazon.device.ads.adlayout.initialize(adlayout.java:176) @ com.amazon.device.ads.adlayout.<init>(adlayout.java:120) @ sun.reflect.nativeconstructoraccessorimpl.newinstance0( @ sun.reflect.nativeconstructoraccessorimpl.newinstance( @ sun.reflect.delegatingconstructoraccessorimpl.newinstance( @ java.lang.reflect.constructor.newinstance( @ com.android.ide.eclipse.adt.internal.editors.layout.projectcallback.instantiateclass(projectcallback.java:422) @ com.android.ide.eclipse.adt.internal.editors.layout.projectcallback.loadview(projectcallback.java:179) @ android.view.bridgeinflater.loadcustomview(bridgeinflater.java:207) @ android.view.bridgeinflater.createviewfromtag(bridgeinflater.java:135) @ android.view.layoutinflater.rinflate_original(layoutinflater.java:755) @ android.view.layoutinflater_delegate.rinflate(layoutinflater_delegate.java:64) @ android.view.layoutinflater.rinflate(layoutinflater.java:727) @ android.view.layoutinflater.inflate(layoutinflater.java:492) @ android.view.layoutinflater.inflate(layoutinflater.java:373)
my main.xml looks this
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:amazon="http://schemas.android.com/apk/lib/com.amazon.device.ads" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/linearlayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:gravity="top|center_horizontal" > <com.amazon.device.ads.adlayout android:id="@+id/myadview" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <scrollview android:layout_width="fill_parent" android:layout_height="fill_parent" >
my mainactivity.java this
import com.amazon.device.ads.adlayout; import com.amazon.device.ads.adregistration; import com.amazon.device.ads.adtargetingoptions; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); preferences = preferencemanager.getdefaultsharedpreferences(this); int defaultvalue = r.drawable.blue; int themedefault = themechanger.theme_blue; appliedtheme = preferences.getint("mytheme", themedefault); themechanger.onactivitycreatesettheme(this, appliedtheme); setcontentview(r.layout.main); adregistration.setappkey("application_key"); this.adview = (adlayout) findviewbyid(r.id.myadview); this.adview.loadad(new adtargetingoptions()); button1 = preferences.getint("digitbuttonstyle", defaultvalue); buttonmadd = preferences.getint("memorybuttonstyle", defaultvalue); buttoncos = preferences.getint("functionbuttonstyle", defaultvalue);
i had same issue , followed amazon developer guide. solve issue, copy amazon library , paste in libs folder , run.
Comments
Post a Comment