1, ask questions
I've had this problem: after I've ported the COCOS2DX program to my Android project, I want to make a tune through an Android virtual machine, but after running the virtual machine, the following error occurs:
Unfortunately, MyTest has stopped.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/48/75/wKiom1QIeAKDlr9JAAC68d7E3N0214.jpg "title=" Picture 1_ copy. png "alt=" wkiom1qieakdlr9jaac68d7e3n0214.jpg "/>
This is because the COCOS2DX requires OpenGL for rendering, and the Android virtual machine does not have this thing, so the hardware-enabled renderer needs to be rendered, that is, the GPU.
In the older version of the Android SDK, using the AVD to create a virtual machine, there is a tick "use Host GPU" option.
That is, rendering using the host's GPU.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/48/77/wKioL1QIeBOyX-KSAAH-L03BOoc522.jpg "title=" 1_ copy. jpg "alt=" wkiol1qieboyx-ksaah-l03booc522.jpg "/>
But android SDK version above, using AVD to create an Android virtual machine is this:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/48/77/wKioL1QIeIbBJJcgAALnnkpGDO4359.jpg "title=" Picture 2.png "alt=" Wkiol1qieibbjjcgaalnnkpgdo4359.jpg "/>
You can see that the"use Host GPU" option is gone.
What about that? Can't you use the Android virtual machine to debug the COCOS2DX program? 650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f09.gif "alt=" I_f09.gif "/>
2. Solution
Of course there is a way, please believe that bloggers, bloggers will tell you how to reproduce the "User Host GPU." 650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f30.gif "alt=" I_f30.gif "/>
Please be patient and look down:
(1) First, use the AVD to create an Android virtual machine normally. Of course, this time there is no GPU rendering turned on.
(2) After creating the virtual machine, enter " C:\Users\Administrator\.android\avd\avd.avd " (each person's path may be different, but in c:\user\***\.android\ ).
Locate the config.ini file under the AVD.AVD path and open it with Notepad!
Note: The "AVD" is the name of the virtual machine I created, so be careful not to say you can't find the AvD folder.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/48/76/wKiom1QIel-RRtigAAGZo5NbPGY865.jpg "title=" Picture 3.png "alt=" Wkiom1qiel-rrtigaagzo5nbpgy865.jpg "/>
(3) Add a line of code to turn on GPU rendering " hw.gpu.enabled=yes ".
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/48/78/wKioL1QIe0GDb7vXAAFZ-kJv4Pg084.jpg "title=" Picture 4.png "alt=" Wkiol1qie0gdb7vxaafz-kjv4pg084.jpg "/>
OK, as long as three steps, you can turn on GPU rendering, is not very simple AH. 650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f32.gif "alt=" I_f32.gif "/>
3. Other
There are two more parameters to note, which may be used to:
(1)keyboard lid Support: Simulator physical keyboard, set to Yes, indicating that the simulator physical keyboard is available;
(2)keyboard support: Computer keyboard, set to Yes, computer keyboard available.
This article is from the "Summer Wind" blog, please be sure to keep this source http://shahdza.blog.51cto.com/2410787/1548946
COCOS2DX Small knowledge--android virtual machine debugging problem