包装时钛金属android模块错误

时间:2013-08-21 22:20:47

标签: android ant titanium appcelerator titanium-modules

我遇到与this

类似的问题

我在终端中输入了ant命令,其中模块路径是,结果是

Buildfile: /Users/casanostra/Desktop/titanium/deezer-android-module/build.xml

python.set.exec:

python.check:
     [echo] Testing for Python
     [exec] Python 2.7.2

init:

process.annotations:
    [javac] Compiling 3 source files to /Users/casanostra/Desktop/titanium/deezer-android-module/build/classes
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
    [javac] Note: [KrollBindingGen] Running Kroll binding generator.
    [javac] Note: [KrollBindingGen] Succesfully loaded existing binding data: /Users/casanostra/Desktop/titanium/deezer-android-module/build/generated/json/org/appcelerator/titanium/bindings/deezer-android-module.json
    [javac] Note: [KrollBindingGen] Found binding for module DeezerAndroidModule
    [javac] Note: [KrollBindingGen] Found binding for proxy Example
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/DeezerAndroidModuleModule.java:23: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.*;
    [javac] ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/DeezerAndroidModuleModule.java:49: error: cannot find symbol
    [javac]     private DeezerConnect deezerConnect = new DeezerConnectImpl( APP_ID );
    [javac]             ^
    [javac]   symbol:   class DeezerConnect
    [javac]   location: class DeezerAndroidModuleModule
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:8: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.DeezerConnect;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:9: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.DeezerError;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:10: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.DeezerRequest;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:11: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.DialogError;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:12: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.DialogListener;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:13: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.OAuthException;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:15: error: cannot find symbol
    [javac]  class MyDialogHandler implements DialogListener {
    [javac]                                   ^
    [javac]   symbol: class DialogListener
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:16: error: cannot find symbol
    [javac]      private DeezerConnect deezerConnect;
    [javac]              ^
    [javac]   symbol:   class DeezerConnect
    [javac]   location: class MyDialogHandler
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:17: error: cannot find symbol
    [javac]      public MyDialogHandler(DeezerConnect deezerConnect){
    [javac]                             ^
    [javac]   symbol:   class DeezerConnect
    [javac]   location: class MyDialogHandler
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:27: error: cannot find symbol
    [javac]     public void onDeezerError(final DeezerError deezerError) {
    [javac]                                     ^
    [javac]   symbol:   class DeezerError
    [javac]   location: class MyDialogHandler
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:32: error: cannot find symbol
    [javac]     public void onError(final DialogError dialogError) {
    [javac]                               ^
    [javac]   symbol:   class DialogError
    [javac]   location: class MyDialogHandler
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:42: error: cannot find symbol
    [javac]     public void onOAuthException(OAuthException oAuthException) {
    [javac]                                  ^
    [javac]   symbol:   class OAuthException
    [javac]   location: class MyDialogHandler
    [javac] Note: [KrollBindingGen] Generating JSON: file:/Users/casanostra/Desktop/titanium/deezer-android-module/build/generated/json/org/appcelerator/titanium/bindings/deezer-android-module.json
    [javac] warning: The following options were not recognized by any processor: '[kroll.checkTiContext]'
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/DeezerAndroidModuleModule.java:23: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.*;
    [javac] ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/DeezerAndroidModuleModule.java:49: error: cannot find symbol
    [javac]     private DeezerConnect deezerConnect = new DeezerConnectImpl( APP_ID );
    [javac]             ^
    [javac]   symbol:   class DeezerConnect
    [javac]   location: class DeezerAndroidModuleModule
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:8: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.DeezerConnect;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:9: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.DeezerError;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:10: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.DeezerRequest;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:11: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.DialogError;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:12: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.DialogListener;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:13: error: package com.deezer.sdk does not exist
    [javac] import com.deezer.sdk.OAuthException;
    [javac]                      ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:15: error: cannot find symbol
    [javac]  class MyDialogHandler implements DialogListener {
    [javac]                                   ^
    [javac]   symbol: class DialogListener
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:16: error: cannot find symbol
    [javac]      private DeezerConnect deezerConnect;
    [javac]              ^
    [javac]   symbol:   class DeezerConnect
    [javac]   location: class MyDialogHandler
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:17: error: cannot find symbol
    [javac]      public MyDialogHandler(DeezerConnect deezerConnect){
    [javac]                             ^
    [javac]   symbol:   class DeezerConnect
    [javac]   location: class MyDialogHandler
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:27: error: cannot find symbol
    [javac]     public void onDeezerError(final DeezerError deezerError) {
    [javac]                                     ^
    [javac]   symbol:   class DeezerError
    [javac]   location: class MyDialogHandler
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:32: error: cannot find symbol
    [javac]     public void onError(final DialogError dialogError) {
    [javac]                               ^
    [javac]   symbol:   class DialogError
    [javac]   location: class MyDialogHandler
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:42: error: cannot find symbol
    [javac]     public void onOAuthException(OAuthException oAuthException) {
    [javac]                                  ^
    [javac]   symbol:   class OAuthException
    [javac]   location: class MyDialogHandler
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/DeezerAndroidModuleModule.java:49: error: cannot find symbol
    [javac]     private DeezerConnect deezerConnect = new DeezerConnectImpl( APP_ID );
    [javac]                                               ^
    [javac]   symbol:   class DeezerConnectImpl
    [javac]   location: class DeezerAndroidModuleModule
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/DeezerAndroidModuleModule.java:79: error: cannot find symbol
    [javac]         DeezerRequest request = new DeezerRequest( "/user/me" );
    [javac]         ^
    [javac]   symbol:   class DeezerRequest
    [javac]   location: class DeezerAndroidModuleModule
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/DeezerAndroidModuleModule.java:79: error: cannot find symbol
    [javac]         DeezerRequest request = new DeezerRequest( "/user/me" );
    [javac]                                     ^
    [javac]   symbol:   class DeezerRequest
    [javac]   location: class DeezerAndroidModuleModule
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/DeezerAndroidModuleModule.java:90: error: cannot find symbol
    [javac]         catch (OAuthException e) {
    [javac]                ^
    [javac]   symbol:   class OAuthException
    [javac]   location: class DeezerAndroidModuleModule
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/DeezerAndroidModuleModule.java:93: error: cannot find symbol
    [javac]         } catch (DeezerError e) {
    [javac]                  ^
    [javac]   symbol:   class DeezerError
    [javac]   location: class DeezerAndroidModuleModule
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:21: error: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:26: error: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:31: error: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:36: error: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/MyDialogHandler.java:41: error: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] Note: /Users/casanostra/Desktop/titanium/deezer-android-module/src/com/deezer/android/ExampleProxy.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 24 errors
    [javac] 1 warning

BUILD FAILED
/Users/casanostra/Library/Application Support/Titanium/mobilesdk/osx/3.1.1.GA/module/android/build.xml:163: Compile failed; see the compiler error output for details.

在为我的钛项目打包模块时,控制台输出正在显示

Compile failed; see the compiler error output for details. You may need to install the Command Line Tools package through XCode, in case you haven't done so yet.

当然我安装了命令行工具包。 它似乎没有抓住我通过eclipse导入的deezer库。

ndk路径是正确的。

我的build.properties包含以下行

titanium.platform=/Users/casanostra/Library/Application Support/Titanium/mobilesdk/osx/3.1.1.GA/android
android.platform=/Users/casanostra/Documents/android/platforms/android-8
google.apis=/Users/casanostra/Documents/android/add-ons/addon-google_apis-google-8

这些路径是纠正的。我甚至尝试用相同的结果更改为android-10和google apis 10.

最后是我的.classpath文件

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" path="build/.apt_generated"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="lib" path="/Users/casanostra/Documents/android/platforms/android-10/android.jar"/>
    <classpathentry kind="lib" path="/Users/casanostra/Documents/android/add-ons/addon-google_apis-google-10/libs/maps.jar"/>
    <classpathentry kind="lib" path="/Users/casanostra/Library/Application Support/Titanium/mobilesdk/osx/3.1.1.GA/android/titanium.jar"/>
    <classpathentry kind="lib" path="/Users/casanostra/Library/Application Support/Titanium/mobilesdk/osx/3.1.1.GA/android/kroll-common.jar"/>
    <classpathentry kind="lib" path="/Users/casanostra/Library/Application Support/Titanium/mobilesdk/osx/3.1.1.GA/android/kroll-apt.jar"/>
    <classpathentry kind="src" path=".apt_generated">
        <attributes>
            <attribute name="optional" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="lib" path="/Users/casanostra/Downloads/deezer-android-sdk-0.9.3-v00201005/deezer-sdk-0.9.3.jar"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

我还尝试在构建项目之前清理项目并删除构建文件夹。

任何人都可以帮助我吗?

2 个答案:

答案 0 :(得分:2)

删除未使用的imports后将问题解决,然后将我的外部(deezer)库复制到lib文件夹。

答案 1 :(得分:0)

.jar 库移至 ./ android / lib / ,然后从项目属性 - >添加 .jar 。 Java Build Bath-&gt; Libraries-&GT;从 ./ android / lib / 文件夹中添加JAR 将解决问题。

感谢。