Skip to content

Commit

Permalink
update changelog and release note (cocos2d#16548)
Browse files Browse the repository at this point in the history
  • Loading branch information
minggo authored Sep 8, 2016
1 parent 1c27c12 commit 02e9430
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cocos2d-x-3.13.1 Sep 13 2016
[FIX] application may crash if coming from background by clicking application icon on Android
[FIX] AudioEngine can not play audio if the audio lies outside APK on Android
[FIX] AudioEngine::stop() will trigger `finish` callback on Android
[FIX] application will crash if using SimpleAudioEngine or new AudioEngine to play audio on Android 2.3.x
[FIX] object.setString() has not effect if passing a number on JSB

cocos2d-x-3.13 Aug 22 2016
Expand Down
26 changes: 25 additions & 1 deletion docs/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Misc Information](#misc-information)
- [v3.13.1](#v3131)
- [Bug fixed](#bug-fixed)
- [Cocos command modification](#cocos-command-modification)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand All @@ -22,8 +23,31 @@
* Label color broken
* application will crash in debug mode if don't specify a design resolution
* may crash if coming from background by clicking application icon on Android
* object.setString() has not effect if passing a number on JSB
* AudioEngine can not play audio if the audio lies outside APK on Android
* AudioEngine::stop() will trigger `finish` callback on Android
* application will crash if using SimpleAudioEngine or new AudioEngine to play audio on Android 2.3.x
* object.setString() has not effect if passing a number on JSB

## Cocos command modification

In previous, cocos command will find an Android API level >= specified Android API level to build source codes on Android. For example, if the content of `APP_ROOT/proj.android/project.properties` is

```
target=android-13 // the default android api level
android.library.reference.1=../../../cocos/platform/android/java
```
then cocos command will find `android-13` in `ANDROID_SDK_ROOT/platforms`, if not found then it will find `android-14`, if `android-14` is not found, then it will find `android-15` and so on until it found one.

This algorithm has a problem that if you only download Android 21, then application will be built with Android 21 though the default API level is 13. If the application runs on a device with lower Android OS(such as Android 4.0), then the application may crash. Building with high API level Android SDK can not make sure run on devices with low Android OS. It is reasonable, an applicatoin build with iOS 9 can not make sure run on iOS 8.

Since v3.13.1, cocos command will stop if it can not find specific API level(default is android-13). If you want to build with high level Android SDK, you should explicitely specify it like this:

```
cocos compile -p android --ap android-19
```

Keep in mind that, after running this command, content of `APP_ROOT/proj.android/project.properties` will be changed, `android-19` will be the default API level.

There is a map between Android API level and Android OS version, can refer to [this documentation](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html) for detail information.

Can refer to [here](https://github.com/cocos2d/cocos2d-x/milestone/33) for detail information about these issues.
28 changes: 28 additions & 0 deletions docs/RELEASE_NOTES_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- [v3.13.1](#v3131)
- [Bug修复](#bug%E4%BF%AE%E5%A4%8D)
- [Cocos命令的改动](#cocos%E5%91%BD%E4%BB%A4%E7%9A%84%E6%94%B9%E5%8A%A8)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand All @@ -16,6 +17,33 @@
* 在Android系统,如果通过点击应用图标从后台推前台,可能导致崩溃
* 在Android系统,如果音乐或音效资源不在APK包里,会导致无法播放
* 在Android系统,AudioEngine::stop()会回调`finish`回调函数
* 使用`SimpleAudioEngine`或者`AudioEngine`播放音效或者背景音乐,在Android 2.3.x会崩溃
* JSB中,如果传入object.setString()的参数类型是数字,没有任何效果

对应的github issue可以从[这里](https://github.com/cocos2d/cocos2d-x/milestone/33)找到。

## Cocos命令的改动

之前的版本,在Android平台下,cocos命令编译代码时会找大于等于指定的API级别的Android SDK,比如`APP_ROOT/proj.android/project.properties`的内容是这样的

```
target=android-13 // Android API级别
android.library.reference.1=../../../cocos/platform/android/java
```
那么cocos命令会在`ANDROID_SDK_ROOT/platforms`目录下找`android-13`,如果找不到就会找`android-14`,如果找不到的话会找`android-15`直到找到一个合适的级别。

该算法有个问题,假设你只下载了`android-21`,虽然`APP_ROOT/proj.android/project.properties`指定是要使用`android-13`,最终也会使用`android-21`编译。编译出来的程序如果跑在Android 4.0的设备,那么就可能会崩溃。使用高版本Android SDK编译的程序不能保证能在低版本的Andoid系统上运行,就好比用iOS 9编译的程序不能保证运行在iOS 8一样。

从3.13.1开始,cocos命令如果找不到指定的API级别会立即停止。想用指定的API级别编译的话需要使用命令行参数指定:

```
cocos compile -p android --ap android-19
```
注意的事,一旦该命令运行后,那么`APP_ROOT/proj.android/project.properties`的内容就会改动,变成

```
target=android-19 // Android API级别
android.library.reference.1=../../../cocos/platform/android/java
```

Android API级别和Android系统版本间存在对应的映射关系,可以参看[该文档](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html)获取详细的内容。

0 comments on commit 02e9430

Please sign in to comment.