无法找到Android的库文件类文件、Android

由网友(百思不得骑姐)分享简介:我创建了一个非常简单的Andr​​oid应用程序只与功能工作。在应用我想调用Web服务客户端来检索和显示一些数据。我的认为的我已经成功地导入并引用的jar文件(即库)。这似乎是成功的实例化类,但时类的jar /库中引用其他类,它抛出一个的未找到类的错误。有任何想法吗???还有什么我可以提供帮助的答案??? 下面是我的c...

我创建了一个非常简单的Andr​​oid应用程序只与功能工作。在应用我想调用Web服务客户端来检索和显示一些数据。我的认为的我已经成功地导入并引用的jar文件(即库)。这似乎是成功的实例化类,但时类的jar /库中引用其他类,它抛出一个的未找到类的错误。有任何想法吗???还有什么我可以提供帮助的答案???

下面是我的code:

 包mhcs.android.ehd;进口mhcs.services.client.EHD.EHDClient;进口android.app.Activity;进口android.os.Bundle;进口android.view.View;进口android.widget.Button;进口android.widget.EditText;进口android.widget.Toast;公共类GetTicketDescription延伸活动{    / **当第一次创建活动调用。 * /    @覆盖    公共无效的onCreate(捆绑savedInstanceState){        EHDClient客户端=新EHDClient();        super.onCreate(savedInstanceState);        的setContentView(R.layout.main);        字符串title =的getString(R.string.title);        的setTitle(职称); //这样做,我们可以更改默认的标题        //获取手柄EDITTEXT和按钮控件        最终的EditText ETEXT =(EditText上)findViewById(R.id.editText1);        最后Button按钮=(按钮)findViewById(R.id.button1);        eText.setText(client.getTicketDescription(MMLZ-8LVRMK));        button.setOnClickListener(新Button.OnClickListener(){            @覆盖            公共无效的onClick(视图v){                //获取进入EDITTEXT插件的字符串                CharSequence的EDITTEXT = eText.getText();                //显示敬酒                Toast.makeText(GetTicketDescription.this,EDITTEXT,Toast.LENGTH_LONG).show();            }        });    }} 

以下是错误:

  D / dalvikvm(538):不晚启用CheckJNI(已上)I / dalvikvm(538):主题ID = 3:反应以信号3I / dalvikvm(538):写的堆栈跟踪到/data/anr/traces.txtW / dalvikvm(538):无法解析Lorg / tempuri / EHDLookupService的超类; (73)W / dalvikvm(538)类的链接Lorg / tempuri / EHDLookupService;'失败的E / dalvikvm(538):找不到类的org.tempuri.EHDLookupService,从法mhcs.services.client.EHD.EHDClient引用<初始化方式>W / dalvikvm(538):VFY:无法解析新实例93(Lorg / tempuri / EHDLookupService;)在Lmhcs /服务/客户/ EHD / EHDClient;D / dalvikvm(538):VFY:在更换运code 0x22为0x0003W / dalvikvm(538):无法解析Lorg / tempuri / EHDLookupService的超类; (73)W / dalvikvm(538)类的链接Lorg / tempuri / EHDLookupService;'失败的W / dalvikvm(538):无法解析Lorg / tempuri / EHDLookupService的超类; (73)W / dalvikvm(538)类的链接Lorg / tempuri / EHDLookupService;'失败的I / dalvikvm(538):找不到方法org.tempuri.EHDLookupService.getBasicHttpBindingIEHDLookupService,从方法mhcs.services.client.EHD.EHDClient引用<初始化方式>W / dalvikvm(538):VFY:无法解析虚方法112:Lorg / tempuri / EHDLookupService; .getBasicHttpBindingIEHDLookupService()Lorg / tempuri / IEHDLookupService;D / dalvikvm(538):VFY:更换运在0x001c code 0x6eW / dalvikvm(538):VFY:找不到签名中引用的类(Ljavax / XML /绑定/ JAXBElement的;)I / dalvikvm(538):找不到方法javax.xml.bind.JAXBElement.getValue,从方法mhcs.services.client.EHD.EHDClient.getAssigneeTickets引用W / dalvikvm(538):VFY:无法解析虚方法42:Ljavax / XML /绑定/ JAXBElement的; .getValue()Ljava /郎/对象;D / dalvikvm(538):VFY:在更换运code 0x6e 0x0026W / dalvikvm(538):VFY:找不到签名中引用的类(Ljavax / XML /绑定/ JAXBElement的;)I / dalvikvm(538):找不到方法javax.xml.bind.JAXBElement.getValue,从方法mhcs.services.client.EHD.EHDClient.getTicketDescription引用W / dalvikvm(538):VFY:无法解析虚方法42:Ljavax / XML /绑定/ JAXBElement的; .getValue()Ljava /郎/对象;D / dalvikvm(538):VFY:更换运在0x000b code 0x6eW / dalvikvm(538):无法解析Lorg / tempuri / EHDLookupService的超类; (73)W / dalvikvm(538)类的链接Lorg / tempuri / EHDLookupService;'失败的D / dalvikvm(538):DexOpt:无法在Lmhcs /服务/客户/ EHD / EHDClient为0x15,以选择直接调用0x006b;<&初始化GT;D / AndroidRuntime(538):关闭VMW / dalvikvm(538):主题ID = 1:螺纹未捕获的异常(组= 0x409c01f8)退出E / AndroidRuntime(538):致命异常:主要E / AndroidRuntime(538):java.lang.NoClassDefFoundError的:org.tempuri.EHDLookupServiceE / AndroidRuntime(538):在mhcs.services.client.EHD.EHDClient<&初始化GT;(EHDClient.java:25)。E / AndroidRuntime(538):在mhcs.android.ehd.GetTicketDescription.onCreate(GetTicketDescription.java:15)E / AndroidRuntime(538):在android.app.Activity.performCreate(Activity.java:4465)E / AndroidRuntime(538):在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)E / AndroidRuntime(538):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)E / AndroidRuntime(538):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)E / AndroidRuntime(538):在android.app.ActivityThread.access $ 600(ActivityThread.java:123)E / AndroidRuntime(538):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1147)E / AndroidRuntime(538):在android.os.Handler.dispatchMessage(Handler.java:99)E / AndroidRuntime(538):在android.os.Looper.loop(Looper.java:137)E / AndroidRuntime(538):在android.app.ActivityThread.main(ActivityThread.java:4424)E / AndroidRuntime(538):在java.lang.reflect.Method.invokeNative(本机方法)E / AndroidRuntime(538):在java.lang.reflect.Method.invoke(Method.java:511)E / AndroidRuntime(538):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:784)E / AndroidRuntime(538):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)E / AndroidRuntime(538):在dalvik.system.NativeStart.main(本机方法)I / dalvikvm(538):主题ID = 3:反应以信号3I / dalvikvm(538):写的堆栈跟踪到/data/anr/traces.txt 
android studio生成的apk文件无法安装

请注意:我理解这个问题组织/ tempuri并纠正

(因为我是一个新用户不能发布我的工作区的图片)

解决方案 找到的属性的 - > Java构建路径的 - > 订单和出口的更改的 Android的依赖的顺序

I have created a very simple Android app just to work with functionality. Within the app I would like to call a web service client to retrieve and display some data. I think I have succesfully imported and referenced the jar file (i.e. library). It appears to be instantiating the class successfully but when that class is referencing another class within the jar/library it throws a class not found error. Any ideas??? Anything else I can provide to help answer???

Here is my code:

package mhcs.android.ehd;

import mhcs.services.client.EHD.EHDClient;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class GetTicketDescription extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        EHDClient client = new EHDClient();
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        String title = getString(R.string.title);
        setTitle(title); // done so that we can change the default title
        //get handles to editText and button widgets
        final EditText eText = (EditText) findViewById(R.id.editText1);
        final Button button = (Button) findViewById(R.id.button1);
        eText.setText(client.getTicketDescription("MMLZ-8LVRMK"));

        button.setOnClickListener(new Button.OnClickListener(){
            @Override
            public void onClick(View v) {
                //get the String entered into the editText widget
                CharSequence editText = eText.getText();
                //display the toast
                Toast.makeText(GetTicketDescription.this, editText, Toast.LENGTH_LONG).show();
            }
        });
    }
}

Here is the error:

D/dalvikvm(538): Not late-enabling CheckJNI (already on)
I/dalvikvm(538): threadid=3: reacting to signal 3
I/dalvikvm(538): Wrote stack traces to '/data/anr/traces.txt'
W/dalvikvm(538): Unable to resolve superclass of Lorg/tempuri/EHDLookupService; (73)
W/dalvikvm(538): Link of class 'Lorg/tempuri/EHDLookupService;' failed
E/dalvikvm(538): Could not find class 'org.tempuri.EHDLookupService', referenced from method mhcs.services.client.EHD.EHDClient.<init>
W/dalvikvm(538): VFY: unable to resolve new-instance 93 (Lorg/tempuri/EHDLookupService;) in Lmhcs/services/client/EHD/EHDClient;
D/dalvikvm(538): VFY: replacing opcode 0x22 at 0x0003
W/dalvikvm(538): Unable to resolve superclass of Lorg/tempuri/EHDLookupService; (73)
W/dalvikvm(538): Link of class 'Lorg/tempuri/EHDLookupService;' failed
W/dalvikvm(538): Unable to resolve superclass of Lorg/tempuri/EHDLookupService; (73)
W/dalvikvm(538): Link of class 'Lorg/tempuri/EHDLookupService;' failed
I/dalvikvm(538): Could not find method org.tempuri.EHDLookupService.getBasicHttpBindingIEHDLookupService, referenced from method mhcs.services.client.EHD.EHDClient.<init>
W/dalvikvm(538): VFY: unable to resolve virtual method 112: Lorg/tempuri/EHDLookupService;.getBasicHttpBindingIEHDLookupService ()Lorg/tempuri/IEHDLookupService;
D/dalvikvm(538): VFY: replacing opcode 0x6e at 0x001c
W/dalvikvm(538): VFY: unable to find class referenced in signature (Ljavax/xml/bind/JAXBElement;)
I/dalvikvm(538): Could not find method javax.xml.bind.JAXBElement.getValue, referenced from method mhcs.services.client.EHD.EHDClient.getAssigneeTickets
W/dalvikvm(538): VFY: unable to resolve virtual method 42: Ljavax/xml/bind/JAXBElement;.getValue ()Ljava/lang/Object;
D/dalvikvm(538): VFY: replacing opcode 0x6e at 0x0026
W/dalvikvm(538): VFY: unable to find class referenced in signature (Ljavax/xml/bind/JAXBElement;)
I/dalvikvm(538): Could not find method javax.xml.bind.JAXBElement.getValue, referenced from method mhcs.services.client.EHD.EHDClient.getTicketDescription
W/dalvikvm(538): VFY: unable to resolve virtual method 42: Ljavax/xml/bind/JAXBElement;.getValue ()Ljava/lang/Object;
D/dalvikvm(538): VFY: replacing opcode 0x6e at 0x000b
W/dalvikvm(538): Unable to resolve superclass of Lorg/tempuri/EHDLookupService; (73)
W/dalvikvm(538): Link of class 'Lorg/tempuri/EHDLookupService;' failed
D/dalvikvm(538): DexOpt: unable to opt direct call 0x006b at 0x15 in Lmhcs/services/client/EHD/EHDClient;.<init>
D/AndroidRuntime(538): Shutting down VM
W/dalvikvm(538): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)

E/AndroidRuntime(538): FATAL EXCEPTION: main
E/AndroidRuntime(538): java.lang.NoClassDefFoundError: org.tempuri.EHDLookupService
E/AndroidRuntime(538):      at mhcs.services.client.EHD.EHDClient.<init>(EHDClient.java:25)
E/AndroidRuntime(538):      at mhcs.android.ehd.GetTicketDescription.onCreate(GetTicketDescription.java:15)
E/AndroidRuntime(538):      at android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime(538):      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
E/AndroidRuntime(538):      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
E/AndroidRuntime(538):      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
E/AndroidRuntime(538):      at android.app.ActivityThread.access$600(ActivityThread.java:123)
E/AndroidRuntime(538):      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
E/AndroidRuntime(538):      at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(538):      at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(538):      at android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime(538):      at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(538):      at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(538):      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime(538):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime(538):      at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm(538): threadid=3: reacting to signal 3
I/dalvikvm(538): Wrote stack traces to '/data/anr/traces.txt'

Note: I understand the issue with org/tempuri and will correct.

(Can't post image of my workspace as I am a new user)

解决方案

Find Properties -> Java Build Path -> Order and Export Change Android Dependencies order

阅读全文

相关推荐

最新文章