我知道這個問題已被多次詢問,但我仍然無法解決問題。我嘗試通過xml資源向我的應用添加橫幅廣告,但是當我從xml視圖切換到圖形佈局或清理我的項目時,我收到以下消息:「com.google.android.gms.ads.AdView failed to實例,googleplayservices上的java.lang.verifyerror adView類實例化
java.lang.VerifyError: Expecting a stackmap frame at branch target 77."
有時會說的分支目標是在57
我使用googleplayservices SDK版本。 我用java jdk 7u51
,目前8u5嘗試。 日食版本kepler和目前luna。 我有comp在java 1.5,1.6和1.7下運行。
我已經嘗試將
adMob.jar
文件添加到構建路徑。我已經按照谷歌的所有說明(以及我在本網站上找到的所有變體)來信,但仍然沒有結束。我已經嘗試將安裝的JRE
s中的默認VM的參數參數更改爲-XX:-UseSplitVerifier
。我曾嘗試加入googleplayservices lib文件夾直接構建路徑,並通過添加libs文件夾,然後把它放在那裏。
我改變了順序並導出,以便googleplayservices位於我的構建路徑的頂部。我曾嘗試將googleplayservices添加爲源文件夾。
最後,我已經嘗試了這些選項中的每一個單獨和它們的不同組合。
我一直在編碼一年多了,這是我第一次沒有能夠得到一個解決這個網站的答案。
這裏就是我的橫幅廣告放在我的XML文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<com.google.android.gms.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="I used my real ad unit id her"
ads:adSize="BANNER"/>
<rest of my layout here/>
</LinearLayout>
這是我的清單文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my package name"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:debuggable="true" android:hardwareAccelerated="true">
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
<activity
android:name="my main activity"
android:label="@string/app_name" android:configChanges="orientation" android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<activity android:name=".SettingsActivity" android:configChanges="orientation" android:theme="@android:style/Theme.Black.NoTitleBar"></activity>
<activity android:name=".HelpActivity" android:theme="@android:style/Theme.Black.NoTitleBar" android:configChanges="orientation"></activity>
<activity android:name=".SetTimeActivity" android:theme="@android:style/Theme.Dialog" android:configChanges="orientation"></activity>
</application>
這是從錯誤日誌中的事件的詳細信息:
com.google.android.gms.ads.AdView failed to instantiate.
java.lang.VerifyError: Expecting a stackmap frame at branch target 77
Exception Details:
Location:
com/google/android/gms/ads/AdView.onLayout(ZIIII)V @9: ifnull
Reason:
Expected stackmap frame at this location.
Bytecode:
0000000: 2a03 b600 153a 0619 06c6 0044 1906 b600
0000010: 0b10 089f 003a 1906 b600 0a36 0719 06b6
0000020: 0009 3608 1504 1c64 1507 6405 6c36 0915
0000030: 051d 6415 0864 056c 360a 1906 1509 150a
0000040: 1509 1507 6015 0a15 0860 b600 0cb1
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:363)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:190)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:373)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:399)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:336)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:332)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderService.createRenderSession(RenderService.java:517)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(GraphicalEditorPart.java:1584)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(GraphicalEditorPart.java:1309)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.changed(GraphicalEditorPart.java:725)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.onTargetChange(GraphicalEditorPart.java:1196)
at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate.onDescriptorsChanged(LayoutEditorDelegate.java:916)
at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate.delegateInitUiRootNode(LayoutEditorDelegate.java:835)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$TargetListener.updateEditor(GraphicalEditorPart.java:953)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$TargetListener.onTargetLoaded(GraphicalEditorPart.java:917)
at com.android.ide.eclipse.adt.AdtPlugin$11.run(AdtPlugin.java:1749)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
我的版本和構建信息:
eclipse.buildId=4.4.0.I20140606-1215
java.version=1.8.0_05
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.standard.product
Command-line arguments: -data C:\Users\"user name"\Desktop\"my" workspace -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.standard.product
編輯:我決定做一個新的Android應用程序項目在一個新的工作區,並添加一個橫幅廣告到這一點,但它也給了我同樣的錯誤如上。
發電子郵件給我你的圖片我會在這裏發佈給你。 [email protected] –
謝謝。我只是想出瞭如何添加我的代碼。對不起,這是我第一次發佈。我沒有意識到你必須縮進4個空格。 – ohrasberries