-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with ProGuard: ClassNotFoundException: org.bytedeco.javacpp.avutil #79
Comments
Please try to follow the instructions here: |
It is still can not work, can you tell me which improtant step I may have ignored。 |
Please explain in detail what you are doing. |
I am developing an android app. I add javacv.jar javacpp.jar ffmpeg.jar opencv.jar into libs, extracts ffmpeg-android-arm.jar and opencv-android-arm.jar to get *.so files , put them into the armeabi folder |
Don't do that. Please try to follow the instructions here: |
do i need to extract jar files to get *.so file? When i follow the manual-installation : Add External JARs..., i got a error : java.lang.VerifyError, so i have to Add Library..., but it can not work. |
You seem to be trying to use the ADT plugin for Eclipse, which is buggy and isn't supported by Google anymore. Please install Android Studio, and follow the instructions for Android here: |
ok,thank you very much |
When i used Android Studio ,I got "java.lang.NoClassDefFoundError: org/bytedeco/javacpp/avcodec$AVPacket" |
Which JAR files are you using and how did you add them? |
I added javacv.jar javacpp.jar ffmpeg.jar opencv.jar iffmpeg-android-arm.jar and opencv-android-arm.jar into libs |
And which ones are in the dependencies list? |
all |
I've just tried again with both What about you? Do you have the same issue with these two samples as well? |
As I see above, I have met same error with @lansedebing. And my project that i'm working on do not allow me to change IDE. So, I can't use javaCV on eclipse anymore, isn't it? |
Which IDE you use has no relation to which libraries you can or cannot use. JavaCPP/JavaCV 0.10 does not work any worse or better than version 0.7 on Eclipse. It's just that Google itself does not support Eclipse for Android anymore, so if you do not feel like fighting Google, you should switch to Android Studio. I certainly don't feel like it, so I only provide free support in the case of Android Studio. There are binaries for both android-arm and android-x86 platforms as part of the JavaCPP Presets, so simply use both of them to support both ARM and x86 devices. |
I have the same problem. I am using javacv 0.10 I have used the manual install and all the jar files mentioned above plus the ffmpegX86 opencvX86 in my lib folder. When I build with pro guard it gives me 841 warnings. I suppress them with the -dontwarn and the code compiles. At runtime I get the above error. |
Does this still happen with version 0.11? |
I tried with version 0.11 too and I run into the same problem |
@sethshal Could you provide more details about what is happening? I'm not getting any errors or warnings here. Thanks! |
Do you want the gradle build output without the -dontwarn? Or the log file when compiled with the -dontwarn and executed? |
Here are some of the warnings while building with pro guard
|
I am trying to use FFmpegFrameRecorder to generate a slideshow from a set I am attaching the screen shot to list my libraries. And also the the On Wed, Apr 8, 2015 at 10:47 AM, Samuel Audet notifications@github.com
|
I tried running the app by suppressing the warnings and with the latest 0.11 Here is the error at runtime
|
Hum, so ProGuard doesn't ignore and remove unused class? It's a bit less powerful that I thought. We should think about what to do for that...
|
Here is the relevant part of the build file
pro guard rules text file has -dontwarn org.bytedeco.javacv.** |
I see the problem. I remember where I saw problems like that before: Basically, the problem is that JavaCPP uses the Once we figure this out, it would be nice to have this documented properly, so if you have some time, please create a nice wiki page explaining what we should do! You should have write permission: Or alternatively, we could put sample project files here: Thanks for reporting and checking this out!! |
I do include the javacv.jar file as the project does not compile without it. On Tue, May 12, 2015 at 9:56 AM, Laurens Versluis notifications@github.com
|
add the following dependency en remove the jar (I have no jars in my libs folder at all): |
Thats how I have it right now. I had done a manual install before but with On Tue, May 12, 2015 at 10:43 AM, Laurens Versluis <notifications@github.com
|
Hello all. I have problem.Please help me. Sometimes/ rarely errors :
|
@semiromid Please try again with version 0.11 |
Ок |
@sethshal Ok, I see the issue. When you compile the app for release, it compresses stuff. So my app ends up being 39.5MB. Now when you install it, it becomes ~85MB. That explains your size. To reduce size, maybe something like this http://stackoverflow.com/questions/30393603/android-gradle-load-and-compile-libraries-based-on-architecture will work... But I have not figured that out yet. If you do, add it to the wiki! |
Oh so your apt size was 39.5 MB. That makes sense. @samuel I haven't done On Mon, May 25, 2015 at 5:06 PM, Laurens Versluis notifications@github.com
|
@sethshal Try to strip them out one by one, and put back those without which your app doesn't work :) |
@lfdversluis I followed the directions in the wiki page you create but I am still getting errors:
Any ideas on what to try next? |
@saudet Does it matter where I copy the .so files? |
@sethshal Of course it matters. Please ask the Android team for information regarding your native platform, and let us know what you find! Thanks |
For android, I wrote the build.gradle as below. Everything is good. dependencies {
compile group: 'org.bytedeco', name: 'javacv', version: '1.0'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '2.4.11-0.11', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.6.1-0.11', classifier: 'android-arm'
} |
hi Saudet, i'm facing same problem,
|
@lfdversluis So, are you confident that your instructions on the wiki fixes all and every problem related to ProGuard, and we can close this issue? Let me know! Thanks |
I haven't worked on the project for a while. So I haven't had a chance to test any new build. The last I had tried it the app size was huge as I had to disable proguard. I had managed to reduce the app size a bit by removing so library files. |
It was a long read. But I've read all the posts, and desperately need to get this working. I approached it skeptically, but the instructions on the wiki page were very helpful, and after adjusting the proguard settings manually, and following ALL of the instructions, I still get this error:
my build.gradle has: dependencies {
compile group: 'org.bytedeco', name: 'javacv', version: '1.1'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-x86'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-x86'
} I also tried previous versions of ffmpeg and openCV (2.6.1, 2.4.1, etc) which were stated to be working in this thread. My proguard-rules.pro file contains the instructions straight from the wiki today. ( https://github.com/bytedeco/javacv/wiki/Configuring-Proguard-for-JavaCV ) Again, the instructions were good, and appear to work, because before these settings were applied, I was getting duplicate symbols for including the ffmpeg library, as well as the ffmpeg x86, and ffmpeg arm libraries. So I think that certainly helps when compiling with Android SDK 23 build tools for multiple platforms. However I still get the error. I am running on a Galaxy S6 (which is Arm-64). *Edit: I was wrong. It didn't compile correctly, and it was using a cached APK with the manaul copies of the JAR files for deploying to device. the compiler when I had the proguard settings, and the dependencies setup the error was: What went wrong:
**Edit 2: I fixed the duplicate file exception by adding:
but now the gradle console output is throwing a new exciting error:
*** Edit 3: I had the jar files and the dependencies defined... Cost of trying to many options. I was able to get the compiler errors to go away, and it looks like everything is working now. As a note: I specifically did NOT need to update the proguard manually per the wiki. That in fact caused a myriad of problems... The proguard that ships with Android SDK / Android Studio now works fine. |
Hi, I followed the wiki instructions but still got the ClassNotFoundException with difference stack trace output:
Don't know why such many .so libs were not found and ignored up there, which may cause the exception. Did I miss anything?? Thanks. |
If the libraries are missing, then the proguard didn't run correctly... Did you follow the steps in this wiki document: https://github.com/bytedeco/javacv/wiki/Configuring-Proguard-for-JavaCV (P.S. - in regards to the "Upgrade your proguard in the Android SDK" I didn't need to replace my Proguard version. The one that came with Android SDK was new enough as of now [December 2015]) |
@Jamoke thanks :) |
Hope you got the correct dependencies in libs folder and try Project->Clean Regards, |
You've been invited to join HelloFax by spk674@gmail.com. HelloFax lets you send and receive faxes from the browser. Join now and we'll both get 5 free fax pages. Accept invitation: https://www.hellofax.com/?ref=c1f8cdb2&%3Bs=F&utm_campaign=friend_invite&utm_source=default&utm_medium=email&utm_content=original Thanks for going paperless! The HelloFax Team |
try to change your classpath to classpath 'com.android.tools.build:gradle:1.2.3' |
@Jamoke would you mind providing the steps to get this working? I've literally trying every possible methods provided but still haven't managed to get this working :'( |
@Jamoke Could you update the instructions on the wiki page with your findings? |
The text was updated successfully, but these errors were encountered: