CocosCreator构建安卓项目报错
Build file '/Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/platform/android/libcocos2dx/build.gradle' line: 9
A problem occurred evaluating project ':libcocos2dx'.
> Could not get unknown property 'PROP_TARGET_SDK_VERSION' for DefaultConfig_Decorated{name=main, dimension=null, minSdkVersion=DefaultApiVersion{mApiLevel=10, mCodename='null'}, targetSdkVersion=null, renderscriptTargetApi=null, renderscriptSupportModeEnabled=null, renderscriptSupportModeBlasEnabled=null, renderscriptNdkModeEnabled=null, versionCode=null, versionName=null, applicationId=null, testApplicationId=null, testInstrumentationRunner=null, testInstrumentationRunnerArguments={}, testHandleProfiling=null, testFunctionalTest=null, signingConfig=SigningConfig_Decorated{name=debug, storeFile=/Users/nick/.android/debug.keystore, storePassword=android, keyAlias=AndroidDebugKey, keyPassword=android, storeType=jks, v1SigningEnabled=true, v2SigningEnabled=true, v1SigningConfigured=false, v2SigningConfigured=false}, resConfig=[], buildConfigFields={}, resValues={}, proguardFiles=[], consumerProguardFiles=[], manifestPlaceholders={}, wearAppUnbundled=null} of type com.android.build.gradle.internal.dsl.DefaultConfig.
解决方案:
1.打开/Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/platform/android/libcocos2dx/build.gradle
2.将里面的targetSdkVersion的值PROP_TARGET_SDK_VERSION替换为安卓工程中build.gradle(Project)下ext中targetSdkVersion的值