Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/223.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android PlayConsole错误:您必须为即时应用程序APK提供默认URL_Android_Android Instant Apps_Rollout_Google Play Console - Fatal编程技术网

Android PlayConsole错误:您必须为即时应用程序APK提供默认URL

Android PlayConsole错误:您必须为即时应用程序APK提供默认URL,android,android-instant-apps,rollout,google-play-console,Android,Android Instant Apps,Rollout,Google Play Console,我需要为一个即时应用程序准备一个Alpha测试,它在Android Studio上运行得很好,但当我试图在PlayStore中推出它时,它失败了,我说: 您必须为即时应用程序APK提供默认URL 应用程序结构使用三个模块完成: -base:它包含所有代码 -apk:获取可安装apk的包装器 -instantApp:获取instantApp apk的包装器 这是build.gradles: build.gradle buildscript { repositories {

我需要为一个即时应用程序准备一个Alpha测试,它在Android Studio上运行得很好,但当我试图在PlayStore中推出它时,它失败了,我说:

您必须为即时应用程序APK提供默认URL

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

-base:它包含所有代码

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

-instantApp:获取instantApp apk的包装器

这是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"
}
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 {
    [...]
}
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')
}
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')
}
base/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"
}
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 {
    [...]
}
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')
}
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')
}
apk/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"
}
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 {
    [...]
}
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')
}
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')
}
instantApp/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"
}
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 {
    [...]
}
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')
}
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')
}
这是清单文件

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>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="..." />

[…]
apk/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>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="..." />

此软件包与应用程序的软件包不同

任何想法都可能很棒


提前感谢

您还必须在清单中添加默认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>

该链接不再包含对默认URL的引用。您能解释一下为什么它仍然是一个需求,以及默认url的作用吗?以及为什么它在活动中,而不是整个应用程序中?我似乎找不到这方面的任何文档。