Build error when building custom extension with android specific jars

R Rick de Klerck 3 years 7 months ago
11 0 0

I'm trying for a couple of days now to build a custom extension which uses code from (android specific) jar files with rhostudio 4.1.1.
I followed the tutorial on how to build a native extension and at first it didn't build. Once I deleted the generated rake file, it did work. It returned a String which I printed in javascript.

After that I tried adding some jar files. I created a bin folder and modified the build script to copy the jars to the TARGET_TEMP_DIR. So far so good.
I modified my code to use the classes in the jar and than tried to build.

This was the error:

CMD: "C:/Program Files (x86)/Java/jdk1.7.0_45/bin/javac.exe" -g -d C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/greeting -source 1.6 -target 1.6 -nowarn -encoding latin1 -classpath C:/Intergamma/adt-bundle-windows-x86_64-20131030/sdk/platforms/android-19/android.jar;C:/Intergamma/adt-bundle-windows-x86_64-20131030/sdk/extras/android/support/v4/android-support-v4.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/Rhodes;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/barcode/barcode.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/cardreader/cardreader.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/coreapi/android-support-v4.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/hardwarekeys/hardwarekeys.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/indicators/indicators.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/rhoelements-license/rhoelements-license.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/rhoelementsext/commons-net-3.1.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/rhoelementsext/httpmime-4.1.1.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/rhoelementsext/rhoelementsext.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/rhoelementsext/svg-android-1.1.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/rhoelementsext/VMF_Library.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/signature/signature.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/librhodes/Rhodes.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/coreapi/coreapi.jar;C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/rhoconnect-client/rhoconnect-client.jar @C:/Users/rdkl/AppData/Local/Temp/greetingSRC_build20150216-5768-gt017v
C:\Eurocis\RHO-workspace\MC40\MC40\extensions\greeting\ext\platform\android\src\com\rho\greeting\GreetingSingleton.java:9: error: package com.parse does not exist
import com.parse.LogInCallback;

It couldn't find the classes i assumed. Than I removed 'exttype: rakefile' from the 'ext.yml' (read is somewhere). And because I removed the rake earlier it made sense.
But than this error was shown:

In file included from C:/MotorolaRhoMobileSuite4.1.1/ruby/lib/ruby/gems/1.9.1/gems/rhodes-4.1.1/platform/android/../shared/ruby/include/ruby.h:32:0,
                 from C:/MotorolaRhoMobileSuite4.1.1/ruby/lib/ruby/gems/1.9.1/gems/rhodes-4.1.1/platform/android/Rhodes/jni/src/../include/rhodes/JNIRhoRuby.h:30,
                 from C:/MotorolaRhoMobileSuite4.1.1/ruby/lib/ruby/gems/1.9.1/gems/rhodes-4.1.1/platform/android/../../platform/android/Rhodes/jni/src/MethodResultJni.cpp:4:
[33mC:/MotorolaRhoMobileSuite4.1.1/ruby/lib/ruby/gems/1.9.1/gems/rhodes-4.1.1/platform/android/../shared/ruby/include/ruby/ruby.h:1063:31: warning: 'void rb_global_variable(VALUE*)' hides constructor for 'struct rb_global_variable' [-Wshadow]
[0mC:/MotorolaRhoMobileSuite4.1.1/ruby/lib/ruby/gems/1.9.1/gems/rhodes-4.1.1/platform/android/../../platform/android/Rhodes/jni/src/MethodResultJni.cpp: In copy constructor 'rho::apiGenerator::MethodResultJni::MethodResultJni(const rho::apiGenerator::MethodResultJni&)':
[33mC:/MotorolaRhoMobileSuite4.1.1/ruby/lib/ruby/gems/1.9.1/gems/rhodes-4.1.1/platform/android/../../platform/android/Rhodes/jni/src/MethodResultJni.cpp:366:17: warning: declaration of 'env' shadows a previous local [-Wshadow-compatible-local]
[0m [33mC:/MotorolaRhoMobileSuite4.1.1/ruby/lib/ruby/gems/1.9.1/gems/rhodes-4.1.1/platform/android/../../platform/android/Rhodes/jni/src/MethodResultJni.cpp:359:13: warning: shadowed declaration is here [-Wshadow-compatible-local]
[0mrake aborted!
[31mLinking library failed: C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/librhodes/lib/armeabi/librhodes.so [0m

Tasks: TOP => link:arm => C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/librhodes/lib/armeabi/librhodes.so
(See full trace by running task with --trace)

--------------------------------------------------------------------------------
PWD: C:/MotorolaRhoMobileSuite4.1.1/ruby/lib/ruby/gems/1.9.1/gems/rhodes-4.1.1
C:/Intergamma/adt-bundle-windows-x86_64-20131030/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe -shared -Wl,--no-whole-archive -Wl,--no-undefined -Wl,-z,defs -fPIC -Wl,-soname,librhodes.so --sysroot C:/Intergamma/adt-bundle-windows-x86_64-20131030/android-ndk-r10d/platforms/android-19/arch-arm -o "C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/librhodes/lib/armeabi/librhodes.so" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/RhoClassFactory.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/JNIRhoRuby.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/JNIRhoJS.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/bluetooth.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/callbacks.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/camera.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/datetimepicker.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/event.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/fileapi.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/geolocation.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/logconf.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/logger.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/mapview.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/nativebar.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/nativeview.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/navbar.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/phonebook.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/rhoconf.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/rhodes.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/rhodesapp.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/rhodessystem.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/ringtones.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/socketimpl.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/splashscreen.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/sslimpl.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/webview.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/rhocryptimpl.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/extmanager.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/MethodExecutorJni.cpp.o" "C:/Eurocis/RHO-workspace/MC40/MC40/bin/tmp/librhodes/arm/MethodResultJni.cpp.o" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/barcode/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/cardreader/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/coreapi/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/hardwarekeys/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/indicators/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/rhoconnect-client/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/rhoelements-license/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/rhoelementsext/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/sensor/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/extensions/signature/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/sqlite/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/curl/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/ruby/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/json/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/rhocommon/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/rhodb/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/rholog/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/rhosync/armeabi" -L"C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/rhomain/armeabi" -Wl,--whole-archive -lbarcode -lcardreader -lcoreapi -lhardwarekeys -lindicators -lrhoconnect-client -lrhoelements-license -lRhoElementsExt -lsensor -lsignature -Wl,--no-whole-archive -lsqlite -lcurl -lruby -ljson -lrhocommon -lrhodb -lrholog -lrhosync -lrhomain -lsqlite -lcurl -lsqlite -lruby -lsqlite -lcurl -ljson -lsqlite -lcurl -lruby -lrhocommon -lsqlite -lcurl -lruby -ljson -lrhodb -lsqlite -lcurl -lruby -ljson -lrhocommon -lrholog -lsqlite -lcurl -lruby -ljson -lrhocommon -lrhodb -lrhosync -lsqlite -lcurl -lruby -ljson -lrhocommon -lrhodb -lrholog -lrhomain -lsqlite -lcurl -lruby -ljson -lrhocommon -lrhodb -lrholog -lrhosync -llog -ldl -lz -LC:/Intergamma/adt-bundle-windows-x86_64-20131030/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi -lgnustl_static -LC:/Intergamma/adt-bundle-windows-x86_64-20131030/android-ndk-r10d/platforms/android-19/arch-arm/usr/lib -Wl,-rpath-link=C:/Intergamma/adt-bundle-windows-x86_64-20131030/android-ndk-r10d/platforms/android-19/arch-arm/usr/lib C:/Intergamma/adt-bundle-windows-x86_64-20131030/android-ndk-r10d/platforms/android-19/arch-arm/usr/lib/libc.so C:/Intergamma/adt-bundle-windows-x86_64-20131030/android-ndk-r10d/platforms/android-19/arch-arm/usr/lib/libm.so
[31mc:/intergamma/adt-bundle-windows-x86_64-20131030/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/Eurocis/RHO-workspace/MC40/MC40/bin/target/android/release/ruby/armeabi/libruby.a(extensions.c.o): in function Init_Extensions:C:/MotorolaRhoMobileSuite4.1.1/ruby/lib/ruby/gems/1.9.1/gems/rhodes-4.1.1/platform/android/../../platform/shared/ruby/ext/rho/extensions.c:15: error: undefined reference to 'Init_Greeting_extension'
           [0mcollect2: ld returned 1 exit status
          rake aborted!
          Build failed: rhodes

And now I'm really out of ideas. I tried building with ndkr9 and r10d.
Really need some help?

CONTACT
Can’t find what you’re looking for?