-
Notifications
You must be signed in to change notification settings - Fork 421
Android Development Environment Configuration in Windows
The required tools for porting android envrionment configuration are shown below:
adt-bundle-windows-x86_64-20130917
Download: http://developer.android.com/sdk/index.html
android-ndk-r9c
Download: http://developer.android.com/tools/sdk/ndk/index.html
jdk-7u45-windows-x64
Download: http://www.oracle.com/technetwork/java/javase/downloads/index.html
The other versions of above listed tools are also vaild, and NDK version should be r8 or higher version. The configuration method is basically same, please select configuration envrionment required toolkit according to operating system type.
Java Environment Installation is necessary for Android envrionment configuration, there are no special demands in installation.
We need to configure environment variables after installation, create a variable naming JAVA_HOME and installation directory with a jdk variable value in Windows system variable, such as: C: \Program Files\Java\jdk1. 7. 0_45.
Then we create another variable naming CLASSPATH with ‘ . ;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools. jar’ as value(note: ‘,;’ at the front must be added), now we need to find Path variable in system variables and click ‘edit’ button to add a semicolon at the front of value, then add ‘%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin’ in front of this semicolon. Now we finished Java envrionment variables configuration, you are able to view the related information after opening DOS and typing java, javac, java - version commands and etc.
Unzip the downloaded adt and ndk to appointed directory, run eclipse of sdk directory in adt. If system requires to update, then click ‘Windows’ button in menu bar and select Android SDK Manager to online update sdk, we suggest you select all updates, the update process will cost you some time, then you just need to wait sdk update finished. (this step is also required in xcode envrionment configuration if system demands)
Firstly import the project to eclipse, File->New->Other->Android Project from Existing Code, then click ‘browse’ button to find proj.android in project directory that we created before.
The solutions for all exceptions and errors after importing eclipse into project and in compiling running process are shown below.
Error |
Solution |
Package error in project src, a prompt box that system cannot find org. CrossApp. lib package |
Copy folders in CrossApp\CrossApp\platform\android\java\src path into project’s proj. android\src directory, note: org. CrossApp. lib package and project package name should be in same level directory, they cannot have inclusion relationship. |
‘Error: Program "bash" is not found in PATH appears when running project |
Right click project ->Properties, click C/ C++Build, and replace the default command with ndk-build.cmd of your own ndk directory in Build command item, for example: D: \android-ndk-r9c\ndk-build. cmd.
|
‘Cannot find module with tag 'CrossApp' in import path’ appears when running project |
Find ‘$(call import-module, CrossApp)’ in android.mk, and then add the below two pieces of code in front of this sentence: $(call import-add-path, D: /CrossApp) $(call import-add-path, D: /CrossApp/CrossApp/platform/third_party/android/prebuilt) and modify the path into your engine’s corresponding path. |
Simulator crash |
For android simulator, only sdk 4.0.3 or hgiher version can support OpenGL ES 2. 0, and even newly built simulator also requires 4. 0. 3 or higher version (we suggest you see the operation effect on a real phone) |
Screen goes blank when running project |
You need to manually copy the required resources from Resources into assets directory. |