我已从以下存储库(https://github.com/DrKLO/Telegram)下载了Telegram项目,并编辑了 BuildVars.java 以将 APP_ID 和 APP_HASH ,我也在hockeyapp.net注册了 HOCKEY_APP_HASH 。而现在,当我运行该项目时,它会停止出现异常。正如我所见,它表示" org.telegram.messenger.ApplicationLoader "找不到。但它存在于" java / org / telegram / messenger /"夹。请帮我弄清楚这个问题。
Log cat输出:
02-07 20:26:36.204: D/AndroidRuntime(1089): Shutting down VM
02-07 20:26:36.257: E/AndroidRuntime(1089): FATAL EXCEPTION: main
02-07 20:26:36.257: E/AndroidRuntime(1089): Process: org.telegram.messenger, PID: 1089
02-07 20:26:36.257: E/AndroidRuntime(1089): java.lang.RuntimeException: Unable to instantiate application org.telegram.messenger.ApplicationLoader: java.lang.ClassNotFoundException: Didn't find class "org.telegram.messenger.ApplicationLoader" on path: DexPathList[[zip file "/data/app/org.telegram.messenger-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.telegram.messenger-1, /vendor/lib, /system/lib]]
02-07 20:26:36.257: E/AndroidRuntime(1089): at android.app.LoadedApk.makeApplication(LoadedApk.java:517)
02-07 20:26:36.257: E/AndroidRuntime(1089): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4370)
02-07 20:26:36.257: E/AndroidRuntime(1089): at android.app.ActivityThread.access$1500(ActivityThread.java:143)
02-07 20:26:36.257: E/AndroidRuntime(1089): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
02-07 20:26:36.257: E/AndroidRuntime(1089): at android.os.Handler.dispatchMessage(Handler.java:102)
02-07 20:26:36.257: E/AndroidRuntime(1089): at android.os.Looper.loop(Looper.java:135)
02-07 20:26:36.257: E/AndroidRuntime(1089): at android.app.ActivityThread.main(ActivityThread.java:5070)
02-07 20:26:36.257: E/AndroidRuntime(1089): at java.lang.reflect.Method.invoke(Native Method)
02-07 20:26:36.257: E/AndroidRuntime(1089): at java.lang.reflect.Method.invoke(Method.java:372)
02-07 20:26:36.257: E/AndroidRuntime(1089): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:836)
02-07 20:26:36.257: E/AndroidRuntime(1089): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:631)
02-07 20:26:36.257: E/AndroidRuntime(1089): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.telegram.messenger.ApplicationLoader" on path: DexPathList[[zip file "/data/app/org.telegram.messenger-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.telegram.messenger-1, /vendor/lib, /system/lib]]
02-07 20:26:36.257: E/AndroidRuntime(1089): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
02-07 20:26:36.257: E/AndroidRuntime(1089): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
02-07 20:26:36.257: E/AndroidRuntime(1089): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
02-07 20:26:36.257: E/AndroidRuntime(1089): at android.app.Instrumentation.newApplication(Instrumentation.java:976)
02-07 20:26:36.257: E/AndroidRuntime(1089): at android.app.LoadedApk.makeApplication(LoadedApk.java:512)
02-07 20:26:36.257: E/AndroidRuntime(1089): ... 10 more
02-07 20:26:36.257: E/AndroidRuntime(1089): Suppressed: java.lang.ClassNotFoundException: org.telegram.messenger.ApplicationLoader
02-07 20:26:36.257: E/AndroidRuntime(1089): at java.lang.Class.classForName(Native Method)
02-07 20:26:36.257: E/AndroidRuntime(1089): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
02-07 20:26:36.257: E/AndroidRuntime(1089): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
02-07 20:26:36.257: E/AndroidRuntime(1089): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
02-07 20:26:36.257: E/AndroidRuntime(1089): ... 13 more
02-07 20:26:36.257: E/AndroidRuntime(1089): Caused by: java.lang.NoClassDefFoundError: Class "Lorg/telegram/messenger/ApplicationLoader;" not found
02-07 20:26:36.257: E/AndroidRuntime(1089): ... 17 more
02-07 20:26:43.890: I/Process(1089): Sending signal. PID: 1089 SIG: 9
答案 0 :(得分:2)
只需将{32>长度字符串分配给BuildVars.java
中的 HOCKEY_APP_HASH 。我使用全零,它现在工作正常。我将尝试更新如何绕过使用Hockey并更新答案。
答案 1 :(得分:0)
检查您的清单文件,尝试将".ApplicationLoader"
替换为"org.telegram.messenger.ApplicationLoader"
并尝试重建项目。也许这有助于你。