Android Studio Debugging NDK C + + code, problems encountered __c++

Source: Internet
Author: User
Tags build gradle
NDK Debugging Issues:

In the use as debugging NDK code, there are some problems, the Java JNI function red name, also appeared before, on the internet to find a lot of, also asked the Goose field technology, he said there may be as unstable. It's true that I reinstall the AS,JNI function, but I don't know how the JNI function is red again.

Recently went to the problem, summed up the process,


Remove gradle-experimental can Debug Jni function normal
operation Flow project status change change after change State
1 B project 1, ndkbuild
2, jni function Normal (function color is not red, you can follow up Go to C + + code
3, cannot debug.
cannot debug
2 a project 1, ndkbuild
2, Jni function is Often
3, cannot debug.
use gradle-experimental to debug
3 B works 1, Ndkbuild
2, jni function normal
3, cannot debug.
A project uses gradle-experimental JNI functions to show red. (Need invalidate cache and restart)
replace Ndkbuild works with CMake jni function Normal
no use gradle-experimen Tal can also debug
4 a project

Someone on the internet says NDK debugging needs gradle-experimental, but the official document doesn't mention it. I didn't use gradle-experimental later, and I can actually debug it. No gradle-experimental time, is not able to debug, that is to say, use a bit of gradle-experimental, and then can debug without code. (This is not the conclusion, this is a situation I encountered)

Android Studio NDK Debugging (based on Gradle-experimental Plug-ins and LLDB)
Official documents: https://developer.android.com/studio/debug/index.html

A very strange question, which I have tentatively concluded:

1. Debugging does not need gradle-experimental
2. It is best to compile NDK code using CMake.

A friend who knows why. gradle-experimental and gradle version corresponding relationship

In the official document, Experimental Plugin User Guide This correspondence is only updated to Gradle 2.14.1

Later I looked for to go, I think since the document does not, the source code should have this relationship codes. I found out.

Here to see the gradle-experimental version of the past, including the source code. Find the. pom file, which declares that the Gradle-core version of ' Com.android.tools.build ' can be used in accordance with your as version.

Encounter such a thing to share with everyone I was updated in the 2017.5.12 morning as The version is 2.3.2, and when looking for the. pom file, the 0.9.1 gradle-experimental is found, depending on the gradle-core of Com.android.tools.build: Version 2.3.1, looking for 0.10.0-ALPHA1, but rely on Com.android.tools.build gradle-core: version is 2.4.0-alpha1 '. Looking for a long time did not find the version of 2.3.2, so the use of 0.9.1 gradle-experimental, the result of sync project when prompted to update to 0.9.2. This indicates that the version of 0.9.2 is present.

It was so strange that the next day there was a 0.9.2 version

https://bintray.com Site Update Library, may not be very timely, so if you do not find their own, you can first use the CMake and ndkbuild use of some of the process

b when the project uses Ndkbuild, the R10 is used, and this error occurs when using 13.1.3345770. But using CMake, the use of 13.1.3345770 is also normal.

It is not known if the Mk file is improperly configured or ndkbuild incompatible with the 13.1 reason. If a friend knows the reason, you can enlighten me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.