简体   繁体   English

错误1 libavcodec.so文件格式无法识别Android GL动态壁纸

[英]Error 1 libavcodec.so File format not recognized Android GL Live Wallpaper

I am trying to make a Live Wallpaper for android that plays an .mp4 video located on the device in android-asset (with the example I am using, it actually copies the file to the sdcard at runtime/doesn't matter) 我正在尝试制作一个动态壁纸为Android播放位于android-asset设备上的.mp4视频(我正在使用的示例,它实际上在运行时将文件复制到SD卡/无所谓)

I found this example And using this post I was able to get my eclipse set up with NDK and building the project. 我找到了这个例子并且使用这篇文章,我能够通过NDK设置我的eclipse并构建项目。 When building in eclipse using the NDK plugin I get this error in my problems window: 使用NDK插件在eclipse中构建时,我在问题窗口中出现此错误:

    Description Resource    Path    Location    Type
make: *** [libs/armeabi/libavcodec.so] Error 1  GLWallpaperVideoDemo-master         C/C++ Problem
make: *** Deleting file `libs/armeabi/libavcodec.so'    GLWallpaperVideoDemo-master         C/C++ Problem

I get the same error if I try to run ndk-build from command prompt. 如果我尝试从命令提示符运行ndk-build ,我会得到相同的错误。

I downloaded the project from the link above and then imported into eclipse. 我从上面的链接下载了项目,然后导入到eclipse中。 I added the lib GLWallpaperService to the build path, and made sure my NDK was setup. 我将lib GLWallpaperService添加到构建路径,并确保我的NDK已设置。 Knowing that the lib folder changed to libs I also tried moving the GLWallpaperService to the libs folder, which didn't help. 知道lib文件夹更改为libs我也尝试将GLWallpaperService移动到libs文件夹,这没有帮助。

The project builds without NDK just fine in eclipse but obviously errors when trying to run the wallpaper because the native libraries were not built. 该项目在没有NDK的情况下构建得很好,但在尝试运行壁纸时显然是错误,因为没有构建本机库。

How can I resolve this error? 我该如何解决这个错误?

The package you get by git clone https://github.com/frankandrobot/GLWallpaperVideoDemo.git is Linux oriented. 你通过git clone https://github.com/frankandrobot/GLWallpaperVideoDemo.git获得的软件包是面向Linux的。 The file jni\\ffmpeg-android\\build\\ffmpeg\\armeabi\\lib\\libavcodec.so and many others are simply symbolic links to actual files. 文件jni\\ffmpeg-android\\build\\ffmpeg\\armeabi\\lib\\libavcodec.so和许多其他文件只是实际文件的符号链接。

To make this all work easily on Windows, I suggest to go to the jni\\ffmpeg-android\\build\\ffmpeg\\armeabi\\lib folder, and run 为了在Windows上轻松完成所有工作,我建议转到jni\\ffmpeg-android\\build\\ffmpeg\\armeabi\\lib文件夹,然后运行

del *.so
copy libavcodec.so.52.99.1 libavcodec.so
copy libavcore.so.0.16.0 libavcore.so
copy libavdevice.so.52.2.2 libavdevice.so
copy libavfilter.so.1.69.0 libavfilter.so
copy libavformat.so.52.88.0 libavformat.so
copy libavutil.so.50.34.0 libavutil.so
copy libswscale.so.0.12.0 libswscale.so

The issue might be because of a corrupted so file. 问题可能是因为文件损坏了。 Try to build the ffmpeg library again or find another version. 尝试再次构建ffmpeg库或找到另一个版本。 Because I have a different error in eclipse when I try to compile the project: 因为我在尝试编译项目时在eclipse中有不同的错误:

C:/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip:./libs/armeabi/libavcodec.so: File format not recognized C:/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip:./ libs / armeabi / libavcodec.so: 文件格式无法识别

And when I search for this error it seems like the error is because of a corrupted file: NDK prebuilt shared library file format not recognized 当我搜索此错误时,似乎错误是由于文件损坏: NDK预建的共享库文件格式无法识别

Or the library is not in a format that Android can use: Error in linking C++ static library with android ndk(Error: file format not recognized) 或者库不是Android可以使用的格式: 链接C ++静态库与android ndk时出错(错误:文件格式无法识别)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM