Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to compile project proj.android created by new cocos2d-x v 4.0 in new Android Studio 4.1.1? #20629

Open
Vasiliy229 opened this issue Dec 18, 2020 · 5 comments

Comments

@Vasiliy229
Copy link

Vasiliy229 commented Dec 18, 2020

The cocos2d-x v4.0 installer generated a proj.android folder for me, apparently this is an Android studio project. I open it in Android Studio 4.1.1 - it says "ndk not found". I write the path to ndk:
"sdk.dir = C: \ Users \ user55 \ AppData \ Local \ Android \ Sdk
ndk.dir = C: \ Users \ user55 \ AppData \ Local \ Android \ Sdk \ ndk \ 22.0.7026061"
Next error:
"A problem occurred configuring project ':'. Java.lang.NullPointerException (no error message)"
To compile on the JDK command line in the jni folder, the files are not the same as in the cocos2d-x 4.0 compilation manual
Android Studio 4.1.1
How to build a new cocos2d-x project in apk.
It builds normally under Windows using cmake to create a project VS2019.
NDK installed via SDK manager in Android Studio.

  • cocos2d-x version: 4.0
  • devices test on:
  • developing environments
    • NDK version: NDK (Side by side) 22.0.7026061 (ndk;22.0.7026061)
    • Xcode version: -
    • VS version: 2019
    • browser type and version:

Steps to Reproduce:

  1. Create project by cocos2d-x v 4.0 command line
  2. Open folder "proj.android" as project in Android Studio 4.1.1
@gfredtech
Copy link

gfredtech commented Dec 20, 2020

I'm having the same error as well. Guess I'll have to move to some other platform then.

@gfredtech
Copy link

@Vasiliy229 downgrade your NDK to 21 or less. you may have to specify the exact directory inside local.properties

@Vasiliy229
Copy link
Author

Vasiliy229 commented Dec 21, 2020

I'm having the same error as well. Guess I'll have to move to some other platform then.

i was able to build the project by upgrading the gradle version to the latest one: ! :
in gradle-wrapper.properties:
...
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip
...

in build.gradle:
...
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
...

@danielhlima
Copy link

I'm having the same error as well. Guess I'll have to move to some other platform then.

i was able to build the project by upgrading the gradle version to the latest one: ! :
in gradle-wrapper.properties:
...
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip
...

in build.gradle:
...
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
...

My friend.... you deserve an Oscar!
Thanks a lot for it.....
I was working on this issue for one intire day and part of the night.... tks a lot!

@X3lnThpi
Copy link

X3lnThpi commented Oct 1, 2021

H

I'm having the same error as well. Guess I'll have to move to some other platform then.

i was able to build the project by upgrading the gradle version to the latest one: ! : in gradle-wrapper.properties: ... distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip ...

in build.gradle: ... dependencies { classpath 'com.android.tools.build:gradle:4.1.1' ...

Helped me, got it working with ^^abovse settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants