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

libtee submodule issue (tee_shared_data_types.h not found) #5

Open
ambihelical opened this issue Oct 7, 2016 · 2 comments
Open

libtee submodule issue (tee_shared_data_types.h not found) #5

ambihelical opened this issue Oct 7, 2016 · 2 comments

Comments

@ambihelical
Copy link

The gradle build was not finding tee_shared_data_types.h, so I investigated:
The git submodule references otsservice/src/main/jni/libtee
This is a symlink to ../../../..opentee/src/main/jni/libtee
Which resolves to opentee/src/main/jni/libtee in the opentee-android repo.

git submodule update --init didn't do anything so I ended up doing this:

cd opentee/src/main/jni
git clone https://github.com/Open-TEE/libtee.git

I don't know why the submodule is set up like this, or why it didn't update (doesn't like the symlink?), but this was a workaround that allowed the gradle build to succeed.

Git is version 2.9.3.

@YangRongAtGit
Copy link

Hello ambihelical,

I had the same problem when I tried to use the opentee-android. The header file tee_shared_data_types.h and tee_client_api.h are missing from the folder opentee-android/otservice/src/main/jni/

To fix that, I suppose you have the original Open-TEE project somewhere. The missing header files are in the original Open-TEE project. So you could create soft links in the folder opentee-android/otservice/src/main/jni/

ln -s /home/<Open-TEE project path>/libtee/include/tee_client_api.h
ln -s /home/<Open-TEE project path>/libtee/include/tee_shared_data_types.h

Then, go back the android studio, Sync -> Clean project ->Rebuild Project.
The good news is the header file missing problem should gone.
Bad news is: you will have errors

Error:(34, 21) error: '__android_log' was not declared in this scope
Information:(84, 5) in expansion of macro 'LOGD'
Warning:(35, 79) warning: format '%s' expects argument of type 'char*', but argument 10 has type 'void*' [-Wformat=]
Information:(91, 9) in expansion of macro 'LOGI'
Error:(34, 35) error: expected ';' before '_print'
Information:(102, 5) in expansion of macro 'LOGD'
Error:(34, 21) error: '__android_log' was not declared in this scope
Information:(107, 5) in expansion of macro 'LOGD'
Error:(34, 35) error: expected ';' before '_print'
Information:(110, 9) in expansion of macro 'LOGD'
Error:(34, 35) error: expected ';' before '_print'
Information:(113, 5) in expansion of macro 'LOGD'
Error:(34, 21) error: '__android_log' was not declared in this scope
Information:(122, 5) in expansion of macro 'LOGD'
...

I have not figured out how to fix those errors. By some reasons, the library log is not linked. I tried to add ndk block in build.gradle (Module:otservice) and include ldLibs: 'log'. But that does not fix the problem.

If you find out how to fix the link error, please let me know :)

Thanks and gl.

@ambihelical
Copy link
Author

I didn't have any problem after I cloned the libtee.git repo in the right place, as I indicated in my post.
The real problem is that the submodule is not configured correctly, as far as I can tell.
I'm not using Android Studio though, so this may be different. Good luck.

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

No branches or pull requests

2 participants