AOSP 4.4 Build Error - Missing File Surface_jni.h

3,265 views
Skip to first unread message

Adam

unread,
Dec 4, 2013, 11:57:59 AM12/4/13
to android-...@googlegroups.com
I am experiencing the following build error attempting to build target aosp-arm_eng on either android-4.4_r1 or android-4.4_1.2:

Traceback (most recent call last):
  File "../../base/android/jni_generator/jni_generator.py", line 1065, in <module>
    sys.exit(main(sys.argv))
  File "../../base/android/jni_generator/jni_generator.py", line 1061, in main
    options.optimize_generation)
  File "../../base/android/jni_generator/jni_generator.py", line 996, in GenerateJNIHeader
    jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, namespace)
  File "../../base/android/jni_generator/jni_generator.py", line 507, in CreateFromClass
    stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 709, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1326, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
make: *** [/home/odexcide/android-4./out/target/product/generic/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h] Error 1
make: *** Waiting for unfinished jobs....

I can successfully build the 4.3_r1 branch and others in the same environment.  My JDK version is jdk6u45 although I also tried jdk6u35.  The file it is erroring out on doesn't exist, so I am assuming the header file doesn't get generated in the first place.  Has anyone else had this same error?

The same error was reported here, but no resolution was posted: http://forum.xda-developers.com/showpost.php?p=47234121&postcount=870

Thanks!
Message has been deleted

Benoit Fouet

unread,
Dec 5, 2013, 4:17:36 AM12/5/13
to android-...@googlegroups.com, Adam
Hi,

On 12/04/2013 05:57 PM, Adam wrote:
> I am experiencing the following build error attempting to build target
> aosp-arm_eng on either android-4.4_r1 or android-4.4_1.2:
>
> Traceback (most recent call last):
> File "../../base/android/jni_generator/jni_generator.py", line 1065, in <module>
> sys.exit(main(sys.argv))
> File "../../base/android/jni_generator/jni_generator.py", line 1061, in main
> options.optimize_generation)
> File "../../base/android/jni_generator/jni_generator.py", line 996, in GenerateJNIHeader
> jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, namespace)
> File "../../base/android/jni_generator/jni_generator.py", line 507, in CreateFromClass
> stderr=subprocess.PIPE)
> File "/usr/lib/python2.7/subprocess.py", line 709, in __init__
> errread, errwrite)
> File "/usr/lib/python2.7/subprocess.py", line 1326, in _execute_child
> raise child_exception
> OSError: [Errno 2] No such file or directory
> make: *** [/home/odexcide/android-4./out/target/product/generic/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h] Error 1
> make: *** Waiting for unfinished jobs....
>

from external/chromium_org/base/android/jni_generator/jni_generator.py,
around line 507:
p = subprocess.Popen(args=['javap', class_name],
cwd=os.path.dirname(class_file),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)

It seems you don't have javap available in your PATH.

--
Ben

Adam

unread,
Dec 5, 2013, 11:44:52 AM12/5/13
to android-...@googlegroups.com, Adam
Thanks Ben...Installing javap via update-alternatives worked.

-Adam

swingyang yang

unread,
Dec 25, 2013, 12:58:58 AM12/25/13
to android-...@googlegroups.com

thank you ! this method  is correct !       

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Mariusz Saramak

unread,
Jan 6, 2014, 7:27:30 AM1/6/14
to android-...@googlegroups.com
I had have similar problem. 
I.e I had installed a java8 and java6. 
I used: 
sudo update-alternatives --config javap 
and I choosen java6 for javap.
it started works. 

ramesh babu Dasari

unread,
Apr 23, 2014, 2:22:52 AM4/23/14
to android-...@googlegroups.com

Hi while building 4.4.2_r1 on ubuntu  i am getting following error can any one help me with this.


Gyp action: Generating JNI bindings from  /home/ubuntu/Ramesh/prebuilts/sdk/17/android.jar/android/view/Surface.class (out/target/product/grouper/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h)

Traceback (most recent call last):
  File "../../base/android/jni_generator/jni_generator.py", line 1065, in <module>
    sys.exit(main(sys.argv))
  File "../../base/android/jni_generator/jni_generator.py", line 1061, in main
    options.optimize_generation)
  File "../../base/android/jni_generator/jni_generator.py", line 996, in GenerateJNIHeader
    jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, namespace)
  File "../../base/android/jni_generator/jni_generator.py", line 509, in CreateFromClass
    jni_from_javap = JNIFromJavaP(stdout.split('\n'), namespace)
  File "../../base/android/jni_generator/jni_generator.py", line 457, in __init__
    contents[1]).group('class_name')
IndexError: list index out of range
make: *** [out/target/product/grouper/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h] Error 1

Sword online

unread,
Apr 8, 2018, 3:43:21 PM4/8/18
to Android Building
Solution for the problem
  1. $ cd /usr/bin  
  2. $ sudo ln -s -f /usr/lib/jvm/jdk1.7.0_80/bin/javap
Reply all
Reply to author
Forward
0 new messages