我的发布apk没有classes.dex或库。为什么呢?

时间:2018-04-14 16:35:03

标签: android-studio apk build.gradle

我对Android Studio不是很有经验。我在我的应用程序的最后阶段,我试图建立一个发布apk。但文件大小明显低于调试apk,它应该是。但后来我分析了我的发布apk,发现它不包括我的任何类或库,除了资源。

发布APK: This is release apk analyzed

调试APK: This is debug apk analyzed

我不确定我做错了所以这是我的Android项目配置:

我的build.gradle(App)

apply plugin: 'com.android.application'

android {
  compileSdkVersion 27
  defaultConfig {
    applicationId "com.hyfytv.hyfytvlive"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
  }
  buildTypes {
    release {
      minifyEnabled true
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

repositories {
  jcenter()
  maven {
    url 'http://repository.adincube.com/maven'
  }
  maven {
    url 'https://maven.google.com'
  }
}

dependencies {
  implementation fileTree(include: ['*.jar'], dir: 'libs')
  implementation 'com.android.support:appcompat-v7:27.1.1'
  implementation 'com.android.support:customtabs:27.1.1'
  implementation 'com.android.support:design:27.1.1'
  implementation 'com.android.support:cardview-v7:27.1.1'
  implementation 'com.android.support:support-v4:27.1.1'
  compile 'com.android.support:recyclerview-v7:27.1.1'
  compile 'com.android.support:preference-v14:27.1.1'
  implementation 'com.android.support.constraint:constraint-layout:1.1.0'
  testImplementation 'junit:junit:4.12'
  androidTestImplementation 'com.android.support.test:runner:1.0.1'
  androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  implementation 'com.github.ybq:Android-SpinKit:1.1.0'
  compile 'com.thoughtbot:expandablerecyclerview:1.3'
  compile 'com.simplecityapps:recyclerview-fastscroll:1.0.16'
  //compile 'com.jaredrummler:material-spinner:1.2.5'
  //compile ('com.weiwangcn.betterspinner:library:1.1.0') {
  //    exclude group: 'com.android.support', module: 'appcompat-v7'
  //}
  compile 'org.greenrobot:eventbus:3.1.1'
  //implementation 'com.devbrackets.android:exomedia:4.1.0'
  //compile 'com.github.arcadefire:nice-spinner:1.3.1'
  compile 'com.github.ganfra:material-spinner:2.0.0'

  implementation 'com.github.bumptech.glide:glide:4.6.1'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'

  //implementation 'com.google.android.exoplayer:exoplayer:2.6.1'

  implementation project(':exoplayer-library-core')
  implementation project(':exoplayer-library-dash')
  implementation project(':exoplayer-library-ui')
  implementation project(':exoplayer-library-smoothstreaming')
  implementation project(':exoplayer-library-hls')

  compile 'com.google.firebase:firebase-core:15.0.0'
  compile 'com.google.android.gms:play-services-ads:15.0.0'
  compile 'com.google.firebase:firebase-database:15.0.0'
  compile 'com.google.firebase:firebase-storage:15.0.0'
  compile 'com.google.firebase:firebase-auth:15.0.0'
  compile 'com.google.firebase:firebase-crash:15.0.0'

  implementation 'com.android.support:multidex:1.0.3'

  compile('com.adincube.sdk:AdinCube-Java-1606ebe:1.+@aar') {
    transitive = true
    exclude group: 'com.adincube.partner', module: 'facebook'
  }
}

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

我的build.gradle(项目)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

  repositories {
    google()
    jcenter()
    mavenCentral()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:3.1.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.google.gms:google-services:3.2.1'
  }
}

allprojects {
  repositories {
    google()
    jcenter()
    maven {
      url "https://jitpack.io"
    }

    //maven { url 'https://maven.google.com' }
    //maven { url 'http://repository.adincube.com/maven' }
    //maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
    //maven { url 'https://maven.google.com' } // necessary for Android API 26
  }
}

task clean(type: Delete) {
  delete rootProject.buildDir
}

我的Android Manifest.xml

<< ? xml version = "1.0"
encoding = "utf-8" ? >
  <
  manifest xmlns : android = "http://schemas.android.com/apk/res/android"
package = "com.appname.name" >

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

  <!-- Optional permissions. Will pass Lat/Lon values when available. Choose either Coarse or Fine -->
  <
  uses - permission android: name = "android.permission.ACCESS_COARSE_LOCATION" / >
  <
  uses - permission android: name = "android.permission.ACCESS_FINE_LOCATION" / >

  <!-- Optional permissions. Used for MRAID 2.0 storePicture ads -->
  <
  uses - permission android: name = "android.permission.WRITE_EXTERNAL_STORAGE" / >

  <
  application
android: allowBackup = "true"
android: configChanges = "orientation|keyboardHidden|screenSize"
android: icon = "@mipmap/ic_launcher"
android: label = "@string/app_name"
android: name = "android.support.multidex.MultiDexApplication"
android: roundIcon = "@mipmap/ic_launcher_round"
android: supportsRtl = "true"
android: theme = "@style/AppTheme" >
  <
  activity
android: name = ".activities.SplashScreen"
android: configChanges = "orientation|keyboardHidden|screenSize"
android: theme = "@style/FullscreenTheme"
android: screenOrientation = "landscape" >
  <
  intent - filter >
  <
  action android: name = "android.intent.action.MAIN" / >

  <
  category android: name = "android.intent.category.LAUNCHER" / >
  <
  /intent-filter> <
  /activity> <
  activity
android: name = ".activities.WatchPanel"
android: configChanges = "orientation|keyboardHidden|screenSize"
android: screenOrientation = "landscape" >

  <
  /activity> <
  activity
android: name = ".activities.AuthenticationActivity"
android: screenOrientation = "portrait" / >
  <
  activity
android: name = ".activities.AdminPanel"
android: screenOrientation = "portrait" / >
  <
  activity
android: name = ".activities.DynamicActivity"
android: screenOrientation = "portrait" / >
  <
  activity
android: name = ".activities.VideoViewActivity"
android: configChanges = "orientation|keyboardHidden|screenSize"
android: label = "@string/title_activity_video_view"
android: screenOrientation = "landscape"
android: theme = "@style/FullscreenTheme" / >
  <
  activity
android: name = ".activities.PlayerActivity"
android: screenOrientation = "landscape" / >

  <
  meta - data
android: name = "com.google.android.gms.version"
android: value = "@integer/google_play_services_version" / >

  <
  /application>

  <
  /manifest>

任何帮助都会非常感激,因为我完全迷失在这里。 欢呼声

0 个答案:

没有答案