gpt4 book ai didi

android - Play 控制台错误 : You must provide a default URL for your instant app APKs

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:01:07 25 4
gpt4 key购买 nike

我需要为 Instant App 准备 Alpha 测试,它在 Android Studio 上运行起来非常棒,但是当我尝试在 PlayStore 中推出它时它失败了,说:

您必须为免安装应用 APK 提供默认网址

应用程序结构使用三个模块完成:

-base:包含所有代码

-apk: 获取可安装apk的包装器

-instantApp:获取instantApp apk的Wrapper

这是 build.gradles:

build.gradle

buildscript {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.google.com'}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
}
}

allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
mavenCentral()
}
}

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

ext {
buildTools = '25.0.2'
compileSdk = 25
minSdk = 23
versionCode = 10
versionName = '4.0'
supportLib = '25.3.1'
playServices = "10.2.6"
}

base/build.gradle

buildscript {
repositories {
jcenter()
}
}
apply plugin: 'com.android.feature'

repositories {
jcenter()
mavenCentral()
}

android {
compileSdkVersion rootProject.compileSdk
buildToolsVersion rootProject.buildTools

baseFeature = true

defaultConfig {

minSdkVersion rootProject.minSdk
targetSdkVersion rootProject.compileSdk
versionCode rootProject.versionCode
versionName rootProject.versionName
}

signingConfigs {
release {
[...]
}
}

buildTypes {
debug {
[...]
}
release {
minifyEnabled false
signingConfig signingConfigs.release
[...]
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
[...]
}

apk/build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion rootProject.compileSdk
buildToolsVersion rootProject.buildTools

defaultConfig {
applicationId “…”
minSdkVersion rootProject.minSdk
targetSdkVersion rootProject.compileSdk
versionCode rootProject.versionCode
versionName rootProject.versionName
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

signingConfigs {
release {
[...]
}
}

buildTypes {
debug {
[…]
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

signingConfig signingConfigs.release
[…]
}
}
}

dependencies {
implementation project(':base')
}

instantApp/build.gradle

apply plugin: 'com.android.instantapp'

android {
compileSdkVersion rootProject.compileSdk
buildToolsVersion rootProject.buildTools

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation project(':base')
}

这是 list 文件

base/Manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package=“…”>

<uses-permission android:name="android.permission.INTERNET" />
[…]

<application
android:name=“[…].TrgApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppBaseTheme">

<activity
android:name=“[…].LauncherActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<data android:scheme="http" />
<data android:host="[...]" />
</intent-filter>
</activity>
<activity
android:name="[…].RootActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" />

<activity
android:name="[…].OnBoardingActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" />

<activity
android:name="[…].LocationPickerActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" />

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

<service android:name="com.parse.PushService" />
<receiver
android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />

<!--
IMPORTANT: Change "com.parse.starter" to match your app's package name.
-->
<category android:name="[…]" />
</intent-filter>
</receiver>

<meta-data
android:name="com.parse.push.gcm_sender_id"
android:value="id:[…]" />

</application>
</manifest>

apk/Manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="..." />

这个包与应用程序的包不同

任何一种想法都可能很棒

提前致谢

最佳答案

您还必须在 list 中添加默认 url 作为元数据:

<activity
android:name=“[…].LauncherActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<data android:scheme="http" />
<data android:host="[...]" />
</intent-filter>
<meta-data
android:name="default-url"
android:value="https://[...]" />
</activity>

引用:https://developer.android.com/topic/instant-apps/prepare.html#default-url

关于android - Play 控制台错误 : You must provide a default URL for your instant app APKs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44503178/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com