안녕하세요.
Galaxy Nexus 단말에서 NDK so 파일이 실제 system에 설정된 값과 다른 so 파일이 로딩이 됩니다.
원인을 알수가 없어서 질문 올립니다.
테스트 샘플은 NDK에 포함된 HelloNeon으로 테스트 하였습니다.
샘플코드는 첨부파일로 추가 하였습니다.
샘플코드를 동작 시킨뒤의 로그입니다.
java code에서 Build.CPU-ABI를 찍으면 armeabi-v7a로 설정이 된게 나옵니다.
그러나 실제 so파일이 로드 되어 호출이 된 것을 보면 armeabi 분기로 api 호출이 됩니다.
이건 so 파일 로드 시에 armeabi-v7a가 아닌 armeabi 폴더내의 so 파일이 로딩이 된것입니다.
이 현상이 오직 Galaxy Nexus 단말에서만 발생을 하고 있네요.
혹시 이 현상의 원인을 아시는분 계신가요?
205 02-10 16:40:59.173 D 25790 AndroidRuntime Shutting down VM
206 02-10 16:40:59.197 I 25790 AndroidRuntime NOTE: attach of thread Binder Thread #3 failed
207 02-10 16:40:59.197 D 25801 dalvikvm Late-enabling CheckJNI
208 02-10 16:40:59.197 D 25790 dalvikvm GC_CONCURRENT freed 102K, 89% free 484K/4096K, paused 0ms+0ms
209 02-10 16:40:59.197 D 25790 jdwp Got wake-up signal, bailing out of select
210 02-10 16:40:59.197 D 25790 dalvikvm Debugger has detached; object registry had 1 entries
211 02-10 16:40:59.204 I 178 ActivityManager Start proc com.example.neon for activity com.example.neon/.HelloNeon: pid=25801 uid=10061 gids={1015}
212 02-10 16:40:59.220 D 25801 dalvikvm Debugger has detached; object registry had 1 entries
213 02-10 16:40:59.228 V 254 PhoneStatusBar setLightsOn(true)
214 02-10 16:40:59.244 D 25801 dalvikvm Trying to load lib /data/data/com.example.neon/lib/libhelloneon.so 0x41812300
215 02-10 16:40:59.244 D 25801 dalvikvm Added shared lib /data/data/com.example.neon/lib/libhelloneon.so 0x41812300
216 02-10 16:40:59.244 D 25801 dalvikvm No JNI_OnLoad found in /data/data/com.example.neon/lib/libhelloneon.so 0x41812300, skipping init
217 02-10 16:40:59.244 D 25801 HelloNeon CPU-ABI : armeabi-v7a CPU-ABI2 : armeabi
218 02-10 16:40:59.251 I 25801 helloneon call Java_com_example_neon_HelloNeon_stringFromJNI
219 02-10 16:40:59.283 D 456 OpenGLRenderer Flushing caches (mode 1)
220 02-10 16:40:59.290 D 456 OpenGLRenderer Flushing caches (mode 0)
221 02-10 16:40:59.931 I 25801 helloneon armeabi
222 02-10 16:40:59.947 I 178 WindowManager createSurface Window{41d5fb30 com.example.neon/com.example.neon.HelloNeon paused=false}: DRAW NOW PENDING
223 02-10 16:40:59.986 W 25801 TextLayoutCache computeValuesWithHarfbuzz -- need to force to single run
224 02-10 16:40:59.986 I 178 ActivityManager Displayed com.example.neon/.HelloNeon: +816ms
225 02-10 16:40:59.994 V 254 PhoneStatusBar setLightsOn(true)




이미 시간이 지나서 어떻게든 하셨겠지만...
looked deeper into this issue and I confirm that the bug exists in all ICS releases to date, it's a platform bug, unrelated to the NDK itself :-(.
The fix has been already submitted internally and should be part of the next minor platform update (sorry, can't give any ETAs here).
I'm really sorry, this is really very unfortunate. At this point, there are two ways to work-around the issue:
1/ As mentioned previously, ensure that the armeabi-v7a binaries are packaged _after_ the armeabi ones in the final .apk. This is not trivial, but one way to do it is remove the armeabi-v7a files from the package, then add them back, manually.
2/ I believe a second way is to provide separate packages on market for different devices on Market, but it is also very painful.
- David
아이스크림 샌드위치 버그입니다. 릴리즈된 모든 버전에 버그가 있고, 구글 인터널 마스터에서 해결되었지만 언제 릴리즈될지 알 수 없죠. 앱을 따로 만들거나 패키징에 삽질을 해야 할텐데 David의 말처럼 어떤 방법이든지 고통스러울겁니다...