更改包名称后,应用程序正在编译但未运行

时间:2017-05-15 22:51:49

标签: android android-studio

我正在尝试编译Telegram Android

我重命名了包名并编辑了AndroidManifest。

当我清理并重建项目时,一切都很好,即使我编译项目并导出APK,也没有错误但是当我运行应用程序时,应用程序崩溃并且我收到此错误(来自android监视器):

05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.ClassNotFoundException: Didn't find class "org.telegram.tgnet.NativeByteBuffer" on path: DexPathList[[zip file "/system/framework/multiwindow.jar", zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/ash.ashgram.messenger.beta-1/base.apk"],nativeLibraryDirectories=[/data/app/ash.ashgram.messenger.beta-1/lib/arm, /data/app/ash.ashgram.messenger.beta-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:511)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:469)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.String) (Runtime.java:-2)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.String java.lang.Runtime.doLoad(java.lang.String, java.lang.ClassLoader) (Runtime.java:435)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void java.lang.Runtime.loadLibrary(java.lang.String, java.lang.ClassLoader) (Runtime.java:370)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void java.lang.System.loadLibrary(java.lang.String) (System.java:1076)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void ash.ashgram.messenger.NativeLoader.initNativeLibs(android.content.Context) (NativeLoader.java:152)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void ash.ashgram.messenger.ApplicationLoader.onCreate() (ApplicationLoader.java:201)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void android.app.Instrumentation.callApplicationOnCreate(android.app.Application) (Instrumentation.java:1036)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void android.app.ActivityThread.handleBindApplication(android.app.ActivityThread$AppBindData) (ActivityThread.java:6316)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void android.app.ActivityThread.access$1800(android.app.ActivityThread, android.app.ActivityThread$AppBindData) (ActivityThread.java:221)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1860)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void android.os.Looper.loop() (Looper.java:158)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7224)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1230)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1120)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410] 
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]     in call to NewGlobalRef
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]     from java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.String)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410] "main" prio=5 tid=1 Runnable
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   | group="main" sCount=0 dsCount=0 obj=0x76421598 self=0xb4836500
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   | sysTid=9337 nice=0 cgrp=bg_non_interactive sched=0/0 handle=0xb6f3db4c
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   | state=R schedstat=( 359833255 294594705 379 ) utm=16 stm=19 core=4 HZ=100
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   | stack=0xbe3a8000-0xbe3aa000 stackSize=8MB
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   | held mutexes= "mutator lock"(shared held)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   native: #00 pc 0037175f  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+142)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   native: #01 pc 00350d21  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEP12BacktraceMap+160)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   native: #02 pc 0025afdb  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+742)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   native: #03 pc 0025b6b5  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+64)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   native: #04 pc 000fd0a1  /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+32)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   native: #05 pc 001021b5  /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95+5072)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   native: #06 pc 001145a1  /system/lib/libart.so (_ZN3art8CheckJNI12NewGlobalRefEP7_JNIEnvP8_jobject+392)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   native: #07 pc 0034994b  /system/lib/libart.so (_ZN3art6Thread22SetClassLoaderOverrideEP8_jobject+38)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   native: #08 pc 0025bc73  /system/lib/libart.so (_ZN3art9JavaVMExt17LoadNativeLibraryEP7_JNIEnvRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEP8_jobjectPS9_+1290)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   native: #09 pc 002d1c97  /system/lib/libart.so (_ZN3artL18Runtime_nativeLoadEP7_JNIEnvP7_jclassP8_jstringP8_jobjectS5_+194)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   native: #10 pc 0020d51d  /system/framework/arm/boot.oat (Java_java_lang_Runtime_nativeLoad__Ljava_lang_String_2Ljava_lang_ClassLoader_2Ljava_lang_String_2+144)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.Runtime.nativeLoad(Native method)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.Runtime.doLoad(Runtime.java:435)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   - locked <0x01511032> (a java.lang.Runtime)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.Runtime.loadLibrary(Runtime.java:370)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.System.loadLibrary(System.java:1076)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at ash.ashgram.messenger.NativeLoader.initNativeLibs(NativeLoader.java:152)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   - locked <0x0b1f5183> (a java.lang.Class<ash.ashgram.messenger.NativeLoader>)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at ash.ashgram.messenger.ApplicationLoader.onCreate(ApplicationLoader.java:201)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1036)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6316)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at android.app.ActivityThread.access$1800(ActivityThread.java:221)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1860)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at android.os.Handler.dispatchMessage(Handler.java:102)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at android.os.Looper.loop(Looper.java:158)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at android.app.ActivityThread.main(ActivityThread.java:7224)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.reflect.Method.invoke!(Native method)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/java_vm_ext.cc:410] 
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/runtime.cc:368] Runtime aborting...
05-16 03:11:03.933 9337-9337/ash.ashgram.messenger.beta A/art: art/runtime/runtime.cc:368] 
05-16 03:11:03.938 9337-9337/ash.ashgram.messenger.beta A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 9337 (.messenger.beta)

我在整个项目中搜索了org.telegram.tgnet.NativeByteBuffer,但没有一个存在,项目中的org.telegram没有任何内容。我该怎么办?

1 个答案:

答案 0 :(得分:2)

问题似乎出现在TMessagesProj/jni/TgNetWrapper.cpp in line 143

您必须在更改目录/包名称时进行更改。

请注意,3个文件中还有其他行,您必须更改所有这些行,否则会导致应用程序崩溃。