2016-08-17 94 views
0

我正在開發一個android應用程序,當我在本地系統中構建它並在仿真器上運行時,一切正常,但只要我製作併發布並在手機上安裝了apk ,它崩潰錯誤 -Android Studio:解析簽名發佈時出錯APK

There was an error parsing the package 

正如你所看到的,我用最新的SDK建設和構建工具,而我的手機上運行的API相同的版本太多。我也允許不可信來源的安裝,並簽署我的應用程序,

的build.gradle -

apply plugin: 'com.android.application' 

android { 
    signingConfigs { 
     config { 
      keyAlias 'xxxxx' 
      keyPassword 'xxxx' 
      storeFile file('E:/Projects/Android/oiu.jks') 
      storePassword 'xxxxx' 
     } 
    } 
    compileSdkVersion 24 
    buildToolsVersion "24.0.1" 
    defaultConfig { 
     applicationId "sd.edu.oiu.medicine.mustafa" 
     minSdkVersion 15 
     targetSdkVersion 24 
     versionCode 1 
     versionName "1.0" 
    } 
    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE-FIREBASE.txt' 
     exclude 'META-INF/NOTICE' 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      signingConfig signingConfigs.config 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:24.1.1' 
    compile 'com.android.support:cardview-v7:24.1.1' 
    compile 'com.firebase:firebase-client-android:2.5.1+' 
    compile 'com.mcxiaoke.volley:library:1.0.19' 
    compile project(':libs:MaterialDrawer') 
    compile 'com.github.bumptech.glide:glide:3.7.0' 
    compile 'com.mikepenz:itemanimators:[email protected]' 
    compile 'com.mikepenz:crossfader:[email protected]' 
    compile 'com.mikepenz:crossfadedrawerlayout:[email protected]' 
    compile 'com.mikepenz:google-material-typeface:[email protected]' 
    compile 'com.mikepenz:fontawesome-typeface:[email protected]' 
    compile 'com.mikepenz:octicons-typeface:[email protected]' 
    // Charts 
    compile 'com.github.blackfizz:eazegraph:[email protected]' 
} 

AndroidManifest.xml中 -

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    package="sd.edu.oiu.medicine.mustafa" 
android:versionCode="1" 
android:versionName="1.0"> 

<uses-sdk 
    android:minSdkVersion="15" 
    android:targetSdkVersion="24" /> 

    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 

    <application 
     android:name=".MyApplication" 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:supportsRtl="true" 
     android:theme="@style/MaterialDrawerTheme.Light.DarkToolbar.TranslucentStatus" 
     tools:replace="icon" > 
     <activity 
      android:name=".SplashScreen" 
      android:theme="@style/SplashTheme" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".LoginActivity" 
      android:label="@string/login" /> 
     <activity 
      android:name=".RegisterActivity" 
      android:label="@string/register" 
      android:launchMode="singleTop" 
      android:windowSoftInputMode="adjustPan" /> 
     <activity 
      android:name=".RestPasswordActivity" 
      android:label="@string/reset_password" 
      android:launchMode="singleTop" 
      android:windowSoftInputMode="adjustPan" /> 
     <activity 
      android:name=".MainActivity" 
      android:label="@string/app_name" 
      android:launchMode="singleTop" /> 
     <activity 
      android:name=".ActivityResults" 
      android:label="@string/drawer_item_student_results" /> 
     <activity 
      android:name=".ActivitySecondResults" 
      android:label="@string/drawer_item_student_second_results" /> 
     <activity 
      android:name=".StudentsList" 
      android:label="@string/drawer_item_student_list" /> 
     <activity 
      android:name=".RobotNoor" 
      android:label="@string/robot_noor" /> 
     <activity 
      android:name=".ActivityFees" 
      android:label="@string/drawer_item_student_fees" /> 
     <activity 
      android:name=".AboutActivity" 
      android:label="@string/about_app" /> 
     <!-- adding our service --> 
     <service android:name=".NotificationListener" /> 
    </application> 

</manifest> 
+0

我甚至試圖讓新的空android項目和登錄並具有相同的錯誤rel緩解apk – MustafaTaj

+0

你找到了解決辦法? –

+0

突然android工作室開始正確簽署apk應用程序,我不知道如何,因爲我用了很多方法來解決問題 – MustafaTaj

回答

0

嘗試改變構建工具版本24.0 .0

+0

也沒有工作..即使有新的空項目 – MustafaTaj

+0

你能給我完整的錯誤報告從Android監視器 – RadiBarq

+0

APK的構建是成功的,但問題是,當我嘗試從android設備安裝它,如果得到這個解析錯誤,如何從中得到錯誤報告? – MustafaTaj