Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.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
app:transformClassesWithJarMergingForDebug,com.android.build.api.transform.TransformException:java.util.zip.zipeException:_Android_Android Studio_Android Gradle Plugin_Google Play Services - Fatal编程技术网

app:transformClassesWithJarMergingForDebug,com.android.build.api.transform.TransformException:java.util.zip.zipeException:

app:transformClassesWithJarMergingForDebug,com.android.build.api.transform.TransformException:java.util.zip.zipeException:,android,android-studio,android-gradle-plugin,google-play-services,Android,Android Studio,Android Gradle Plugin,Google Play Services,首先,我知道有很多类似的问题,但我的情况不同。请先阅读完整的问题 这是全部错误 Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/firebase/appindexi

首先,我知道有很多类似的问题,但我的情况不同。请先阅读完整的问题

这是全部错误

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/firebase/appindexing/Action$Builder$StatusType.class
每当我试图在模拟器中运行时,就会显示此错误

另外,如果我尝试生成.apk文件(在调试或发布模式下),也会显示相同的错误

现在是魔法

如果我在调试模式下运行我的手机,它是完全正常的。没有显示错误,运行正常

这是我的清单文件

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

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

    <application
        android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@drawable/iconpetbazar"
        android:label="@string/app_name"
        android:theme="@style/Theme.AppCompat.Light">
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <activity
            android:name=".MainActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <!--
     ATTENTION: This was auto-generated to add Google Play services to your project for
     App Indexing.  See https://g.co/AppIndexing/AndroidStudio for more information.
        -->
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name=".LoginActivity"
            android:label="@string/title_activity_login"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
        <activity android:name=".WebActivity" />
        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.facebook.CustomTabActivity"
            android:exported="true"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

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

                <data android:scheme="@string/fb_login_protocol_scheme" />
            </intent-filter>
        </activity>
        <activity
            android:name=".BuyerSellerActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
        <activity
            android:name=".OptionActivity"
            android:label="@string/title_activity_option"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
        <activity
            android:name=".TakeAdInfoActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
    </application>

</manifest>
使用sdk平台

姜饼、蜂窝状、棉花糖

将emulator与Jelly Bean一起使用


任何人都知道如何解决它,请帮助

您应该使用相同级别的库:

compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-appindexing:10.0.1'
还可以在文件的按钮处添加:

apply plugin: 'com.google.gms.google-services'
编辑:
要使用插件,您必须在
buildscript
块(在顶级文件或模块文件中)中添加依赖项:


您应该使用相同级别的库:

compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-appindexing:10.0.1'
还可以在文件的按钮处添加:

apply plugin: 'com.google.gms.google-services'
编辑:
要使用插件,您必须在
buildscript
块(在顶级文件或模块文件中)中添加依赖项:


错误:(39,13)未能解析:com.google.android.gms:play services appindexing:安装存储库和同步项目单击“安装存储库和同步项目”时。。。什么也没发生另一个错误。。。错误:(45,0)找不到id为“com.google.gms.google services”的插件。@SayanMukherjee要使用该插件,必须在gradle文件的buildscript块中添加依赖项。错误:(39,13)未能解析:com.google.android.gms:play services appindexing:Install Repository and sync project单击Install Repository and sync project时。。。什么也没发生另一个错误。。。错误:(45,0)找不到id为“com.google.gms.google services”的插件。@SayanMukherjee若要使用该插件,必须在gradle文件的buildscript块中添加依赖项。