cocos2d-x 3.6 how to build release for google play?

Error message @ google play:
“You uploaded a debuggable APK file. For security, you must disable debugging before you publish it in Google Play. Learn more about troubleshooting only APK files.
You uploaded an APK file that had been signed in debug mode. You must sign the APK file in launch mode. Learn more about signing.”

Build code:
“python I:/jobbet/cocos2d-x-3.6/cocos2d-x-3.6/Matematikspelet/proj.android/build_native.py -b release all”

Application.mk:
APP_STL := gnustl_static

APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char
APP_LDFLAGS := -latomic

APP_CPPFLAGS += -DCOCOS2D_DEBUG=0
APP_CPPFLAGS += -DNDEBUG
APP_OPTIM := release

So why does it say my app is debuggable!?
I have successfully zipaligned the APK, but google play still won’t accept it.

Try to build with cocos command line like this:
cocos compile -p android -m release
Then it will ask you for the path of .keystore file. You can use Android Studio to export this file. Then input full path into the console.

1 Like

I:\jobbet\cocos2d-x-3.6\cocos2d-x-3.6\Matematikspelet>cocos compile -p android -
m release
Traceback (most recent call last):
File “I:\jobbet\cocos2d-x-3.6\cocos2d-x-3.6\Matematikspelet/cocos.py”, line 7
14, in
plugins = parser.parse_plugins()
File “I:\jobbet\cocos2d-x-3.6\cocos2d-x-3.6\Matematikspelet/cocos.py”, line 4
9, in parse_plugins
plugin_class = get_class(classname)
File “I:\jobbet\cocos2d-x-3.6\cocos2d-x-3.6\Matematikspelet/cocos.py”, line 4
30, in get_class
m = import(module)
ImportError: No module named project_new

is there no way to build release via eclipse?

In AndroidManifest.xml, add the last argument:

<application android:label="@string/app_name"
	android:icon="@drawable/icon" android:debuggable="false">

I have tried all this…
When I use cocos console to build, it says I’m building debug even tho I specified release, why is this!?

Here’s what it says when I run cocos command:
“I:\jobbet\cocos2d-x-3.6\cocos2d-x-3.6\Matematikspelet\proj.android>cocos run -p
android --ndk-mode release
Running command: compile
Building mode: debug
Android platform not specified, searching a default one…”

I’m trying this now, looks like that is working well:
cocos compile -p android -m release --ndk-mode release

Worked very well!!!
At the end asked me about the keystore, like our friend (NhatNam) told before.