0

我有一个类似的问题

我在终端上输入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>

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

有谁能够帮我?

4

2 回答 2

2

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

于 2013-08-22T08:26:25.027 回答
0

将你的.jar库移动到./android/lib/然后从Project Properties-> Java Build Bath-> Libraries-> Add JARs from the ./android/lib/文件夹中添加.jar将解决问题。

谢谢。

于 2014-12-05T08:05:59.490 回答