How does cocos2d-x compile command set SDKVersion for Android Studio project?

How does cocos2d-x compile command set SDKVersion for Android Studio project?
0.0 0

#1

So I want to compile my cocos2d-x project for Android Studio using cmd with:

cocos compile -p android --android-studio --ap android-22

I found the description about --ap option in the wiki : Specify the API-Level of android sdk. Console will auto select it if not specified. .

My question is that:
1/ Is this API compiledSDKVersion or minSDKVersion or targetSDKVersion? And how do I set those SDKVersion in above command?
2/If I want to change those SDKVersion , could I just edit build.Gradle(Module:MyApp) and build.Gradle(Module:libcocos2dx) then Sync Gradle or I have to recompile using the cmd with above command?
Your attention and help is very much appreciated.


#2

You should edit gradle file for compiledSDKVersion or minSDKVersion or targetSDKVersion

--ap flag specifies the android SDK that your project is compiled with
build.Gradle file specifies the SDK version your app is compatible with

So you could have lower version in build.Gradle since the newer version of SDK is backwards compatible.