Android Studio native library build - NDK clang permission problem on Mac - android-ndk

Trying to build a native C library in Android Studio 4.0 on a Mac. But getting this pop-up when I do:
"clang" cannot be opened because the developer cannot be verified. macOS cannot verify that this app is free from malware.
Of note: I downloaded NDK r21 and point to it in Android Studio. Also, in the Android SDK setup, I have NDK (side-by-side) installed. I have to admit I am not clear what NDK is pointed to when one checks NDK (side-by-side)? That is why I downloaded NDK r21 and pointed to it in Android Studio. But now, this NDK clang permission problem...
thanks for any advice.
Best,
Steve

OK - I went to, in Android Studio, File -> Project Structure, and removed the PATH I had for the Android NDK Location box. And kept the NDK (side-by-side) box checked in the SDK Manager, SDK Tools tab section. Now not seeing the clang issue.

Related

Android Studio C++ Support Missing

I just installed Android Studio 3.6.3 on Windows 10 and I created a new Native C++ project. I can build and run the native project and I can debug Java code in the project.
The problems I'm having are:
I can't step into the C++ code when debugging
I can't set breakpoints in *.cpp files.
When I right click folders in the project view to add a new file, I only see options to add Java, Kotlin, and Android platform files. There aren't any options to add C++ source or header files.
When I open a C++ file Android Studio recommends installing plugins supporting *.cpp. The plugin it's recommending is for Arma 3 plugin development.
The "Attach Debugger To Process" menu only has Java as a debugger option. That list should also contain Native, Dual, and Auto.
I've made sure to install CMake and NDK (Side By Side) in the SDK Manager and I've configured the NDK in the project settings. I've tried reinstalling Android Studio 3.6.3 and I've also downloaded Android Studio 4.0 RC 1, but I have the same problems.
What steps am I missing to get C++ support in Android Studio?
Managed to get it working. Turns out just running the uninstaller wasn't enough, I had to follow the steps in this answer to completely uninstall Android Studio. I then reinstalled and everything seems to be good.

In my Android Studio SDK Manager Tools there is no NDK, LLDB, CMake

I follow this Install and configure NDK document:
In this step,
I found in my Android Studio there is no NDK, LLDB, CMake and so on:
EDIT-01
I found many disable sites in my SDK Updates Sites:
The Android update site is either disabled or has an error (not sure exactly what that icon means; if you mouse over it there might be a tooltip). You need to fix that. You can't download things from the repository if all of your repositories are disabled.

How to configure NDK for Android Studio

I've installed Android Studio 2.2.3 and created a "myApplication" with include C++ support.
I get this error:
Error:NDK not configured.
Download it with SDK manager.)
Is there any good way to solve it please?
Once you have downloaded the NDK, go to "File" menu, than "Project Structure->SDK Location" and set the Android NDK Location (it is at the bottom of the window).

Open cocos2d-x-3.7 in Android Studio

What is the proper way to open cocos2d-x-3.7 in Android Studio?
I tried:
Open existing project in Android Studio project > Choose proj.android-studio directory (In another attempt, I also tried to choose the base directory MyGame)
Run
Error: couldn't find "libcocos2dcpp.so.
Moreover, it also does Classes directory in the Project.
Android Studio is only partially supported in cocos2d-x 3.7 and 3.8. With the default project you will only be able to run your app without debugging using Android Studio.
Prior to running your app in Android Studio you will have to compile using the Android Studio flag:
cocos compile -p android --android-studio
You will have to run this command after any changes to your app are made, since the default Android Studio currently doesn't compile your project.
Furthermore the default Android Studio project does not include the Classes directory.
Suggestion: Use Eclipse or Xcode to develop your cocos2d-x projects for now. Hopefully future versions of cocos2d-x will have better support for Android Studio out of the box, this is critical considering Google is dropping support for Eclipse.
When you try to run the application on Android Studio, you get the error couldn't find "libcocos2dcpp.so" because it doesn't have the NDK for building your game.
I recommend you to compile proj.android and import that, cocos2d-x 3.7 doesn't support full Android Studio yet. Do this:
cocos compile -p android
Then import your proj.android to Android Studio.
Now you can run your application but you won't able to debug it, bad news (it will just install the APK on your device or virtual device).
Hope it helps.
Error: couldn't find "libcocos2dcpp.so.
For this you need to compile android studio project first so .so files and classes folder will be generated.
Open your command line and enter the following command to compile your android studio project:
cocos compile -p android --android-studio --ap android-24 --app-abi x86
This will create required files in your proj.android-studio directory.
Now import this project into Android Studio and try to run it.

Cannot remove NDK support from Android project

I am unable to remove NDK support from my Android project. I have gone through all the workspace and project settings, including CDT builder, C/C++ build paths, etc. I have cleaned my workspace and relaunched Eclipse. However, my project will not build as Eclipse complains about this error:
Program "/home/eazyigz/adt-bundle-linux-x86/android-ndk-r8c/ndk-build" not found in PATH
I really don't know what to do, as I don't even have ndk-r8c downloaded, and it's an outdated version of ndk anyway! I am on Ubuntu Linux.
Anybody knows?
Well, I reinstalled Eclipse. Then I deleted my project and re-imported it into the workspace. Now I don't get that error anymore. Problem solved.
If you have a C/C++ aspect to your code which references the Android NDK plugin for Eclipse, you need to have the NDK location set in the NDK plugin preferences:

Resources