你好,我是特林將程序的應用程序,用於與Glympse API,但每一次我嘗試使用createGlymspe函數創建Glympse例子中,我得到這個錯誤時間的Android誤差LiteFactory.createGlympse()(安卓)
08-21 11:10:47.014: E/AndroidRuntime(22391): FATAL EXCEPTION: main
08-21 11:10:47.014: E/AndroidRuntime(22391): java.lang.ExceptionInInitializerError
08-21 11:10:47.014: E/AndroidRuntime(22391): at com.glympse.android.hal.l.<init>(ContextHolder.java:29)
08-21 11:10:47.014: E/AndroidRuntime(22391): at com.glympse.android.hal.bd.l(HalFactory.java:23)
08-21 11:10:47.014: E/AndroidRuntime(22391): at com.glympse.android.a.gz.a(LibFactory.java:35)
08-21 11:10:47.014: E/AndroidRuntime(22391): at com.glympse.android.api.ad.a(GlympseFactory.java:72)
08-21 11:10:47.014: E/AndroidRuntime(22391): at com.glympse.android.api.ad.a(GlympseFactory.java:54)
08-21 11:10:47.014: E/AndroidRuntime(22391): at com.glympse.android.lite.LiteFactory.createGlympse(LiteFactory.java:42)
08-21 11:10:47.014: E/AndroidRuntime(22391): at pcr.test02.MainActivity$1.onClick(MainActivity.java:27)
08-21 11:10:47.014: E/AndroidRuntime(22391): at android.view.View.performClick(View.java:3558)
08-21 11:10:47.014: E/AndroidRuntime(22391): at android.view.View$PerformClick.run(View.java:14157)
08-21 11:10:47.014: E/AndroidRuntime(22391): at android.os.Handler.handleCallback(Handler.java:605)
08-21 11:10:47.014: E/AndroidRuntime(22391): at android.os.Handler.dispatchMessage(Handler.java:92)
08-21 11:10:47.014: E/AndroidRuntime(22391): at android.os.Looper.loop(Looper.java:137)
08-21 11:10:47.014: E/AndroidRuntime(22391): at android.app.ActivityThread.main(ActivityThread.java:4514)
08-21 11:10:47.014: E/AndroidRuntime(22391): at java.lang.reflect.Method.invokeNative(Native Method)
08-21 11:10:47.014: E/AndroidRuntime(22391): at java.lang.reflect.Method.invoke(Method.java:511)
08-21 11:10:47.014: E/AndroidRuntime(22391): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
08-21 11:10:47.014: E/AndroidRuntime(22391): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
08-21 11:10:47.014: E/AndroidRuntime(22391): at dalvik.system.NativeStart.main(Native Method)
08-21 11:10:47.014: E/AndroidRuntime(22391): Caused by: java.lang.NoClassDefFoundError: com.glympse.android.api.R$drawable
08-21 11:10:47.014: E/AndroidRuntime(22391): at com.glympse.android.hal.db.<clinit>(ResourceGateway.java:13)
08-21 11:10:47.014: E/AndroidRuntime(22391): ... 18 more
下面是代碼:
package pcr.test02;
import com.glympse.android.lite.GGlympseLite;
import com.glympse.android.lite.LiteFactory;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends Activity {
GGlympseLite glympse;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
glympse = LiteFactory.createGlympse(getBaseContext(), "sandbox.glympse.com", "I will not share my key ;-)");
Button btn1 = (Button) findViewById(R.id.button1);
btn1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Toast.makeText(getApplicationContext(), "Glymp",
Toast.LENGTH_LONG).show();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
我不知道,如果問題是上下文,但我試着去改變它「這個」,但它並沒有幫助
我alrady試過,但正如我在Eclipse工作臺導入GlympseApiLite項目中,我得到這個錯誤在控制檯:「[2013年8月22日18時44分48秒 - GlympseApi]無法解決目標'android-17' [2013-08-22 18:44:48 - GlympseApi]無法解析目標'android-17'' – user2702899
[2013-08-22 18:45:23 - Test003] Found 2版本的依賴列表中的android-support-v4.jar,但不是所有的版本都是相同的(僅在此時檢查是基於SHA-1的)。 [2013-08-22 18:45:23 - Test003]目前所有版本的庫必須相同。 [2013-08-22 18:45:23 - Test003]發現的版本有: – user2702899
[2013-08-22 18:45:23 - Test003]路徑:C:\ Users \ Gioele \ workspace-androidNew \ Test003 \ libs \機器人支撐-v4.jar [2013年8月22日18時45分23秒 - Test003] \t長度:556198 [2013年8月22日18時45分23秒 - Test003] \t SHA-1:4a6be13368bb64c5a0b0460632d228a1a915f58f [ 2013-08-22 18:45:23 - Test003]路徑:C:\ Android \ Glympse \ lib \ GlympseApiLite \ libs \ android-support-v4.jar [2013-08-22 18:45:23 - Test003] \t Length:393154 [2013-08-22 18:45:23 - Test003] \t SHA-1:307c1cc532eabbf1d135b43e5c983c9da700449d [2013-08-22 18:45:23 - Test003] Jar mismatch!修復你的依賴關係 – user2702899