Skip to content
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

crash on android 4.2.2 (API 17) #5

Open
trantung998 opened this issue Nov 18, 2015 · 12 comments
Open

crash on android 4.2.2 (API 17) #5

trantung998 opened this issue Nov 18, 2015 · 12 comments
Labels

Comments

@trantung998
Copy link

i have an error when run on android 4.2.2, this is log:

11-18 18:20:15.321 20575-21673/com.lalongooo.videocompressor W/dalvikvm: No implementation found for native Lorg/telegram/Utilities;.convertVideoFrame:(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;IIIII)I
11-18 18:20:15.346 20575-21673/com.lalongooo.videocompressor E/tmessages: time = 465
11-18 18:20:15.346 20575-21673/com.lalongooo.videocompressor W/dalvikvm: threadid=12: thread exiting with uncaught exception (group=0x415b8a08)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime: java.lang.RuntimeException: An error occured while executing doInBackground()
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at android.os.AsyncTask$3.done(AsyncTask.java:299)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at java.util.concurrent.FutureTask.run(FutureTask.java:239)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at java.lang.Thread.run(Thread.java:864)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:  Caused by: java.lang.UnsatisfiedLinkError: Native method not found: org.telegram.Utilities.convertVideoFrame:(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;IIIII)I
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at org.telegram.Utilities.convertVideoFrame(Native Method)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at com.lalongooo.videocompressor.video.MediaController.convertVideo(MediaController.java:590)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at com.lalongooo.videocompressor.MainActivity$VideoCompressor.doInBackground(MainActivity.java:131)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at com.lalongooo.videocompressor.MainActivity$VideoCompressor.doInBackground(MainActivity.java:120)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at android.os.AsyncTask$2.call(AsyncTask.java:287)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
11-18 18:20:15.356 20575-21673/com.lalongooo.videocompressor E/AndroidRuntime:     at java.lang.Thread.run(Thread.java:864) 

i think it needs load the native lib for convertVideoFrame fuction

@lalongooo
Copy link
Owner

Do you have the NDK installed?
}

@devesh1991
Copy link

If library is already compiled then no need to USE NDK.

I am getting same error even in your sample. please help us to resolve the problem

@TheSikh
Copy link

TheSikh commented Nov 30, 2015

You have to compile the .so file again if you move or rename the java class in which native method is declared you need to change the corresponding native method name in c file. In our case we have video.c file in jni folder. We need to update the method name according to the package name of java class which will be using this method and also adding "Java_" as prefix to method name. Hope this Help.

Thanks.

@lalongooo
Copy link
Owner

Thanks for your comments @deep7964. @trantung998, please give it a try.. 😁

@trantung998
Copy link
Author

thank you @deep7964 , it works and i have another problem "Green bar in compressed videos"

http://telegram.wiki/tips:androidvideocompression

@devesh1991
Copy link

I am still getting same crash on 4.2.2

@lalongooo
Copy link
Owner

Have you tried the @deep7964 solution?

@devesh1991
Copy link

I tried to compile but getting error of some imports, include file.
I am using Ndk Revision 10d.
I request you to compile at your side

@fbcbl
Copy link

fbcbl commented Dec 10, 2015

I also have this problem:

In file included from /Users/fabiocarballo/VideoCompressor/app/src/main/jni/./libjpeg/armv6_idct.S:63:0:
/Users/fabiocarballo/Documents/android-ndk-r10/platforms/android-L/arch-arm/usr/include/machine/cpu-features.h:52:6: error: #error Unknown or unsupported ARM architecture
 #    error Unknown or unsupported ARM architecture
      ^
make: *** [/Users/fabiocarballo/VideoCompressor/app/src/main/obj/local/armeabi/objs/tmessages.7/./libjpeg/armv6_idct.o] Error 1

Im using the latest ndk (10) to compile. Do you have any idea on how to solve this? @lalongooo

@lalongooo
Copy link
Owner

@deep7964 @fabiocarballo I'll reopen this issue and take a look later 😄

@dineshswaas
Copy link

@trantung998 , use below width and height for " Green bar issuee....." . its works for me...
int resultWidth = 960;
int resultHeight = 640;
thanks ...... :) happy coding....

@TxShon
Copy link

TxShon commented Feb 21, 2017

how do you compile the .so file again @deep7964,when i compile it, i got 'opus.h' file not found error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants