Android应用上传到Google Play时崩溃

huangapple 未分类评论49阅读模式
英文:

android app crashes when uploading to google play

问题

我的应用在通过Android Studio运行时工作正常,但在从Google Play商店下载并安装后崩溃。它以前工作得很好,但突然之间发生了这种情况,而没有做任何更改。以下是Google Play崩溃日志:

java.lang.NoClassDefFoundError: 
在net.sourceforge.jtds.jdbc.Support.calculateNamedPipeBufferSize (Support.java中)
在net.sourceforge.jtds.jdbc.Support.class$ (Support.java中)
在net.sourceforge.jtds.jdbc.Support.convert (Support.java中)
在net.sourceforge.jtds.jdbc.Support.convertLOB (Support.java中)
在net.sourceforge.jtds.jdbc.Support.convertLOBType (Support.java中)
在net.sourceforge.jtds.jdbc.Support.encodeString (Support.java中)
在net.sourceforge.jtds.jdbc.Support.getJdbcType (Support.java中)
在net.sourceforge.jtds.jdbc.Support.getParameterDefinitions (Support.java中)
在net.sourceforge.jtds.jdbc.Support.getStatementKey (Support.java中)
在net.sourceforge.jtds.jdbc.Support.isWindowsOS (Support.java中)
在net.sourceforge.jtds.jdbc.Support.linkException (Support.java中)
在net.sourceforge.jtds.jdbc.Support.normalizeBigDecimal (Support.java中)
在net.sourceforge.jtds.jdbc.Support.substituteParamMarkers (Support.java中)
在net.sourceforge.jtds.jdbc.Support.timeFromZone (Support.java中)
在net.sourceforge.jtds.jdbc.Support.toHex (Support.java中)
在net.sourceforge.jtds.jdbc.Support.<clinit> (Support.java中)
在net.sourceforge.jtds.jdbc.Support.calculateNamedPipeBufferSize (Support.java中)
在net.sourceforge.jtds.jdbc.Support.class$ (Support.java中)
在net.sourceforge.jtds.jdbc.Support.convert (Support.java中)
在net.sourceforge.jtds.jdbc.Support.convertLOB (Support.java中)
在net.sourceforge.jtds.jdbc.Support.convertLOBType (Support.java中)
在net.sourceforge.jtds.jdbc.Support.encodeString (Support.java中)
在net.sourceforge.jtds.jdbc.Support.getJdbcType (Support.java中)
在net.sourceforge.jtds.jdbc.Support.getParameterDefinitions (Support.java中)
在net.sourceforge.jtds.jdbc.Support.getStatementKey (Support.java中)
在net.sourceforge.jtds.jdbc.Support.isWindowsOS (Support.java中)
在net.sourceforge.jtds.jdbc.Support.linkException (Support.java中)
在net.sourceforge.jtds.jdbc.Support.normalizeBigDecimal (Support.java中)
在net.sourceforge.jtds.jdbc.Support.substituteParamMarkers (Support.java中)
在net.sourceforge.jtds.jdbc.Support.timeFromZone (Support.java中)
在net.sourceforge.jtds.jdbc.Support.toHex (Support.java中)
在net.sourceforge.jtds.jdbc.ConnectionJDBC2.addStatement (ConnectionJDBC2.java中)
在net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkLocal (ConnectionJDBC2.java中)
在net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkOpen (ConnectionJDBC2.java中)
在net.sourceforge.jtds.jdbc.ConnectionJDBC2.getSybaseInfo (ConnectionJDBC2.java中)
在net.sourceforge.jtds.jdbc.ConnectionJDBC2.parseBooleanProperty (ConnectionJDBC2.java中)
在net.sourceforge.jtds.jdbc.ConnectionJDBC2.setCollation (ConnectionJDBC2.java中)
在net.sourceforge.jtds.jdbc.TdsCore.z (TdsCore.java中)
在net.sourceforge.jtds.jdbc.TdsCore.nextToken (TdsCore.java:4)
在net.sourceforge.jtds.jdbc.TdsCore.login (TdsCore.java:43)
在net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init> (ConnectionJDBC2.java:16)
在net.sourceforge.jtds.jdbc.Driver.connect (Driver.java:2)
在java.sql.DriverManager.getConnection (DriverManager.java:569)
在java.sql.DriverManager.getConnection (DriverManager.java:219)
在info.xyz.yourapplication2.ConnectSQL.Run (ConnectSQL.java中)
在info.xyz.yourapplication2.ConnectSQL.connectionclass (ConnectSQL.java中)
在info.xyz.yourapplication2.getproducttype.a (getproducttype.java中)
在info.xyz.yourapplication2.MainActivity.onCreate (MainActivity.java:5)
在android.app.Activity.performCreate (Activity.java:6942)
在android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1126)
在android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2880)
在android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2988)
在android.app.ActivityThread.-wrap14 (ActivityThread.java)
在android.app.ActivityThread$H.handleMessage (ActivityThread.java:1631)
在android.os.Handler.dispatchMessage (Handler.java:102)
在android.os.Looper.loop (Looper.java:154)
在android.app.ActivityThread.main (ActivityThread.java:6682)
在java.lang.reflect.Method.invoke (Method.java)
在com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1520)
在com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410)

你有什么想法是什么原因引起了这个问题?

以下是我的proguard-rules.pro文件。

# 在这里添加项目特定的ProGuard规则。
# 您可以通过在build.gradle中的proguardFiles设置中控制应用的配置文件集。
#
# 有关更多详细信息,请参见
#   http://developer.android.com/guide/developing/tools/proguard.html

# 如果您的项目使用带有JS的WebView,请取消下面的注释并指定JavaScript接口的完全限定类名。
# -keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
# }

# 取消此注释以保留用于调试堆栈跟踪的行号信息。
# -keepattributes SourceFile,LineNumberTable

# 如果保留行号信息,请取消此注释以隐藏原始源文件名。
# -renamesourcefileattribute SourceFile

提前感谢你的帮助。

英文:

My application worked well when I run it through Android Studio but it crashes when I download it from Google Play store.
It used to work well but suddenly this happened without changing anything
this is the google play crash log:

      java.lang.NoClassDefFoundError: 
      at net.sourceforge.jtds.jdbc.Support.calculateNamedPipeBufferSize (Support.java)
      at net.sourceforge.jtds.jdbc.Support.class$ (Support.java)
      at net.sourceforge.jtds.jdbc.Support.convert (Support.java)
      at net.sourceforge.jtds.jdbc.Support.convertLOB (Support.java)
      at net.sourceforge.jtds.jdbc.Support.convertLOBType (Support.java)
      at net.sourceforge.jtds.jdbc.Support.encodeString (Support.java)
      at net.sourceforge.jtds.jdbc.Support.getJdbcType (Support.java)
      at net.sourceforge.jtds.jdbc.Support.getParameterDefinitions (Support.java)
      at net.sourceforge.jtds.jdbc.Support.getStatementKey (Support.java)
      at net.sourceforge.jtds.jdbc.Support.isWindowsOS (Support.java)
      at net.sourceforge.jtds.jdbc.Support.linkException (Support.java)
      at net.sourceforge.jtds.jdbc.Support.normalizeBigDecimal (Support.java)
      at net.sourceforge.jtds.jdbc.Support.substituteParamMarkers (Support.java)
      at net.sourceforge.jtds.jdbc.Support.timeFromZone (Support.java)
      at net.sourceforge.jtds.jdbc.Support.toHex (Support.java)
      at net.sourceforge.jtds.jdbc.Support.<clinit> (Support.java)
      at net.sourceforge.jtds.jdbc.Support.calculateNamedPipeBufferSize (Support.java)
      at net.sourceforge.jtds.jdbc.Support.class$ (Support.java)
      at net.sourceforge.jtds.jdbc.Support.convert (Support.java)
      at net.sourceforge.jtds.jdbc.Support.convertLOB (Support.java)
      at net.sourceforge.jtds.jdbc.Support.convertLOBType (Support.java)
      at net.sourceforge.jtds.jdbc.Support.encodeString (Support.java)
      at net.sourceforge.jtds.jdbc.Support.getJdbcType (Support.java)
      at net.sourceforge.jtds.jdbc.Support.getParameterDefinitions (Support.java)
      at net.sourceforge.jtds.jdbc.Support.getStatementKey (Support.java)
      at net.sourceforge.jtds.jdbc.Support.isWindowsOS (Support.java)
      at net.sourceforge.jtds.jdbc.Support.linkException (Support.java)
      at net.sourceforge.jtds.jdbc.Support.normalizeBigDecimal (Support.java)
      at net.sourceforge.jtds.jdbc.Support.substituteParamMarkers (Support.java)
      at net.sourceforge.jtds.jdbc.Support.timeFromZone (Support.java)
      at net.sourceforge.jtds.jdbc.Support.toHex (Support.java)
      at net.sourceforge.jtds.jdbc.ConnectionJDBC2.addStatement (ConnectionJDBC2.java)
      at net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkLocal (ConnectionJDBC2.java)
      at net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkOpen (ConnectionJDBC2.java)
      at net.sourceforge.jtds.jdbc.ConnectionJDBC2.getSybaseInfo (ConnectionJDBC2.java)
      at net.sourceforge.jtds.jdbc.ConnectionJDBC2.parseBooleanProperty (ConnectionJDBC2.java)
      at net.sourceforge.jtds.jdbc.ConnectionJDBC2.setCollation (ConnectionJDBC2.java)
      at net.sourceforge.jtds.jdbc.TdsCore.z (TdsCore.java)
      at net.sourceforge.jtds.jdbc.TdsCore.nextToken (TdsCore.java:4)
      at net.sourceforge.jtds.jdbc.TdsCore.login (TdsCore.java:43)
      at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init> (ConnectionJDBC2.java:16)
      at net.sourceforge.jtds.jdbc.Driver.connect (Driver.java:2)
      at java.sql.DriverManager.getConnection (DriverManager.java:569)
      at java.sql.DriverManager.getConnection (DriverManager.java:219)
      at info.xyz.yourapplication2.ConnectSQL.Run (ConnectSQL.java)
      at info.xyz.yourapplication2.ConnectSQL.connectionclass (ConnectSQL.java)
      at info.xyz.yourapplication2.getproducttype.a (getproducttype.java)
      at info.xyz.yourapplication2.MainActivity.onCreate (MainActivity.java:5)
      at android.app.Activity.performCreate (Activity.java:6942)
      at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1126)
      at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2880)
      at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2988)
      at android.app.ActivityThread.-wrap14 (ActivityThread.java)
      at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1631)
      at android.os.Handler.dispatchMessage (Handler.java:102)
      at android.os.Looper.loop (Looper.java:154)
      at android.app.ActivityThread.main (ActivityThread.java:6682)
      at java.lang.reflect.Method.invoke (Method.java)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1520)
      at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410)

Any idea what may have caused that?

Here is my proguard-rules.pro.

# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

Thank you in advance

答案1

得分: 0

这看起来对我来说是一个Proguard错误。让我们在你的 proguard-rules.pro 中添加以下内容,然后检查是否可以解决这个问题。

-keep class net.sourceforge.jtds.jdbc.**
-keepclassmembers class net.sourceforge.jtds.jdbc.** { *; }
英文:

It looks like a proguard error to me. Let's add the following in your proguard-rules.pro and check if this fixes the issue.

-keep class net.sourceforge.jtds.jdbc.**
-keepclassmembers class net.sourceforge.jtds.jdbc.** { *; }

答案2

得分: 0

在使用混淆时,您的发布版本可能出现了问题。
尝试更改您的 gradle.App 属性:

buildTypes {
    release {
        // 尝试在没有混淆的情况下使用
    }
}
英文:

There must be a problem at your release while using pro guard.
Try to change your gradle.App property of

   buildTypes {
        release {
//try it without proguard
        }
}

huangapple
  • 本文由 发表于 2020年5月30日 01:30:23
  • 转载请务必保留本文链接:https://java.coder-hub.com/62091545.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定