The first contact with Cocos2d-x, ready to build a Hello World Android environment, the problem encountered a lot. In this record, for yourself, also for everyone, avoid re-detours!
The specific environment can be set up by reference to the official documentation. Build the Cocos2d-x Android development environment on the WINDOWS7 platform .
1.Android-ndk-r10 cannot be placed under a path with a space.
2. Enter the Proj.android directory under the project directory, execute build_native.py, compile error:
jni/. /.. /cocos2d/cocos/./3d/ccbundlereader.cpp:94:23:error:return type of out-of-line definition of ' Cocos2d::bundlereader:: Tell ' differs from the the Declaration
Solution : Enter the project directory \cocos2d\cocos\3d, under open CCBundleReader.cpp, change:ssize_t Bundlereader::tell () is a long int bundlereader::tell ()
When using the Eclipse debugger or creating an AVD, first update the necessary libraries and files to download. Open "Android SDK Manager" via the menu Window-->android SDK Manager and download the Update SDK.
3. Cannot display libraries that need to be updated
fix : Open android SDK via menu item tools-->options MANAGER-SETTINGSS tick "force https://...sources to be fetched using HTTP ://..."
4. If you want to run an Android program, we need to create an AVD and open the Android virtual device (AVD) Manager via the menu item window-->android virtual Device Manager. Click the Create button to open the Create new Android Virtual Device (AVD). The AVD Name,device,target is selected, but when Cpu/abi is selected, the "No system images installedfor this Target" is displayed.
Because we need to download some sytem images, or through the "Android SDK Manager" download.
ARM EABI v7a System Image,
Intel x86 Atom System Image,
Mips System Image
The above three packages are required to install the emulator, before the installation can create Android 4 or more versions of the simulator
5. Install the update package, if "Unknown Host dl-ssl.google.com" appears, because this address cannot be resolved, you can enter C:\Windows\System32\Drivers\etc, Open the Hosts file, add
#google_android更新
203.208.46.146 www.google.com
203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com
6. If the download is still not available, or the download is slow, "Download interrupted:connection to Http://dl-ssl.google.com refused". We can directly download through the link with Thunderbolt and so on, here are the packages: the complete _windows of the Android Sdk_ Resource Pack.
Place the downloaded package in the Temp folder of the SDK you installed, and then start the Android SDK Manager to install them. Sometimes even if you put an installation package file in the Temp folder, you also need to download the package, because we also want to download this version of the SDK Platform, if you do not install this version of the SDK Platform, please download this package to the temp file, avoid using the " Android SDK Manager "slow download problem. If these packages are successfully installed, we can create the AVD and start running the Android program!
7.run started running Android program, the following error occurred:
"Cocos2dxactivity cannot is resolved to a type Appactivity.java",
" The import Org.cocos2dx.lib cannot be Resolvedappactivity.java "
solution : Enter Cocos2d-x installation under the \cocos\platform\android\java\src\org\cocos2dx, copy the Lib folder to the project directory \proj.android\src\org\cocos2dx\.
8. If we delete the C:\Users\username\workspace directory and import the Android project again, run will appear "theselection cannot be Lanched,and There is no recent launches."
resolution : Select menu item: Run-->run configurations ..., open "Run configurations", select "Android application" option, click "New Launch Configuration button to create a new "run Confirguration".
9.run runtime, "extension wgl_arb_make_current_readis not found" and "extension Wgl_ext_swap_control is not Found"Simulator cannot appear HelloWorld program interface. This problem is running on their own virtual machine appears, looked for a long time did not solve the problem, I hope we solve together! The environment for the virtual machine is Windows 8.1, and your system environment is Windows 8.
The above is now all the problems encountered at the beginning of everything difficult!