Android 安卓横幅不工作

Android 安卓横幅不工作,android,smartbanner,Android,Smartbanner,当我运行它时,它会给出一个java堆空间错误,并且再次给出一条消息,您的项目包含错误,请在运行之前修复这些错误,并且再次显示与发生内部错误相关的消息,请关闭workbench。我也使用mobile的测试id,但每次都会发生相同的错误 布局文件: activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com

当我运行它时,它会给出一个java堆空间错误,并且再次给出一条消息,您的项目包含错误,请在运行之前修复这些错误,并且再次显示与发生内部错误相关的消息,请关闭workbench。我也使用mobile的测试id,但每次都会发生相同的错误

布局文件:

activity_main.xml

  <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:ads="http://schemas.android.com/apk/res-auto"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical">

         <com.google.android.gms.ads.AdView`enter code here`
            android:id="@+id/adView"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            ads:adSize=" SMART_BANNER "
            ads:adUnitId="ca-app-pub-7222219345251053/8664557124" />

    </LinearLayout>
这是我的eclipse.ini

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-product
com.android.ide.eclipse.adt.package.adtproduct
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vmargs “c:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe”
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=2028m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-Xms2028m
-Xmx6120m

试着从动态的角度设置adUnitId,例如

<uradreference>.setAdUnitId("ca-app-pub-7409237681170791/6275305467");

还可以尝试使用广告:adSize=BANNER first!它应该会起作用。

虽然我假设您希望有人解释为什么会出现java堆空间错误,但如果您真的问这个问题会更好,并且还提到了除了发布到堆栈溢出之外,您还试图做些什么来修复它。当我检查库时,android私有库是google-play-services.jar,并且在google-play-services_lib.jarin build path>>配置build path>>order and export中检查了android依赖项,然后它挂起,当我取消选中时,它给出了错误'com.google.android.gms.ads.AdView',引用自方法com.google.android.gms.samples.ads.bannerxmlacitive.onCreate我已经使用了堆栈流中与此错误相关的所有内容com.google.android.gms.ads.AdView',引用自方法com.google.android.gms.samples.ads.bannerxmlacitive.onCreate。但仍然存在错误。
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-product
com.android.ide.eclipse.adt.package.adtproduct
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vmargs “c:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe”
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=2028m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-Xms2028m
-Xmx6120m
<uradreference>.setAdUnitId("ca-app-pub-7409237681170791/6275305467");