错误:在Android Studio 2.1.3中使用'-gpu off'禁用它

时间:2016-08-17 08:21:20

标签: android avd android-studio-2.2

我在Windows 7上Android Studio 2.1.3。运行Hello world应用程序时,我在输出控制台上发现了此错误:

  

模拟器:错误:无法初始化OpenglES仿真,请使用'-gpu off'禁用它。

这时弹出。  Error picture is here.我错过了什么吗?

1 个答案:

答案 0 :(得分:2)

转到

  

Android Studio - >工具 - > Android - > AVD经理

现在单击模拟器的铅笔图标,取消选中- (void)placeItem:(UIView *)container :(UILabel *)word_l { CGPoint initPoint = word_l.center; for (int i = 1; i <= 8; i++) { switch (i) { case 1: word_l.center = CGPointMake(word_l.center.x + viewPositionMovingStep, word_l.center.y); break; case 2: word_l.center = CGPointMake(word_l.center.x + viewPositionMovingStep, word_l.center.y + viewPositionMovingStep); break; case 3: word_l.center = CGPointMake(word_l.center.x, word_l.center.y + viewPositionMovingStep); break; case 4: word_l.center = CGPointMake(word_l.center.x - viewPositionMovingStep, word_l.center.y + viewPositionMovingStep); break; case 5: word_l.center = CGPointMake(word_l.center.x - viewPositionMovingStep, word_l.center.y); break; case 6: word_l.center = CGPointMake(word_l.center.x - viewPositionMovingStep, - viewPositionMovingStep); break; case 7: word_l.center = CGPointMake(word_l.center.x, word_l.center.y - viewPositionMovingStep); break; case 8: word_l.center = CGPointMake(word_l.center.x + viewPositionMovingStep, word_l.center.y - viewPositionMovingStep); break; default: break; } if ([self viewIntersectsWithAnotherView:container chosenView:word_l]) { word_l.center = initPoint; } else { viewPositionMovingStep = 0; return; } } } 选项。

enter image description here

更新:对于较新的 Android Studio 3.0 ,Google已删除此选项并改为使用此选项。

enter image description here

并且解释也就在那里。

enter image description here

因此,如果您不确定要选择哪一个,最好将其设置为- (BOOL)view:(UIView *)view1 intersectsWith:(UIView *)view2 { CGPoint poly1[4]; CGRect bounds1 = view1.bounds; poly1[0] = [view1 convertPoint:bounds1.origin toView:nil]; poly1[1] = [view1 convertPoint:CGPointMake(bounds1.origin.x + bounds1.size.width, bounds1.origin.y) toView:nil]; poly1[2] = [view1 convertPoint:CGPointMake(bounds1.origin.x + bounds1.size.width, bounds1.origin.y + bounds1.size.height) toView:nil]; poly1[3] = [view1 convertPoint:CGPointMake(bounds1.origin.x, bounds1.origin.y + bounds1.size.height) toView:nil]; CGPoint poly2[4]; CGRect bounds2 = view2.bounds; poly2[0] = [view2 convertPoint:bounds2.origin toView:nil]; poly2[1] = [view2 convertPoint:CGPointMake(bounds2.origin.x + bounds2.size.width, bounds2.origin.y) toView:nil]; poly2[2] = [view2 convertPoint:CGPointMake(bounds2.origin.x + bounds2.size.width, bounds2.origin.y + bounds2.size.height) toView:nil]; poly2[3] = [view2 convertPoint:CGPointMake(bounds2.origin.x, bounds2.origin.y + bounds2.size.height) toView:nil]; CGPoint ctl2 = [view1 convertPoint:poly2[0] fromView:nil]; if (CGRectContainsPoint(view1.bounds, ctl2)){ return YES; } CGPoint ctr2 = [view1 convertPoint:poly2[1] fromView:nil]; if (CGRectContainsPoint(view1.bounds, ctr2)){ return YES; } CGPoint cbr2 = [view1 convertPoint:poly2[2] fromView:nil]; if (CGRectContainsPoint(view1.bounds, cbr2)){ return YES; } CGPoint cbl2 = [view1 convertPoint:poly2[3] fromView:nil]; if (CGRectContainsPoint(view1.bounds, cbl2)){ return YES; } CGPoint ctl1 = [view2 convertPoint:poly1[0] fromView:nil]; if (CGRectContainsPoint(view2.bounds, ctl1)){ return YES; } CGPoint ctr1 = [view2 convertPoint:poly1[1] fromView:nil]; if (CGRectContainsPoint(view2.bounds, ctr1)){ return YES; } CGPoint cbr1 = [view2 convertPoint:poly1[2] fromView:nil]; if (CGRectContainsPoint(view2.bounds, cbr1)){ return YES; } CGPoint cbl1 = [view2 convertPoint:poly1[3] fromView:nil]; if (CGRectContainsPoint(view2.bounds, cbl1)){ return YES; } return NO; }