2017-01-10 4 views
0

instanziiert, wenn meine App über den Android Virtual Machine ausgeführt wird, stürzt, mir folgende Fehler zurückgegeben:android Studio Emulator: unable Aktivität

FATAL EXCEPTION: main 
Process: en.company.client.name, PID: 4336 
java.lang.RuntimeException: Unable to instantiate activity  
ComponentInfo{en.company.client.name/en.company.client.name.SplashScreen}:  
java.lang.ClassNotFoundException: Didn't find class  
"en.company.client.name.SplashScreen" on path: DexPathList[[zip file  
"/system/framework/com.google.android.maps.jar", zip file  
"/data/app/en.company.client.name-1/base.apk"],nativeLibraryDirectories= 
[/data/app/en.company.client.name-1/lib/x86, /system/lib, /vendor/lib]] 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2567) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6119) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

Caused by: java.lang.ClassNotFoundException: Didn't find class 
"en.company.client.name.SplashScreen" on path: DexPathList[[zip file 
"/system/framework/com.google.android.maps.jar", zip file 
"/data/app/en.company.client.name-1/base.apk"],nativeLibraryDirectories= 
[/data/app/en.company.client.name-1/lib/x86, /system/lib, /vendor/lib]] 
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:380) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 
at android.app.Instrumentation.newActivity(Instrumentation.java:1078) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557) 

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)  
at android.app.ActivityThread.-wrap12(ActivityThread.java)  
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)  
at android.os.Handler.dispatchMessage(Handler.java:102)  
at android.os.Looper.loop(Looper.java:154)  
at android.app.ActivityThread.main(ActivityThread.java:6119)  
at java.lang.reflect.Method.invoke(Native Method)  
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)  
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)  

hier meine AndroidManifest.xml Datei:

<?xml version="1.0" encoding="utf-8" standalone="no"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="en.company.client.name" platformBuildVersionCode="23" platformBuildVersionName="6.0-2438415"> 
    <uses-feature android:glEsVersion="0x00020000" android:required="true"/> 
    <uses-permission android:name="android.permission.INTERNET"/> 
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/> 
    <uses-permission android:name="android.permission.WAKE_LOCK"/> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> 
    <permission android:name="en.company.client.name.gcm.permission.C2D_MESSAGE" android:protectionLevel="signature"/> 
    <uses-permission android:name="en.company.client.name.gcm.permission.C2D_MESSAGE"/> 
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> 
    <uses-permission android:name="android.permission.CALL_PHONE"/> 
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/> 
    <permission android:name="android.permission.FLASHLIGHT" android:permissionGroup="android.permission-group.HARDWARE_CONTROLS" android:protectionLevel="normal"/> 
    <application android:icon="@drawable/ic_launcher" android:label="name of app" android:theme="@style/Theme.Ab"> 
     <receiver android:name="en.company.client.name.SimpleWakefulReceiver" android:permission="com.google.android.c2dm.permission.SEND"> 
     <intent-filter> 
      <action android:name="com.google.android.c2dm.intent.RECEIVE"/> 
      <category android:name="com.example.gcm"/> 
     </intent-filter> 
    </receiver> 
    <service android:name="en.company.client.name.SimpleWakefulService"/> 
    <uses-library android:name="com.google.android.maps"/> 
    <meta-data android:name="com.google.android.gms.version" android:value="4242000"/> 
    <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyCpYsVH0zJSuL1SX5SuVoCP2RqeGqfSL1o"/> 
    <meta-data android:name="bundleName" android:value="en.company.client"/> 
    <meta-data android:name="displayName" android:value="name of app"/> 
    <meta-data android:name="version" android:value="1.3"/> 
    <meta-data android:name="build" android:value="3"/> 
    <meta-data android:name="showroomName" android:value="name of app"/> 
    <meta-data android:name="navBarCaption" android:value="name in navbar"/> 
    <meta-data android:name="showroomAddr" android:value="address"/> 
    <meta-data android:name="showroomPhone" android:value="phone number"/> 
    <meta-data android:name="showroomMail" android:value="email"/> 
    <meta-data android:name="showroomLatitude" android:value="latitude"/> 
    <meta-data android:name="showroomLongitude" android:value="longitude"/> 
    <meta-data android:name="assistanceForeignTel" android:value="international number"/> 
    <meta-data android:name="assistanceNatTel" android:value="national number"/> 
    <meta-data android:name="savPhone" android:value="service number"/> 
    <meta-data android:name="savMail" android:value="service email"/> 
    <meta-data android:name="isRent" android:value="true"/> 
    <meta-data android:name="mentionsAtelier" android:value="some legal mentions"/> 
    <meta-data android:name="facebookLink" android:value="fb url"/> 
    <meta-data android:name="mentions" android:value="more legal mentions"/> 
    <activity android:label="name of app" android:name="en.company.client.name.SplashScreen" android:screenOrientation="portrait" android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN"/> 
      <category android:name="android.intent.category.LAUNCHER"/> 
     </intent-filter> 
    </activity> 
    <activity android:icon="@drawable/ic_action_about" android:label="@string/title_activity_news" android:launchMode="singleTop" android:name="en.company.client.name.News" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:icon="@drawable/ic_action_about" android:label="@string/title_activity_news_web" android:launchMode="singleTop" android:name="en.company.client.name.NewsWeb" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:icon="@drawable/ic_action_about" android:label="@string/title_activity_news" android:name="en.company.client.name.NewsPager" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:configChanges="keyboardHidden|orientation" android:icon="@drawable/ic_action_about" android:label="@string/title_activity_cars" android:launchMode="singleTop" android:name="en.company.client.name.Cars" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:configChanges="keyboardHidden|orientation" android:icon="@drawable/ic_action_about" android:label="@string/title_activity_cars" android:name="en.company.client.name.CarDetail" android:parentActivityName=".Cars" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:configChanges="keyboardHidden|orientation" android:name="en.company.client.name.Gallery" android:screenOrientation="landscape" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:icon="@drawable/ic_action_about" android:label="@string/title_activity_staffs" android:name="en.company.client.name.StaffGridPager" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:configChanges="keyboardHidden|orientation" android:icon="@drawable/ic_action_about" android:label="@string/title_activity_cars" android:launchMode="singleTop" android:name="en.company.client.name.Showrooms" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:name="en.company.client.name.Maps" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:icon="@drawable/ic_action_about" android:label="@string/title_activity_staffs" android:name="en.company.client.name.StaffSimplePager" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:configChanges="keyboardHidden|orientation" android:name="en.company.client.name.VideoPlayer" android:screenOrientation="landscape" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:name="en.company.client.name.Widgets" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:name="en.company.client.name.White" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:launchMode="singleTop" android:name="en.company.client.name.Credits" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:launchMode="singleTop" android:name="en.company.client.name.Assistance" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:launchMode="singleTop" android:name="en.company.client.name.Atelier" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow" android:windowSoftInputMode="stateHidden"/> 
    <activity android:launchMode="singleTop" android:name="en.company.client.name.Rent" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:name="en.company.client.name.AtelierSuccess" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
    <activity android:name="en.company.client.name.PackAssurance" android:screenOrientation="portrait" android:uiOptions="splitActionBarWhenNarrow"/> 
</application> 
</manifest> 

Android Studio unterstützt zwei Fehler in AndroidManifest.xml:

auf platformBuildVersionCode = "23" und auf platformBuildVersionName = "6.0-2438415"

beide Angabe „Attribut fehlt das Android Namespacepräfix“

Ich weiß nicht, ob die Fehler in Zusammenhang stehen, aber wahrscheinlich nicht gut sowieso ..

Dieses Projekt nicht mit gradle gebaut wird, und ich Ich weiß nicht, wie ich es hinzufügen soll.

+0

haben Sie richtig erwähnt 'java.lang.ClassNotFoundException: Haben Sie nicht gefunden Klasse „en.company.client.name.SplashScreen“', scheint die Klasse nicht – W4R10CK

+0

gut gefunden wird, diese ist ursprünglich nicht mein Projekt, wir versuchen, die App zu aktualisieren, Android (und iOS, aber es geschafft, dies zu tun) ist nicht mein ursprüngliches Fachgebiet, ich werde nachschlagen, aber Sie hätten eine Idee, wo es sollte erklärt werden? –

+0

Bitte fügen Sie Activity SplashScreen in AndroidManifest.xml Mahesh

Antwort

0

Der Fehler besagt, dass Ihre IDs platformBuildVersionCode und platformBuildVersionName ein Namespace fehlen. Alle XML-Identifiers einen Namensraum durch den Schlüssel gefolgt haben, wie android:name

Futhermore die Tasten sind nicht gültige Bezeichner für die Build-Version und den Namen, es ist

android:versionCode="integer" 
android:versionName="string" 

wie hier erwähnt: https://developer.android.com/guide/topics/manifest/manifest-element.html

Um Gradle zu Ihrem Projekt hinzuzufügen, können Sie das Projekt in Android Studio importieren.

Und Ihr Fehler wird durch eine fehlende Klasse verursacht. Sie sollten Ihr XML-Layout (nicht das Manifest) überprüfen und die Klassenkennung mit der Klasse in Ihrem Code vergleichen.

+0

Danke, dass Sie mich in die richtige Richtung geschickt haben! Gefunden alle meine .class und .java Dateien (einschließlich Splashcreen und mehr, aber wie Splashcreen wirklich ist, was zuerst in der App kommt, denke, es hat nur Zeiten, um dieses Problem zurückzugeben) sind nicht an das Projekt gebunden. Ich weiß jedoch nicht, wie ich sie richtig wieder einfügen soll –

0

In Ihrem PC.

Goto Projektordner Projekt>build Ordner &

Projekt> src>build Ordner löschen. Dann wieder aufbauen project.Project