IDE Preview error when using latest GoogleMobileSDK 'com.google.android.gms:play-services:5.+'

103 views
Skip to first unread message

Gail Smith

unread,
Sep 9, 2014, 3:51:35 PM9/9/14
to google-adm...@googlegroups.com
When I try to preview an XML layout file containig the latest AdView custom view I get the following error over top of the preview screen:

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(Class.java:2532)
at java.lang.Class.getConstructor0(Class.java:2842)
at java.lang.Class.getConstructor(Class.java:1718)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:310)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:100)
at com.android.tools.idea.rendering.LayoutlibCallback.loadView(LayoutlibCallback.java:172)
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.tools.idea.rendering.RenderService$3.compute(RenderService.java:560)
at com.android.tools.idea.rendering.RenderService$3.compute(RenderService.java:549)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:549)
at com.android.tools.idea.rendering.RenderService.render(RenderService.java:622)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:586)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1900(AndroidLayoutPreviewToolWindowManager.java:80)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$6$1.run(AndroidLayoutPreviewToolWindowManager.java:528)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$6.run(AndroidLayoutPreviewToolWindowManager.java:523)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:327)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
--------------------------------------------------
If I change the version from .5+ to .4+ the error goes away. My development platform consists of :

- Windows 7 pro (with latest updates, et. al)
- Intellij Community Edition 13.03
- building against Android SDK 19.x
--------------------------------------------------------------------
I don't receive any errors while running either my app or the sample apps on a device or using emulators. This error only occurs while writing and attempting to preview XML layout files that contain the custom view, com.google.android.gms.ads.AdView. In addition, this preview error occurs with all of the sample code I have tried as well as my own, in short any XML layout file that contains the custom view, com.google.android.gms.ads.AdView, and includes the latest Google Play Services SDK, com.google.android.gms:play-services:5.+. 

While I can work around the problem during development by using the previous version of  Google Play Services, I will eventually have to build and test against the latest version of Google Play Services and I can only hope that this is simply an XML layout preview issue. It would be nice if it worked during preview just like that previous version does.

Thanks for your help.

Sincerely,

Gail Smith

Amy Quispe (AdMob SDK Team)

unread,
Sep 9, 2014, 7:42:55 PM9/9/14
to google-adm...@googlegroups.com
Hi Gail,

I'm not getting this problem in Android Studio (which I'd expect since you're getting this in IntelliJ). Are you getting this problem in Android Studio? If so, can you send me a sample that reproduces this?

Amy Quispe

Gail Smith

unread,
Sep 10, 2014, 12:07:36 PM9/10/14
to google-adm...@googlegroups.com
Hi Amy,
Thanks for getting back to me so quickly. Unfortunately, I'm getting the same error running Android Studio and using the AdMob sample that is installed with Android Studio (beta, .0.8.6). With Android Studio, though, it doesn't matter what version of Google Play Services I use (unlike my original post about Intellij Community Ed.), I still can't preview any XML file that contains the custom view, com.google.android.gms.ads.AdView but, when I use my AdMod ID and build the project, it runs just find on my devices and emulators. 

Just as an FYI,I tend to stick with Intellij Community edition because I find that Android Studio is too unstable for me. At least I can get most of my work completed with Intellij Community. I find Eclipse is a little better to work with than Android Studio, but, it too, has the same problems with the AdView custom view as Android Studio. Not sure where to go from here. I have included a zipped up version of the AdMob sample that comes with Android Studio in the off chance that there is something wrong with the way I configured the project. Thank you for your help, its always appreciated! 
admob_previewBug_GailSmith.zip

Amy Quispe (AdMob SDK Team)

unread,
Sep 11, 2014, 7:16:55 PM9/11/14
to google-adm...@googlegroups.com
Hi Gail,

I see this problem now!

You're not doing anything wrong, and while it sucks that you can't see the preview in the IDE, it looks like a benign error i.e. your app should still work. I'll file a bug.

Amy Quispe
Reply all
Reply to author
Forward
0 new messages