柠檬虾小总结
【编译环境】
1,Linux操作系统
2,target = android-17
3,java = 1.6.0_33
最近老大让我搞Android原生的相册,编译原生相册报android-support-v13编译错误
Log如下:
aapt: warning: string 'saved' has no default translation in packages/apps/Gallery2/res; found: az az_AZ et hy ka km lo mn ms ne ne_NP si si_LK
Warning: AndroidManifest.xml already defines versionCode (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines versionName (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/android-support-v13_intermediates/javalib.jar', needed by `out/target/common/obj/APPS/Gallery2_intermediates/classes-full-debug.jar'. Stop.(没有依赖)
make: Leaving directory `/work/android-4.4'
解决方案:
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2$ ls
AndroidManifest.xml assets CleanSpec.mk gen jni_jpegstream project.properties src
Android.mk0 bin gallerycommon jni proguard.flags res src_pd
ls发现系统之前保存的是mk0文件,将其改为mk文件
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2$ mv Android.mk0 Android.mk
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2$ ls
AndroidManifest.xml assets CleanSpec.mk gen jni_jpegstream project.properties src
Android.mk bin gallerycommon jni proguard.flags res src_pd
继续编译又报一个错(错误2)
Log如下:
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/com.android.gallery3d.common2_intermediates/javalib.jar', needed by `out/target/common/obj/APPS/Gallery2_intermediates/classes-full-debug.jar'. Stop.
解决方案:
在这个目录下去找com.android.gallery3d.common2
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2$ grep -rn "com.android.gallery3d.common2"
gallerycommon/Android.mk0:23:LOCAL_MODULE := com.android.gallery3d.common2
Binary file .Android.mk.swp matches
Android.mk:8:LOCAL_STATIC_JAVA_LIBRARIES += com.android.gallery3d.common2
发现gallerycommon/ 下Android.mk0文件
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2$ cd gallerycommon/; ls
Android.mk0 src
将其也改为mk文件
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2/gallerycommon$ mv Android.mk0 Android.mk
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2/gallerycommon$ ls
Android.mk src
继续编译又报一个错(错误3)
Log如下:
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/
libjni_jpegstream
_intermediates/javalib.jar', needed by `out/target/common/obj/APPS/Gallery2_intermediates/classes-full-debug.jar'. Stop.
解决方案:
在这个目录下去找libjni_jpegstream
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2$ grep -rn "libjni_jpegstream"
jni_jpegstream/Android.mk0:7:LOCAL_MODULE := libjni_jpegstream
Binary file .Android.mk.swp matches
Android.mk:40: LOCAL_JNI_SHARED_LIBRARIES := libjni_eglfence libjni_filtershow_filters librsjni libjni_jpegstream
Android.mk:42: LOCAL_REQUIRED_MODULES := libjni_eglfence libjni_filtershow_filters libjni_jpegstream
发现jni_jpegstream/下Android.mk0文件
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2$ cd jni_jpegstream/;ls
Android.mk0 src
同样将其改为mk文件
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2/jni_jpegstream$ mv Android.mk0 Android.mk
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2/jni_jpegstream$ ls
Android.mk src
退回/work/android-4.4/ 编译
avatarmind@ubuntu:/work/android-4.4/packages/apps/Gallery2/jni_jpegstream$ croot
avatarmind@ubuntu:/work/android-4.4$ make Gallery2 -j8