2012-12-03 28 views
0

我对他们接收到错误客户告知。在报告中,他们提交的是时间可持续未来与NoClassDefFoundError错误。看来我的其他客户都没有遇到这个问题。我没有在我的Motorola Droid Maxx上运行该应用程序的问题。客户正在根植Droid Bionic上运行该应用程序。在2.3版本中,我的版本一切正常,但是当我将它更新到2.4时,出现了这个问题。我也用新的替换了我的电脑,现在我正在运行Windows 8并安装了adt软件包。我改变> -90到> -85时,对有问题的文件做的唯一更改。以下是代码...我还在代码下面包含了错误报告。这只发生在手机上。的NoClassDefFoundError与新的Eclipse包

import android.app.Activity; 
import android.content.Context; 
import android.content.Intent; 
import android.net.ConnectivityManager; 
import android.net.NetworkInfo; 
import android.os.Bundle; 
import android.telephony.PhoneStateListener; 
import android.telephony.SignalStrength; 
import android.telephony.TelephonyManager; 


public class ConnectivityCheck extends Activity { 

    TelephonyManager  Tel; 
    MyPhoneStateListener MyListener; 
    boolean isGsm; 
    boolean cellAvailable; 
int strengthAmplitudeGSM; 
int strengthAmplitudeCDMA; 


@Override 
public void onCreate(Bundle icicle) { 
    super.onCreate(icicle);   

    ConnectivityManager connec = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); 

    if (connec.getNetworkInfo(0) != null) 
    { 
     cellAvailable = true; 
    } 

    if (cellAvailable) 
    { 
    /* Update the listener, and start it */ 
     MyListener = new MyPhoneStateListener(); 
     Tel = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); 
     Tel.listen(MyListener ,PhoneStateListener.LISTEN_SIGNAL_STRENGTHS); 
    } 

if (connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED) 
    { 
     startActivity(new Intent(ConnectivityCheck.this, LicenseCheck.class)); 
     if (cellAvailable) 
     { 
     Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); 
     } 
     finish(); 
    } 
    else if (cellAvailable) 
    { 
    if (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED && strengthAmplitudeCDMA >= -90) 
    { 
     startActivity(new Intent(ConnectivityCheck.this, LicenseCheck.class)); 
     Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); 
     finish(); 
    } 
    else if (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED && isGsm && strengthAmplitudeGSM >= 10 && strengthAmplitudeGSM <= 31) 
    { 
     startActivity(new Intent(ConnectivityCheck.this, LicenseCheck.class)); 
     Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); 
     finish(); 
    } 
    else 
    { 

     startActivity(new Intent(ConnectivityCheck.this, ProtocolsMMenuActivity.class)); 
     Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); 
     finish(); 
    } 
    } 
    else 
    { 
     startActivity(new Intent(ConnectivityCheck.this, ProtocolsMMenuActivity.class)); 
     if (cellAvailable) 
     { 
     Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); 
     } 
    finish(); 
    } 

} 

/* Called when the application is minimized */ 
    @Override 
    protected void onPause() 
    { 
     super.onPause(); 
      if (cellAvailable) 
     { 
     Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); 
     } 
    } 

    /* Called when the application resumes */ 
    @Override 
    protected void onResume() 
    { 
     super.onResume(); 
     if (cellAvailable) 
     { 
     Tel.listen(MyListener, PhoneStateListener.LISTEN_SIGNAL_STRENGTHS); 
     } 
     } 


    /* Start the PhoneState listener */ 
    private class MyPhoneStateListener extends PhoneStateListener 
    { 
     /* Get the Signal strength from the provider, each tiome there is an update */ 
     @Override 
     public void onSignalStrengthsChanged(SignalStrength signalStrength) 
     { 


    isGsm = signalStrength.isGsm(); 
    strengthAmplitudeGSM = signalStrength.getGsmSignalStrength(); 
    strengthAmplitudeCDMA = signalStrength.getCdmaDbm(); 

    super.onSignalStrengthsChanged(signalStrength); 
} 
};/* End of private Class */ 
} 

以下是错误报告

java.lang.NoClassDefFoundError: com.emsprotocols.njalsprotocolspaidac.ConnectivityCheck 
at com.emsprotocols.njalsprotocolspaidac.ProtocolsSplashActivity$1.onAnimationEnd  (ProtocolsSplashActivity.java:144) 
at android.view.animation.AnimationSet.getTransformation(AnimationSet.java:411) 
at android.view.animation.Animation.getTransformation(Animation.java:920) 
at android.view.ViewGroup.drawChild(ViewGroup.java:2657) 
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489) 
at android.view.ViewGroup.drawChild(ViewGroup.java:2885) 
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489) 
at android.view.ViewGroup.drawChild(ViewGroup.java:2885) 
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489) 
at android.view.View.draw(View.java:11009) 
at android.widget.FrameLayout.draw(FrameLayout.java:450) 
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2154) 
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2096) 
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1679) 
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2558) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:137) 
at android.app.ActivityThread.main(ActivityThread.java:4722) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:511) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554) 
at dalvik.system.NativeStart.main(Native Method) 

回答

1

这与SDK工具的R21版本的通病。进入你的项目设置,然后进入Java Build Path。如果展开“Android的相关性”,你会看到,现在有一些你的.jar文件从你的libs文件夹重复。

取下顶层只留下那些在Android依赖文件夹的任何重复。然后做一个干净的项目,你应该很好再次去。

+0

我这样做,有没有重复。当我第一次将应用程序导入到新的eclipse中时,我删除了原来使用的许可证库,并将其重新添加到新的正确路径中。 – djmedic

+0

嗯,是固定我的问题很抱歉。我确实必须完全删除一个项目并重新添加它。然而,这可能不会帮助你,因为你只是将它添加到新的Eclipse安装。 – drspaceboo

相关问题