Android Studio无法识别更新到2.2.2的应用程序名称 [英] Android Studio Not Recognizing Application Name on Update to 2.2.2

查看:208
本文介绍了Android Studio无法识别更新到2.2.2的应用程序名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新了Android Studio到版本2.2.2,并且遇到了一些问题,其中我的应用程序名称不再在清单中被识别。我还根据位于



我不完全确定原因,但一直在阅读关于多重索引作为与此错误相关的组件之一。我也收到了一个运行时错误,我认为这个错误还涉及到这个问题:

$ $ p $ ------- - 崩溃开始
11-28 20:29:06.313 10163-10163 / com.troychuinard.fanpolls E / AndroidRuntime:致命异常:main
过程:com.troychuinard.fanpolls,PID:10163
java.lang.RuntimeException:无法实例化应用程序com.troychuinard.fanpolls.FanPollsApplication:java.lang.ClassNotFoundException:在路径中找不到类com.troychuinard.fanpolls.FanPollsApplication:DexPathList [[zip file] /data/app/com.troychuinard.fanpolls-1/base.apk\"],nativeLibraryDirectories=[/data/app/com.troychuinard.fanpolls-1/lib/x86,/ vendor / lib,/ system / lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:578)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4680)
at android.app.ActivityThread.- wrap1(ActivityThread.java)
at android.app.ActivityThread $ H.handleMessage(Act在Android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:148)
在android的
.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run( ZygoteInit.java:726)
在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
引起:java.lang.ClassNotFoundException:找不到类com。 troychuinard.fanpolls.FanPollsApplication路径:DexPathList [[zip文件/data/app/com.troychuinard.fanpolls-1/base.apk\"],nativeLibraryDirectories=[/data/app/com.troychuinard.fanpolls-1/ lib / x86,/ vendor / lib,/ system / lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)$ b $ at java.lang.ClassLoader.loadClass(ClassLoader.java :511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at androi d.app.Instrumentation.newApplication(Instrumentation.java:981)
at android.app.LoadedApk.makeApplication(LoadedApk.java:573)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1405)
at android.os。 Handler.dispatchMessage(Handler.java:102)
在android.os.Looper.loop(Looper.java:148)
在android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android。 internal.os.ZygoteInit.main(ZygoteInit.java:616)
Suppressed:java.lang.ClassNotFoundException:com.troychuinard.fanpolls.FanPollsApplication $ b $ java.util.Class.classForName(Native Method)
在java.lang.BootClassLoader.findClass(ClassLoader.java:781)$ b $在java.lang.BootClassLoader.loadClass(ClassLoader.java:841)$ b $在java.lang.ClassLoader.loadClass(ClassLoader.java :504)
... 12 more
引起:java.lang.NoClassDefFoundError:类未找到使用引导类加载器;没有堆栈跟踪可用

Build.Gradle



<$应用插件:'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion '25 .0.1'


defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationIdcom.troychuinard.fanpolls
minSdkVersion 16
targetSdkVersion 24
multiDexEnabled true
versionCode 1
versionName1.0
}


buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile ('proguard-android.txt'),'proguard-rules.pro'
}
}

packagingOptions {
不包括'META-INF / LICENSE'
排除'META-INF / LICENSE-FIREBASE.txt'
排除'META-INF / NOTICE'
}
}
存储库{
maven {url https://jitpack.io}
}

依赖项{
编译fileTree( dir:'libs',包括:['* .jar'])
compile'c​​om.google.firebase:firebase-core:9.6.1'
compile'c​​om.google.firebase:firebase-数据库:9.6.1'
compile'c​​om.google.firebase:firebase-auth:9.6.1'
compile'jp.wasabeef:recyclerview-animators:2.2.3'
compile' com.github.clans:fab:1.6.2'
compile'de.hdodenhof:circleimageview:2.0.0'
compile'c​​om.android.support:cardview-v7:24.1.1'
compile'c​​om.android.support:appcompat-v7:24.1.1'
compile'c​​om.android.support:recyclerview-v7:24.1.1'
compile'c​​om.android.support:设计:24.1.1'
compile'c​​om.jakewharton:butterknife:7.0.1'
compile'c​​om.facebook.android:facebook-android-sdk:4.6.0'
compile' com.google.android.gms:play-services-auth:9.6.1'
compile'org.twitter4j:twitter4j-core:4.0.2'
compile'c​​om.android.support:support- v4:24.1.1'
compile'c​​om.squareup.picasso:picasso:2.5.2'
compile'c​​om.squareup.okhtt p3:okhttp:3.1.2'
compile'c​​om.github.PhilJay:MPAndroidChart:v2.2.2'
compile'c​​om.google.android.gms:play-services-appindexing:9.6.1'
compile'c​​om.google.code.gson:gson:2.6.2'
compile'c​​om.squareup.retrofit2:retrofit:2.1.0'
compile'c​​om.squareup.retrofit2: convert-gson:2.1.0'
compile'c​​om.squareup.okhttp3:logging-interceptor:3.3.0'
compile'c​​om.android.support:multidex:1.0.1'
}

apply plugin:'com.google.gms.google-services'

这里是我的目录结构:



任何帮助或建议,赞赏!

解决方案

因为您没有类 com.troychuinard。 fanpolls.FanPollsApplication ,只需删除属性 name ='。FanPollsA pplication 。它将使用标准 android.app.Application 来代替。


I recently updated Android Studio to version 2.2.2 and have been experiencing some issues, among them my application name is no longer being recognized in the manifest. I also migrated to the new Firebase SDK based on the documentation located here:

I am not exactly sure of the cause, but have been reading about multidexing as being one of the components related to this error. I am also receiving a run-time error below that I believe also relates to the issue:

--------- beginning of crash
11-28 20:29:06.313 10163-10163/com.troychuinard.fanpolls E/AndroidRuntime: FATAL EXCEPTION: main
       Process: com.troychuinard.fanpolls, PID: 10163
       java.lang.RuntimeException: Unable to instantiate application com.troychuinard.fanpolls.FanPollsApplication: java.lang.ClassNotFoundException: Didn't find class "com.troychuinard.fanpolls.FanPollsApplication" on path: DexPathList[[zip file "/data/app/com.troychuinard.fanpolls-1/base.apk"],nativeLibraryDirectories=[/data/app/com.troychuinard.fanpolls-1/lib/x86, /vendor/lib, /system/lib]]
       at android.app.LoadedApk.makeApplication(LoadedApk.java:578)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4680)
       at android.app.ActivityThread.-wrap1(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5417)
       at java.lang.reflect.Method.invoke(Native Method)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "com.troychuinard.fanpolls.FanPollsApplication" on path: DexPathList[[zip file "/data/app/com.troychuinard.fanpolls-1/base.apk"],nativeLibraryDirectories=[/data/app/com.troychuinard.fanpolls-1/lib/x86, /vendor/lib, /system/lib]]
       at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
       at android.app.Instrumentation.newApplication(Instrumentation.java:981)
       at android.app.LoadedApk.makeApplication(LoadedApk.java:573)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4680) 
       at android.app.ActivityThread.-wrap1(ActivityThread.java) 
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405) 
       at android.os.Handler.dispatchMessage(Handler.java:102) 
       at android.os.Looper.loop(Looper.java:148) 
       at android.app.ActivityThread.main(ActivityThread.java:5417) 
       at java.lang.reflect.Method.invoke(Native Method) 
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
        Suppressed: java.lang.ClassNotFoundException: com.troychuinard.fanpolls.FanPollsApplication
       at java.lang.Class.classForName(Native Method)
       at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
       at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
            ... 12 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

Build.Gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion '25.0.1'


defaultConfig {
    vectorDrawables.useSupportLibrary = true
    applicationId "com.troychuinard.fanpolls"
    minSdkVersion 16
    targetSdkVersion 24
    multiDexEnabled true
    versionCode 1
    versionName "1.0"
}


buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE-FIREBASE.txt'
    exclude 'META-INF/NOTICE'
  }
}
repositories {
maven { url "https://jitpack.io" }
 }

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.firebase:firebase-database:9.6.1'
compile 'com.google.firebase:firebase-auth:9.6.1'
compile 'jp.wasabeef:recyclerview-animators:2.2.3'
compile 'com.github.clans:fab:1.6.2'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.google.android.gms:play-services-auth:9.6.1'
compile 'org.twitter4j:twitter4j-core:4.0.2'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp3:okhttp:3.1.2'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.2'
compile 'com.google.android.gms:play-services-appindexing:9.6.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.3.0'
compile 'com.android.support:multidex:1.0.1'
 }

apply plugin: 'com.google.gms.google-services'

Here is my directory structure:

Any help or advice is appreciated!

解决方案

As you don't have a class com.troychuinard.fanpolls.FanPollsApplication, just remove the attribute name='.FanPollsApplication'. It will use standard android.app.Application instead.

这篇关于Android Studio无法识别更新到2.2.2的应用程序名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆