KagayamaKaede / ShadowsocksRDroid

A ShadowsocksR client for Android4.0+.Compatible Shadowsocks protocol and support some ShadowsocksR function.
Other
341 stars 103 forks source link

ndk compile failed #1

Closed yantao2hao closed 9 years ago

yantao2hao commented 9 years ago

First issues,first show respect to author,haha. But when I build this ull of enthusiasm,there is jni error,do please help me,thanks a lot. This is the out put message:

Information:Gradle tasks [:app:assembleDebug] :app:buildNative F:\androidndk\android-ndk-r10e\build\core\build-binary.mk Warning:(464) warning: overriding commands for target ../../build/obj/local/armeabi-v7a/objs/crypto/evp/e_camellia.o' Warning:(464) warning: ignoring old commands for target../../build/obj/local/armeabi-v7a/objs/crypto/evp/e_camellia.o' Warning:(464) warning: overriding commands for target ../../build/obj/local/arm64-v8a/objs/crypto/evp/e_camellia.o' Warning:(464) warning: ignoring old commands for target../../build/obj/local/arm64-v8a/objs/crypto/evp/e_camellia.o' Warning:(464) warning: overriding commands for target ../../build/obj/local/x86/objs/crypto/evp/e_camellia.o' Warning:(464) warning: ignoring old commands for target../../build/obj/local/x86/objs/crypto/evp/e_camellia.o' Warning:(464) warning: overriding commands for target ../../build/obj/local/x86_64/objs/crypto/evp/e_camellia.o' Warning:(464) warning: ignoring old commands for target../../build/obj/local/x86_64/objs/crypto/evp/e_camellia.o' [armeabi-v7a] Compile thumb : sodium <= crypto_generichash.c [armeabi-v7a] Compile thumb : sodium <= scalarmult_curve25519_api.c [armeabi-v7a] Compile thumb : sodium <= crypto_stream.c [armeabi-v7a] Compile thumb : tun2socks <= DebugObject.c [armeabi-v7a] Compile thumb : tun2socks <= BLog.c [armeabi-v7a] Compile thumb : tun2socks <= BPending.c [armeabi-v7a] Compile thumb : tun2socks <= BDatagram_unix.c [armeabi-v7a] Compile thumb : tun2socks <= SocksUdpGwClient.c [arm64-v8a] Compile : crypto <= aes_core.c [arm64-v8a] Compile : sodium <= crypto_generichash.c [arm64-v8a] Compile : sodium <= scalarmult_curve25519_api.c [arm64-v8a] Compile : sodium <= crypto_stream.c [arm64-v8a] Compile : tun2socks <= DebugObject.c [arm64-v8a] Compile : tun2socks <= BLog.c [arm64-v8a] Compile : tun2socks <= BPending.c [arm64-v8a] Compile : tun2socks <= BDatagram_unix.c [arm64-v8a] Compile : tun2socks <= SocksUdpGwClient.c [x86] Compile : crypto <= aes_core.c [x86] Compile : sodium <= crypto_generichash.c [x86] Compile : sodium <= scalarmult_curve25519_api.c [x86] Compile : sodium <= crypto_stream.c [x86] Compile : tun2socks <= DebugObject.c [x86] Compile : tun2socks <= BLog.c [x86] Compile : tun2socks <= BPending.c [x86] Compile : tun2socks <= BDatagram_unix.c [x86] Compile : tun2socks <= SocksUdpGwClient.c [x86_64] Compile : crypto <= aes_core.c [x86_64] Compile : sodium <= crypto_generichash.c [x86_64] Compile : sodium <= scalarmult_curve25519_api.c [x86_64] Compile : sodium <= crypto_stream.c [x86_64] Compile : tun2socks <= DebugObject.c [x86_64] Compile : tun2socks <= BLog.c [x86_64] Compile : tun2socks <= BPending.c [x86_64] Compile : tun2socks <= BDatagram_unix.c [x86_64] Compile : tun2socks <= SocksUdpGwClient.c [armeabi-v7a] Compile++ thumb: Jni <= Jni.cpp [armeabi-v7a] Compile thumb : cpufeatures <= cpu-features.c [armeabi-v7a] Compile thumb : ancillary <= fd_recv.c [armeabi-v7a] Compile thumb : ancillary <= fd_send.c [armeabi-v7a] Compile thumb : pdnsd <= cache.c [armeabi-v7a] Compile thumb : pdnsd <= conf-parser.c [armeabi-v7a] Compile thumb : pdnsd <= conff.c jni/pdnsd/src/conff.c: In function 'read_config_file': Warning:warning: label 'close_file' defined but not used [-Wunused-label] close_file: ^ jni/pdnsd/src/conf-parser.c: In function 'confparse': Warning:warning: variable 'ignore_cd' set but not used [-Wunused-but-set-variable] int ignore_cd; ^ [armeabi-v7a] Compile thumb : pdnsd <= consts.c [armeabi-v7a] Compile thumb : pdnsd <= debug.c [armeabi-v7a] Compile thumb : pdnsd <= dns.c [armeabi-v7a] Compile thumb : pdnsd <= dns_answer.c [armeabi-v7a] Compile thumb : pdnsd <= dns_query.c jni/pdnsd/src/dns_query.c: In function 'p_exec_query': Warning:warning: variable 'qc' set but not used [-Wunused-but-set-variable] unsigned short qt,qc; ^ [armeabi-v7a] Compile thumb : pdnsd <= error.c [armeabi-v7a] Compile thumb : pdnsd <= hash.c [armeabi-v7a] Compile thumb : pdnsd <= helpers.c [armeabi-v7a] Compile thumb : pdnsd <= icmp.c [armeabi-v7a] Compile thumb : pdnsd <= list.c [armeabi-v7a] Compile thumb : pdnsd <= main.c [armeabi-v7a] Compile thumb : pdnsd <= netdev.c [armeabi-v7a] Compile thumb : pdnsd <= rr_types.c [armeabi-v7a] Compile thumb : pdnsd <= servers.c [armeabi-v7a] Compile thumb : pdnsd <= status.c [armeabi-v7a] Compile thumb : pdnsd <= thread.c [armeabi-v7a] Compile thumb : redsocks <= base.c [armeabi-v7a] Compile thumb : redsocks <= dnstc.c [armeabi-v7a] Compile thumb : redsocks <= http-connect.c [armeabi-v7a] Compile thumb : redsocks <= log.c [armeabi-v7a] Compile thumb : redsocks <= md5.c [armeabi-v7a] Compile thumb : redsocks <= socks5.c [armeabi-v7a] Compile thumb : redsocks <= base64.c [armeabi-v7a] Compile thumb : redsocks <= http-auth.c [armeabi-v7a] Compile thumb : redsocks <= http-relay.c [armeabi-v7a] Compile thumb : redsocks <= main.c [armeabi-v7a] Compile thumb : redsocks <= parser.c [armeabi-v7a] Compile thumb : redsocks <= redsocks.c [armeabi-v7a] Compile thumb : redsocks <= socks4.c [armeabi-v7a] Compile thumb : redsocks <= utils.c Information:(Unknown) In file included Warning:warning: #warning Using hardcoded value for IP_ORIGDSTADDR as libc headers do not define it. [-Wcpp]

warning Using hardcoded value for IP_ORIGDSTADDR as libc headers do not define it.

 ^

Warning:warning: #warning Using hardcoded value for IP_RECVORIGDSTADDR as libc headers do not define it. [-Wcpp]

warning Using hardcoded value for IP_RECVORIGDSTADDR as libc headers do not define it.

 ^

Warning:warning: #warning Using hardcoded value for IP_TRANSPARENT as libc headers do not define it. [-Wcpp]

warning Using hardcoded value for IP_TRANSPARENT as libc headers do not define it.

 ^

[armeabi-v7a] Compile thumb : event <= buffer.c [armeabi-v7a] Compile thumb : event <= bufferevent.c [armeabi-v7a] Compile thumb : event <= bufferevent_filter.c [armeabi-v7a] Compile thumb : event <= bufferevent_openssl.c [armeabi-v7a] Compile thumb : event <= bufferevent_pair.c [armeabi-v7a] Compile thumb : event <= bufferevent_ratelim.c Information:(Unknown) In file included jni/libevent/bufferevent_ratelim.c: In function 'bufferevent_get_read_limit': Warning:warning: overflow in implicit constant conversion [-Woverflow]

define EV_INT64_MAX ((((ev_int64_t) 0x7fffffffL) << 32) | 0xffffffffL)

                   ^

jni/libevent/include/event2/util.h:239:22: note: in expansion of macro 'EV_INT64_MAX'

define EV_SSIZE_MAX EV_INT64_MAX

                  ^

jni/libevent/bufferevent_ratelim.c:828:7: note: in expansion of macro 'EV_SSIZE_MAX' r = EV_SSIZE_MAX; ^ jni/libevent/bufferevent_ratelim.c: In function 'bufferevent_get_write_limit': Warning:warning: overflow in implicit constant conversion [-Woverflow]

define EV_INT64_MAX ((((ev_int64_t) 0x7fffffffL) << 32) | 0xffffffffL)

                   ^

jni/libevent/include/event2/util.h:239:22: note: in expansion of macro 'EV_INT64_MAX'

define EV_SSIZE_MAX EV_INT64_MAX

                  ^

jni/libevent/bufferevent_ratelim.c:847:7: note: in expansion of macro 'EV_SSIZE_MAX' r = EV_SSIZE_MAX; ^ [armeabi-v7a] Compile thumb : event <= bufferevent_sock.c [armeabi-v7a] Compile thumb : event <= epoll.c [armeabi-v7a] Compile thumb : event <= epoll_sub.c [armeabi-v7a] Compile thumb : event <= evdns.c [armeabi-v7a] Compile thumb : event <= event.c [armeabi-v7a] Compile thumb : event <= event_tagging.c [armeabi-v7a] Compile thumb : event <= evmap.c [armeabi-v7a] Compile thumb : event <= evrpc.c [armeabi-v7a] Compile thumb : event <= evthread.c [armeabi-v7a] Compile thumb : event <= evthread_pthread.c [armeabi-v7a] Compile thumb : event <= evutil.c [armeabi-v7a] Compile thumb : event <= evutil_rand.c [armeabi-v7a] Compile thumb : event <= http.c [armeabi-v7a] Compile thumb : event <= listener.c [armeabi-v7a] Compile thumb : event <= log.c Information:(Unknown) In file included jni/libevent/http.c: In function 'evhttp_connection_set_max_headers_size': Warning:warning: large integer implicitly truncated to unsigned type [-Woverflow]

define EV_UINT64_MAX ((((ev_uint64_t)0xffffffffUL) << 32) | 0xffffffffUL)

                   ^

jni/libevent/include/event2/util.h:238:21: note: in expansion of macro 'EV_UINT64_MAX'

define EV_SIZE_MAX EV_UINT64_MAX

                 ^

jni/libevent/http.c:631:29: note: in expansion of macro 'EV_SIZE_MAX' evcon->max_headers_size = EV_SIZE_MAX; ^ jni/libevent/http.c: In function 'evhttp_connection_base_new': Warning:warning: large integer implicitly truncated to unsigned type [-Woverflow]

define EV_UINT64_MAX ((((ev_uint64_t)0xffffffffUL) << 32) | 0xffffffffUL)

                   ^

jni/libevent/include/event2/util.h:238:21: note: in expansion of macro 'EV_UINT64_MAX'

define EV_SIZE_MAX EV_UINT64_MAX

                 ^

jni/libevent/http.c:2087:28: note: in expansion of macro 'EV_SIZE_MAX' evcon->max_headers_size = EV_SIZE_MAX; ^ jni/libevent/http.c: In function 'evhttp_new_object': Warning:warning: overflow in implicit constant conversion [-Woverflow]

define EV_UINT64_MAX ((((ev_uint64_t)0xffffffffUL) << 32) | 0xffffffffUL)

                   ^

jni/libevent/include/event2/util.h:238:21: note: in expansion of macro 'EV_UINT64_MAX'

define EV_SIZE_MAX EV_UINT64_MAX

                 ^

jni/libevent/http.c:3200:36: note: in expansion of macro 'EV_SIZE_MAX' evhttp_set_max_headers_size(http, EV_SIZE_MAX); ^ Warning:warning: overflow in implicit constant conversion [-Woverflow]

define EV_UINT64_MAX ((((ev_uint64_t)0xffffffffUL) << 32) | 0xffffffffUL)

                   ^

jni/libevent/include/event2/util.h:238:21: note: in expansion of macro 'EV_UINT64_MAX'

define EV_SIZE_MAX EV_UINT64_MAX

                 ^

jni/libevent/http.c:3201:33: note: in expansion of macro 'EV_SIZE_MAX' evhttp_set_max_body_size(http, EV_SIZE_MAX); ^ jni/libevent/http.c: In function 'evhttp_set_max_headers_size': Warning:warning: large integer implicitly truncated to unsigned type [-Woverflow]

define EV_UINT64_MAX ((((ev_uint64_t)0xffffffffUL) << 32) | 0xffffffffUL)

                   ^

jni/libevent/include/event2/util.h:238:21: note: in expansion of macro 'EV_UINT64_MAX'

define EV_SIZE_MAX EV_UINT64_MAX

                 ^

jni/libevent/http.c:3377:36: note: in expansion of macro 'EV_SIZE_MAX' http->default_max_headers_size = EV_SIZE_MAX; ^ [armeabi-v7a] Compile thumb : event <= poll.c [armeabi-v7a] Compile thumb : event <= select.c [armeabi-v7a] Compile thumb : event <= signal.c [armeabi-v7a] Compile thumb : event <= strlcpy.c [armeabi-v7a] Compile thumb : ss-local <= local.c [armeabi-v7a] Compile thumb : ss-local <= cache.c [armeabi-v7a] Compile thumb : ss-local <= udprelay.c [armeabi-v7a] Compile thumb : ss-local <= encrypt.c [armeabi-v7a] Compile thumb : ss-local <= utils.c [armeabi-v7a] Compile thumb : ss-local <= netutils.c [armeabi-v7a] Compile thumb : ss-local <= json.c Information:(Unknown) In file included jni/shadowsocks-libev/libsodium/src/libsodium/include/sodium.h:48:28: fatal error: sodium/version.h: No such file or directory

include <sodium/version.h>

                        ^

compilation terminated. make.exe: * [../../build/obj/local/armeabi-v7a/objs/ss-local/shadowsocks-libev/src/encrypt.o] Error 1 make.exe: * Waiting for unfinished jobs.... :app:buildNative FAILED Error:Execution failed for task ':app:buildNative'.

Process 'command 'F:\androidndk\android-ndk-r10e/ndk-build.cmd'' finished with non-zero exit value 2 Information:BUILD FAILED Information:Total time: 1 mins 32.558 secs Information:1 error Information:21 warnings Information:See complete output in console

KagayamaKaede commented 9 years ago

Oh,sorry,This is my fault,I forgot add version.h file to repo.

At this time,You can create version.h to .../jni/shadowsocks-libev/libsodium/src/libsodium/include/sodium. below is version.h's content.


#ifndef sodium_version_H
#define sodium_version_H

#include "export.h"

#define SODIUM_VERSION_STRING "1.0.1"

#define SODIUM_LIBRARY_VERSION_MAJOR 7
#define SODIUM_LIBRARY_VERSION_MINOR 3

#ifdef __cplusplus
extern "C" {
#endif

SODIUM_EXPORT
const char *sodium_version_string(void);

SODIUM_EXPORT
int         sodium_library_version_major(void);

SODIUM_EXPORT
int         sodium_library_version_minor(void);

#ifdef __cplusplus
}
#endif

#endif
KagayamaKaede commented 9 years ago

When jni compile successful.You need copy daemon binary to assets folder. image

yantaodehaoma commented 9 years ago

Thank you,what do you mean by copy daemon binary to assets folder.they do in this folder after compiled. nzz2in 2gc8o k0ddb5t

it seems that the ss network does not work ,I have tested the server which is ok .

KagayamaKaede commented 9 years ago

That's binary file is my pushed file. it seems that the ss network does not work. VPN notification icon is show in status bar?

yantaodehaoma commented 9 years ago

Yes ,is showing,and very few data is Transferring(about one packet/second send,almost zero receive). Then I back to the shadowsocksRdroid activity,it seems that the vpn is disabled,may be the trick is the 'daemon binary',I will try.

yantaodehaoma commented 9 years ago

Since the jni rebuilding takes so long a time,will it work if we just build once then comment the buildNative task in the gradle script?or we just copy these .so libs?

KagayamaKaede commented 9 years ago

If you not changed jni code, you can comment below gradle script to reduce compile time.

tasks.withType(JavaCompile) {
        compileTask -> compileTask.dependsOn buildNative
}

yes,just compile once and copy daemon file to assets folder.

KagayamaKaede commented 9 years ago

@yantaodehaoma I fixed connect issue and pushed complete. @yantao2hao If issue solved,please close this issue,Thank you.