Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-51897

Failure to build example on Android: "inconvertible types"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.7.0 Beta
    • 5.7
    • QPA
    • None
    • Android

    Description

      /home/mitch/dev/qt5.7/qtbase/configure -debug -developer-build -opensource -confirm-license -xplatform android-g++ -nomake tests -nomake examples -android-ndk /home/mitch/dev/android/android-ndk-r10e -android-sdk /home/mitch/dev/android/android-sdk -android-ndk-host linux-x86_64 -android-toolchain-version 4.9 -no-warnings-are-errors
      
      -compile:
          [javac] Compiling 10 source files to /home/mitch/dev/qt5.7-android-debug/qtquickcontrols2/examples/controls/gallery/android-build/bin/classes
          [javac] /home/mitch/dev/qt5.7-android-debug/qtquickcontrols2/examples/controls/gallery/android-build/src/org/qtproject/qt5/android/bindings/QtService.java:105: error: inconvertible types
          [javac]             return (int) res.methodReturns;
          [javac]                             ^
          [javac]   required: int
          [javac]   found:    Object
          [javac] /home/mitch/dev/qt5.7-android-debug/qtquickcontrols2/examples/controls/gallery/android-build/src/org/qtproject/qt5/android/bindings/QtService.java:144: error: inconvertible types
          [javac]             return (boolean) res.methodReturns;
          [javac]                                 ^
          [javac]   required: boolean
          [javac]   found:    Object
          [javac] Note: Some input files use or override a deprecated API.
          [javac] Note: Recompile with -Xlint:deprecation for details.
          [javac] 2 errors
      

      java -XshowSettings:properties -version says:

      Property settings:
          awt.toolkit = sun.awt.X11.XToolkit
          file.encoding = UTF-8
          file.encoding.pkg = sun.io
          file.separator = /
          java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
          java.awt.printerjob = sun.print.PSPrinterJob
          java.class.path = .
          java.class.version = 51.0
          java.endorsed.dirs = /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/endorsed
          java.ext.dirs = /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext
              /usr/java/packages/lib/ext
          java.home = /usr/lib/jvm/java-7-openjdk-amd64/jre
          java.io.tmpdir = /tmp
          java.library.path = /usr/java/packages/lib/amd64
              /usr/lib/x86_64-linux-gnu/jni
              /lib/x86_64-linux-gnu
              /usr/lib/x86_64-linux-gnu
              /usr/lib/jni                                                                                                                                                                                                                                                                                            
              /lib                                                                                                                                                                                                                                                                                                    
              /usr/lib                                                                                                                                                                                                                                                                                                
          java.runtime.name = OpenJDK Runtime Environment                                                                                                                                                                                                                                                             
          java.runtime.version = 1.7.0_95-b00                                                                                                                                                                                                                                                                         
          java.specification.name = Java Platform API Specification                                                                                                                                                                                                                                                   
          java.specification.vendor = Oracle Corporation
          java.specification.version = 1.7
          java.vendor = Oracle Corporation
          java.vendor.url = http://java.oracle.com/
          java.vendor.url.bug = http://bugreport.sun.com/bugreport/
          java.version = 1.7.0_95
          java.vm.info = mixed mode
          java.vm.name = OpenJDK 64-Bit Server VM
          java.vm.specification.name = Java Virtual Machine Specification
          java.vm.specification.vendor = Oracle Corporation
          java.vm.specification.version = 1.7
          java.vm.vendor = Oracle Corporation
          java.vm.version = 24.95-b01
          line.separator = \n 
          os.arch = amd64
          os.name = Linux
          os.version = 4.2.0-30-generic
          path.separator = :
          sun.arch.data.model = 64
          sun.boot.class.path = /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar
              /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar
              /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/sunrsasign.jar
              /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar
              /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar
              /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar
              /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar
              /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jfr.jar
              /usr/lib/jvm/java-7-openjdk-amd64/jre/classes
          sun.boot.library.path = /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64
          sun.cpu.endian = little
          sun.cpu.isalist = 
          sun.desktop = gnome
          sun.io.unicode.encoding = UnicodeLittle
          sun.java.launcher = SUN_STANDARD
          sun.jnu.encoding = UTF-8
          sun.management.compiler = HotSpot 64-Bit Tiered Compilers
          sun.os.patch.level = unknown
          user.country = US
          user.dir = /home/mitch/dev/qt5.7-android-debug
          user.home = /home/mitch
          user.language = en
          user.name = mitch
          user.timezone = 
      
      java version "1.7.0_95"
      OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.15.10.1)
      OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
      

      QtService.java:

      /*
          Copyright (c) 2016, BogDan Vatra <bogdan@kde.org>
          Contact: http://www.qt.io/licensing/
      
          Commercial License Usage
          Licensees holding valid commercial Qt licenses may use this file in
          accordance with the commercial license agreement provided with the
          Software or, alternatively, in accordance with the terms contained in
          a written agreement between you and The Qt Company. For licensing terms
          and conditions see http://www.qt.io/terms-conditions. For further
          information use the contact form at http://www.qt.io/contact-us.
      
          BSD License Usage
          Alternatively, this file may be used under the BSD license as follows:
          Redistribution and use in source and binary forms, with or without
          modification, are permitted provided that the following conditions
          are met:
      
          1. Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
          2. Redistributions in binary form must reproduce the above copyright
          notice, this list of conditions and the following disclaimer in the
          documentation and/or other materials provided with the distribution.
      
          THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
          IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
          OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
          IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
          INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
          NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
          DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
          THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
          (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
          THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      */
      
      package org.qtproject.qt5.android.bindings;
      
      import android.app.Service;
      import android.content.Intent;
      import android.content.res.Configuration;
      import android.os.IBinder;
      
      public class QtService extends Service
      {
          QtServiceLoader m_loader = new QtServiceLoader(this);
      
      
          /////////////////////////// forward all notifications ////////////////////////////
          /////////////////////////// Super class calls ////////////////////////////////////
          /////////////// PLEASE DO NOT CHANGE THE FOLLOWING CODE //////////////////////////
          //////////////////////////////////////////////////////////////////////////////////
          @Override
          public void onCreate()
          {
              super.onCreate();
              m_loader.onCreate();
          }
          //---------------------------------------------------------------------------
      
          @Override
          public void onDestroy()
          {
              super.onDestroy();
              QtApplication.invokeDelegate();
          }
          //---------------------------------------------------------------------------
      
          @Override
          public IBinder onBind(Intent intent)
          {
              QtApplication.InvokeResult res = QtApplication.invokeDelegate(intent);
              if (res.invoked)
                  return (IBinder)res.methodReturns;
              else
                  return null;
          }
          //---------------------------------------------------------------------------
      
          @Override
          public void onConfigurationChanged(Configuration newConfig)
          {
              if (!QtApplication.invokeDelegate(newConfig).invoked)
                  super.onConfigurationChanged(newConfig);
          }
          public void super_onConfigurationChanged(Configuration newConfig)
          {
              super.onConfigurationChanged(newConfig);
          }
          //---------------------------------------------------------------------------
      
          @Override
          public void onLowMemory()
          {
              if (!QtApplication.invokeDelegate().invoked)
                  super.onLowMemory();
          }
          //---------------------------------------------------------------------------
      
          @Override
          public int onStartCommand(Intent intent, int flags, int startId)
          {
              QtApplication.InvokeResult res = QtApplication.invokeDelegate(intent, flags, startId);
              if (res.invoked)
                  return (int) res.methodReturns;
              else
                  return super.onStartCommand(intent, flags, startId);
          }
          public int super_onStartCommand(Intent intent, int flags, int startId)
          {
              return super.onStartCommand(intent, flags, startId);
          }
          //---------------------------------------------------------------------------
      
          @Override
          public void onTaskRemoved(Intent rootIntent)
          {
              if (!QtApplication.invokeDelegate(rootIntent).invoked)
                  super.onTaskRemoved(rootIntent);
          }
          public void super_onTaskRemoved(Intent rootIntent)
          {
              super.onTaskRemoved(rootIntent);
          }
          //---------------------------------------------------------------------------
      
          @Override
          public void onTrimMemory(int level)
          {
              if (!QtApplication.invokeDelegate(level).invoked)
                  super.onTrimMemory(level);
          }
          public void super_onTrimMemory(int level)
          {
              super.onTrimMemory(level);
          }
          //---------------------------------------------------------------------------
      
          @Override
          public boolean onUnbind(Intent intent)
          {
              QtApplication.InvokeResult res = QtApplication.invokeDelegate(intent);
              if (res.invoked)
                  return (boolean) res.methodReturns;
              else
                  return super.onUnbind(intent);
          }
          public boolean super_onUnbind(Intent intent)
          {
              return super.onUnbind(intent);
          }
          //---------------------------------------------------------------------------
      }
      

      Attachments

        Activity

          People

            taipan BogDan Vatra
            mitch_curtis Mitch Curtis
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: