【发布时间】:2017-12-03 22:19:22
【问题描述】:
我正在尝试将我的即时应用程序上传到 Play 商店。我看到以下上传即时应用程序 apk zip 的错误:
您的免安装应用 APK 的包名称应与您的应用的包名称相同
我的 build.gradles 对应的功能如下:
已安装的 apk (build.gradle):
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "27.0.1"
defaultConfig {
applicationId "arith.math.arithapk"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation project(':arithbase')
implementation project(":arithmaticsumfeature")
}
基础(build.gradle):
//apply plugin: 'com.android.application'
apply plugin: 'com.android.feature'
android {
compileSdkVersion 26
buildToolsVersion "27.0.1"
baseFeature = true
defaultConfig {
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-
core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:26.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
feature project(":arithmaticsumfeature")
api 'com.android.support:appcompat-v7:26.1.0'
application project(':arithapk')
}
功能(build.gradle):
apply plugin: 'com.android.feature'
android {
compileSdkVersion 26
buildToolsVersion "27.0.1"
defaultConfig {
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
api project(':arithbase')
}
免安装应用(build.gradle):
apply plugin: 'com.android.instantapp'
dependencies {
implementation project(':arithbase')
implementation project(":arithmaticsumfeature")
}
谁能帮我解决这个问题。 ?
提前致谢
【问题讨论】:
-
如果您还没有访问过documentation,请尝试访问。有这部分(具有多种功能的免安装应用的结构)描述了免安装应用的结构是由什么组成的,以及减小应用大小以优化代码的方法。有关更多示例,您可以访问此SO post,它与您遇到的错误相同。
-
更新基础(build.gradle)
标签: android android-instant-apps