Android NDK ignores error:undefined reference to ' can't find symbol

Source: Internet
Author: User

Recently in the angel's wing of the MRP simulator ...

Moved to Androidstudio and now want to put the original Android

. Mk the way it's changed to CMake is compiled, but there are some symbols that are not found at compile time.

Undefined reference, these are actually in a file called mr_gc, but there is no such file. So decided to ignore the missing symbols, but the search was android.mk

Finally found in this blog

74509894

By setting this parameter

Android_allow_undefined_symbols

This is set in the Build.gradle,

Attached Build.gradle

Apply plugin: ' Com.android.library '

Android {
Compilesdkversion 27
Buildtoolsversion "27.0.1"

Defaultconfig {
Minsdkversion 17
Targetsdkversion 17

ndk{
Abifilters "Armeabi"

}
Externalnativebuild {
CMake {
Cppflags ""
Arguments "-dandroid_allow_undefined_symbols=true"
}
}
}

Buildtypes {
Release {
Minifyenabled false
Proguardfiles getdefaultproguardfile (' proguard-android.txt '), ' proguard-rules.txt '
}
Debug {
Jnidebuggable true

}
sourcesets {
Main {
Jnilibs.srcdir ' Src/main/libs '
Jni.srcdirs = []
}
}

}



Externalnativebuild {
CMake {
Path "CMakeLists.txt"
}
}
}

dependencies {
Compile ' com.android.support:support-v4:23.+ '
}

Android NDK ignores error:undefined reference to ' can't find symbol

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.