Status Update
Comments
uc...@google.com <uc...@google.com>
ac...@google.com <ac...@google.com> #2
Hi, was this a regression after you upgrade your NDK or upgrade your Android Studio?
sa...@google.com <sa...@google.com> #3
Neither of them. There were no change to AS (4.1-RC1) nor NDK versions.
I just changed my old scripts in build.gradle to the android recommended method i.e.
externalNativeBuild { ndkBuild { path file('jni/Android.mk') } }
If I reverted the change to my old script, everything is working again. The old scripts uses
ndk.dir=/opt/android/android-sdk/ndk-bundle
as defined in local.properties file
The source.properties files indicate the version as:
Pkg.Desc = Android NDK Pkg.Revision = 21.3.6528147
fa...@whoop.com <fa...@whoop.com> #4
Hi, the problem is that when Android Gradle Plugin executes ndk-build, it is missing the '-C' + projectDir + '/jni'
part in your custom task. Therefore, the current working directory is the module root (parent of the jni
directory). Hence the error.
The fix is to add the following to your build.gradle
android {
...
defaultConfig {
...
externalNativeBuild {
ndkBuild {
arguments "-Cjni"
}
}
}
}
Please reopen the bug if you have further issues. Thanks!
ac...@google.com <ac...@google.com> #5
Please provide the full syntax for the externalNativeBuild scripts. gradle sync throws the following error message when I added the recommended argument statement to the script (or change to arguments('-Cjni'))
A problem occurred evaluating project ':aTalk'.
No signature of method: build_6xrerbyg3j4aatiomvrbavr6i.android() is applicable for argument types: (build_6xrerbyg3j4aatiomvrbavr6i$_run_closure4) values: [build_6xrerbyg3j4aatiomvrbavr6i$_run_closure4@497bb461]
externalNativeBuild {
ndkBuild {
path file('jni/Android.mk')
arguments "-Cjni"
}
}
fa...@whoop.com <fa...@whoop.com> #6
There are actually two different types of exteranlNativeBuild
blocks. The block in #4 needs to be put inside defaultConfig
android {
...
defaultConfig {
...
externalNativeBuild {
ndkBuild {
arguments "-Cjni"
}
}
}
...
externalNativeBuild {
ndkBuild {
path file('jni/Android.mk')
}
}
}
we...@gmail.com <we...@gmail.com> #7
But seeing the following errors not found in old method.
a. user now has to define what ABI to build for the adb debug; previously no such option and it is auto selected.
b. During run, it opens up a file (org_atalk_impl_neomedia_device_OpenSLESSystem.c) and indicates:
This file is not part of the project. Please include it in the appropriate build file (build.gradle, CMakeLists.txt or Android.mk etc.) and sync the project.
and the whole debug aborted with signel= SIGABRT (signal SIGABRT). and Note10 went black.
but the file already specified in the included file jni/opensles/Android.mk
# ========== OpenSLES (jnopensles.so library) ==================
### OpenSLES shared library build
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -lOpenSLES -llog
LOCAL_MODULE := jnopensles
LOCAL_SRC_FILES := \
org_atalk_impl_neomedia_device_OpenSLESSystem.c \
org_atalk_impl_neomedia_jmfext_media_protocol_opensles_DataSource.c \
org_atalk_impl_neomedia_jmfext_media_renderer_audio_OpenSLESRenderer.c
include $(BUILD_SHARED_LIBRARY)
However I realized that the new method perform the ndkBuild for every aTalk build variant (x4).
How do I make ndkBuild build only once for all the variants?
Moving the jni subDirectory into the ./src/main/jni does not seem to resolve the 4x build problem; but created other problems e.g.
a. Still proceed to build 4 times for the aTalk Build Variants.
b. Fail to perform adb install with the following error message (actual apk did contain the required ABI lib):
08/15 10:33:41: Launching 'aTalk' on samsung SM-N975F.
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_NO_MATCHING_ABIS
List of apks:
[0] '/home/cmeng/workspace/android/atalk-android/aTalk/build/outputs/apk/playstore/debug/aTalk-playstore-debug.apk'
Installation failed due to: 'null'
Retry
ac...@google.com <ac...@google.com> #8
Hi, you can filter ABIs with
Can you share the project with your changes on build.gradle?
Description
Build: AI-201.8743.12.41.6953283, 202011050241,
AI-201.8743.12.41.6953283, JRE 1.8.0_242-release-1644-b3-6915495x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.16, screens 2560x1440, 1680x1050
AS: 4.1.1; Kotlin plugin: 1.4.10-release-Studio4.1-1; Android Gradle Plugin: 4.1.1; Gradle: 6.3; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
IMPORTANT: Please read