Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-15263

Android: Titanium SDK and Modules will not compile with (latest) Android NDK r9

    Details

      Description

      Compiling a Titanium SDK or a Titanium Android module with the latest Android NDK (r9) which was released in July does not work.

      I believe that in your C++ code generation, you are creating invalid C++ which may have been previously allowed, but is now an error by the current version of the Android gcc compiler.

      We need access to the latest NDK and gcc toolchain for access to the latest and greatest Android features.

      The bug is easy to reproduce. Just download the latest Android NDK and create a brand new Titanium module for Android (following your documentation). Below are the steps and the failure output.

      export ANDROID_SDK_ROOT=/Library/Frameworks/Android/android-sdk/
      export ANDROID_NDK_ROOT=/Library/Frameworks/Android/android-ndk-r9/
      export ANDROID_NDK=/Library/Frameworks/Android/android-ndk-r9/
       
      1. Compile SDK
      # run scons
      scons
       
      2. Create and compile module
      ~/Library/Application\ Support/Titanium/mobilesdk/osx/3.1.2.GA/titanium.py create --platform=android --type=module --name=testr9 --id=co.lanica.testr9 --android=$ANDROID_SDK_ROOT
       
      # run ant
      ant
       
       
      Buildfile: /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/build.xml
       
      python.set.exec:
       
      python.check:
           [echo] Testing for Python
           [exec] Python 2.7.2
       
      init:
          [mkdir] Created dir: /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/build/classes
          [mkdir] Created dir: /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/dist
       
      process.annotations:
          [mkdir] Created dir: /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/build/generated/json
          [javac] Compiling 2 source files to /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/build/classes
          [javac] org/appcelerator/titanium/view/TiUIView.class(org/appcelerator/titanium/view:TiUIView.class): warning: Cannot find annotation method 'value()' in type 'android.annotation.SuppressLint': class file for android.annotation.SuppressLint not found
          [javac] org/appcelerator/titanium/TiApplication.class(org/appcelerator/titanium:TiApplication.class): warning: Cannot find annotation method 'value()' in type 'android.annotation.SuppressLint'
          [javac] Note: [KrollBindingGen] Running Kroll binding generator.
          [javac] Note: [KrollBindingGen] No binding data found, creating new data file: org.appcelerator.titanium.bindings/testr9.json
          [javac] Note: [KrollBindingGen] Found binding for proxy Example
          [javac] Note: [KrollBindingGen] Found binding for module Testr9
          [javac] Note: [KrollBindingGen] Generating JSON: /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/build/generated/json/org/appcelerator/titanium/bindings/testr9.json
          [javac] warning: The following options were not recognized by any processor: '[kroll.checkTiContext]'
          [javac] org/appcelerator/titanium/view/TiUIView.class(org/appcelerator/titanium/view:TiUIView.class): warning: Cannot find annotation method 'value()' in type 'android.annotation.SuppressLint': class file for android.annotation.SuppressLint not found
          [javac] org/appcelerator/titanium/TiApplication.class(org/appcelerator/titanium:TiApplication.class): warning: Cannot find annotation method 'value()' in type 'android.annotation.SuppressLint'
          [javac] Note: /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/src/co/lanica/testr9/ExampleProxy.java uses or overrides a deprecated API.
          [javac] Note: Recompile with -Xlint:deprecation for details.
          [javac] 2 warnings
       
      generate.v8.bindings:
           [java] Generating /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/build/generated/jni/co.lanica.testr9.Testr9Module.h
           [java] Generating /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/build/generated/jni/co.lanica.testr9.Testr9Module.cpp
           [java] Generating /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/build/generated/jni/co.lanica.testr9.ExampleProxy.h
           [java] Generating /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/build/generated/jni/co.lanica.testr9.ExampleProxy.cpp
       
      generate.bindings:
       
      pre.compile:
       
      js.compile:
       
      ndk.build:
           [copy] Copying 1 file to /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/build/generated
           [copy] Copying 1 file to /Users/ewing/Source/LANICA/APPC/BUGS/AndroidModule_r9/testr9/build/generated/jni
          [mkdir] Created dir: /var/folders/w0/6ybnr6311nsb21462hkpf3400000gn/T/ewing/testr9-generated
           [copy] Copying 11 files to /var/folders/w0/6ybnr6311nsb21462hkpf3400000gn/T/ewing/testr9-generated
           [exec] Android NDK: WARNING:jni/Android.mk:co.lanica.testr9: non-system libraries in linker flags: -lkroll-v8    
           [exec] Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
           [exec] Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
           [exec] Android NDK:     current module    
           [exec] Android NDK: WARNING:jni/Android.mk:co.lanica.testr9: non-system libraries in linker flags: -lkroll-v8    
           [exec] Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
           [exec] Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
           [exec] Android NDK:     current module    
           [exec] Android NDK: WARNING:jni/Android.mk:co.lanica.testr9: non-system libraries in linker flags: -lkroll-v8    
           [exec] Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
           [exec] Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
           [exec] Android NDK:     current module    
           [exec] jni/Android.mk:32: warning: overriding commands for target `/private/var/folders/w0/6ybnr6311nsb21462hkpf3400000gn/T/ewing/testr9-generated/KrollGeneratedBindings.cpp'
           [exec] jni/Android.mk:32: warning: ignoring old commands for target `/private/var/folders/w0/6ybnr6311nsb21462hkpf3400000gn/T/ewing/testr9-generated/KrollGeneratedBindings.cpp'
           [exec] jni/Android.mk:35: warning: overriding commands for target `/private/var/folders/w0/6ybnr6311nsb21462hkpf3400000gn/T/ewing/testr9-generated/BootstrapJS.cpp'
           [exec] jni/Android.mk:35: warning: ignoring old commands for target `/private/var/folders/w0/6ybnr6311nsb21462hkpf3400000gn/T/ewing/testr9-generated/BootstrapJS.cpp'
           [exec] jni/Android.mk:32: warning: overriding commands for target `/private/var/folders/w0/6ybnr6311nsb21462hkpf3400000gn/T/ewing/testr9-generated/KrollGeneratedBindings.cpp'
           [exec] jni/Android.mk:32: warning: ignoring old commands for target `/private/var/folders/w0/6ybnr6311nsb21462hkpf3400000gn/T/ewing/testr9-generated/KrollGeneratedBindings.cpp'
           [exec] jni/Android.mk:35: warning: overriding commands for target `/private/var/folders/w0/6ybnr6311nsb21462hkpf3400000gn/T/ewing/testr9-generated/BootstrapJS.cpp'
           [exec] jni/Android.mk:35: warning: ignoring old commands for target `/private/var/folders/w0/6ybnr6311nsb21462hkpf3400000gn/T/ewing/testr9-generated/BootstrapJS.cpp'
           [exec] Compile++ thumb  : co.lanica.testr9 <= co.lanica.testr9.ExampleProxy.cpp
           [exec] In file included from jni/co.lanica.testr9.ExampleProxy.cpp:12:0:
           [exec] /Users/ewing/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/native/include/AndroidUtil.h: In destructor 'titanium::LogTimer::~LogTimer()':
           [exec] /Users/ewing/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/native/include/AndroidUtil.h:57:3: warning: format '%d' expects argument of type 'int', but argument 5 has type 'long int' [-Wformat]
           [exec] jni/co.lanica.testr9.ExampleProxy.cpp: In static member function 'static v8::Handle<v8::Value> co::lanica::testr9::testr9::ExampleProxy::setMessage(const v8::Arguments&)':
           [exec] jni/co.lanica.testr9.ExampleProxy.cpp:129:4: error: format not a string literal and no format arguments [-Werror=format-security]
           [exec] jni/co.lanica.testr9.ExampleProxy.cpp: In static member function 'static v8::Handle<v8::Value> co::lanica::testr9::testr9::ExampleProxy::getMessage(const v8::Arguments&)':
           [exec] jni/co.lanica.testr9.ExampleProxy.cpp:194:4: error: format not a string literal and no format arguments [-Werror=format-security]
           [exec] jni/co.lanica.testr9.ExampleProxy.cpp: In static member function 'static v8::Handle<v8::Value> co::lanica::testr9::testr9::ExampleProxy::printMessage(const v8::Arguments&)':
           [exec] jni/co.lanica.testr9.ExampleProxy.cpp:246:4: error: format not a string literal and no format arguments [-Werror=format-security]
           [exec] jni/co.lanica.testr9.ExampleProxy.cpp: In static member function 'static v8::Handle<v8::Value> co::lanica::testr9::testr9::ExampleProxy::getter_message(v8::Local<v8::String>, const v8::AccessorInfo&)':
           [exec] jni/co.lanica.testr9.ExampleProxy.cpp:314:4: error: format not a string literal and no format arguments [-Werror=format-security]
           [exec] jni/co.lanica.testr9.ExampleProxy.cpp: In static member function 'static void co::lanica::testr9::testr9::ExampleProxy::setter_message(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&)':
           [exec] jni/co.lanica.testr9.ExampleProxy.cpp:373:4: error: format not a string literal and no format arguments [-Werror=format-security]
           [exec] cc1plus: some warnings being treated as errors
           [exec] 
           [exec] make: *** [/var/folders/w0/6ybnr6311nsb21462hkpf3400000gn/T//ewing/testr9-generated/obj/local/armeabi/objs/co.lanica.testr9/co.lanica.testr9.ExampleProxy.o] Error 1
       
      BUILD FAILED
      /Users/ewing/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/module/android/build.xml:326: The following error occurred while executing this line:
      /Users/ewing/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/module/android/build.xml:281: exec returned: 2
       
      Total time: 7 seconds
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mlangston Matt Langston
                Reporter:
                ewing Eric Wing
                Reviewer:
                Ping Wang
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-17502
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code