2014-08-28 5 views
9

Un projet d'application fonctionnant parfaitement a commencé à générer cette erreur dans Android Studio. J'ai essayé différentes choses comme changer la structure du fichier Main.xml, changer la version de Google Play Services, etc. mais rien n'a aidé. Cette erreur apparaît dans l'onglet d'affichage et j'ai essayé d'utiliser l'API 18 pour la visualisation. En outre, pour une raison quelconque, le taux de remplissage des annonces interstitielles est passé à 0 et NO_FILL est renvoyé.java.lang.VerifyError: Attendre une image empilée à la cible de la branche 57

The following classes could not be instantiated: 
- com.google.android.gms.ads.AdView (Open Class, Show Exception) 
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE 

java.lang.VerifyError: Expecting a stackmap frame at branch target 57 
Exception Details: 
    Location: 
    com/google/android/gms/ads/AdView.onMeasure(II)V @20: ifnull 
    Reason: 
    Expected stackmap frame at this location. 
    Bytecode: 
    0000000: 033e 0336 042a 03b6 0015 3a05 2ab6 0014 
    0000010: 3a06 1905 c600 2519 05b6 000b 1008 9f00 
    0000020: 1b2a 1905 1b1c b600 1919 05b6 000a 3e19 
    0000030: 05b6 0009 3604 a700 1f19 06c6 001a 2ab6 
    0000040: 0016 3a07 1906 1907 b600 133e 1906 1907 
    0000050: b600 1236 041d 2ab6 0018 b800 2a3e 1504 
    0000060: 2ab6 0017 b800 2a36 042a 1d1b b800 0d15 
    0000070: 041c b800 0db6 001a b1     

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:309) 
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:99) 
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:132) 
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802) 
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:778) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:500) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:381) 
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:400) 
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:329) 
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:332) 
at com.android.tools.idea.rendering.RenderService$3.compute(RenderService.java:575) 
at com.android.tools.idea.rendering.RenderService$3.compute(RenderService.java:564) 
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932) 
at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:564) 
at com.android.tools.idea.rendering.RenderService.render(RenderService.java:691) 
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:604) 
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1900(AndroidLayoutPreviewToolWindowManager.java:80) 
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:546) 
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$7.run(AndroidLayoutPreviewToolWindowManager.java:541) 
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) 

build.gradle

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.google.android.gms:play-services:5.0.89' 
    compile 'com.android.support:appcompat-v7:20.+' 
    compile 'com.crashlytics.android:crashlytics:1.+' 
} 

Répondre

1

Puisque je ne peux pas marquer cette question, je poste la réponse de l'autre thread.

I had the same problem when trying to preview the custom view AdView. My 
project is built using gradle via Intellij community edition (13.x) and 
I ended up changing the version of google play services from 

compile 'com.google.android.gms:play-services:5.+' 

to 

compile 'com.google.android.gms:play-services:4.+' 

specifically, I changed the dependencies section of my gradle file to look 
like this: 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.google.android.gms:play-services:4.+' 
} 
+1

Je l'ai essayé mais ça ne m'aide pas. –

1

Avec 5 JDK il y avait un nouveau type contrôle introduit (voir JVM options, UseSplitVerifier), mais a été désactivée par défaut. Comme vous définissez

targetCompatibility JavaVersion.VERSION_1_7 

le bytecode vous construisez utilisera cette fonction (voir: JVMS 4.10.1. Verification by Type Checking et 4.7.4. The StackMapTable Attribute). Pour désactiver cette fonction, vous pouvez passer l'option -XX:-UseSplitVerifier au java c .

+0

J'utilise déjà CompileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } dans le build.gradle de l'application dès le départ et il n'a pas aidé. https://gist.github.com/donniezazen/ead9fd8a2505eda11884 –

+0

Si vous n'utilisez pas de fonctionnalités JDK 7 spécifiques, essayez d'utiliser VERSION_1_5. – SubOptimal

+0

Gail a posté la bonne réponse [http://stackoverflow.com/a/25748196/3034693] il y a 3 jours. Et je ne peux pas supprimer la compatibilité 1.7 car j'utilise String dans une instruction switch. –

2

J'ai eu le même problème. et cherché beaucoup mais aucune réponse ne m'aide.

Je pense que cela pourrait être bug dans google play service

Puis-je obtenir une nouvelle API de mon ordinateur d'amis (dans son ordinateur son api fonctionne parfaitement si je viens de remplacer cela et il travaillait.) here is my friends api

essayez cette api cela pourrait vous aider.

+0

Merci, Cette api m'aide aussi. Ça fonctionne pour moi. –

+0

Bien que ce n'est pas une réponse à ce que je veux, mais ce n'est que la réponse qui résout mon problème. alors vous obtenez +50 M. Crazy Proggrammer. –

+1

Man vous êtes génial !! Je vous remercie!! :) – nithinreddy

Questions connexes