嘿伙计们我遇到了各种各样的问题,我一直遇到应用程序的免费和付费版本的启动器活动问题。如果我为两者添加特定的启动器活动,我会收到错误,但是如果我执行常规自动解析,则会发生崩溃。在这种情况下,清单应该是什么样的? (我有一个单独的免费和付费版本的主要在自己的特定付费/免费目录。任何帮助表示赞赏!
免费> java> com.udacity.gradle.builditbigger.free>主要活动。
主要> java> com.udacity.gradle.builditbigger
付费和GT; java> com.udacity.gradle.builditbigger.paid>主要活动。
Manifest看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.udacity.gradle.builditbigger" >
<!-- Include required permissions for Google Mobile Ads to run -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:name="android.support.multidex.MultiDexApplication">
<!-- This meta-data tag is required to use Google Play Services. -->
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name="com.udacity.builditbigger.paid.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
</application>
</manifest>
** App.gradle
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'debug'
keyPassword 'android'
storeFile file('C:/Users/Douglas/.android/debug.keystore')
storePassword 'android'
}
}
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.udacity.gradle.builditbigger"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
productFlavors {
free {
applicationId = "com.udacity.gradle.builditbigger.free"
minSdkVersion 15
targetSdkVersion 23
}
paid {
applicationId = "com.udacity.gradle.builditbigger.paid"
minSdkVersion 15
targetSdkVersion 23
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':laughlib')
compile project(':jokeview')
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services:8.3.0'
compile project(path: ':backend', configuration: 'android-endpoints')
compile 'com.android.support:multidex:1.0.0'
}