1

Androidスタジオを初めて使用していて、Googleログインを追加しようとしましたが、クライアントを作成した後に途中で失われてしまいましたID、私はその考えを放棄した。それから、ナビゲーション・ドロワー(https://www.youtube.com/watch?v=ju837bQOBfgを参照)を追加することを考えましたが、それを実行した後、エラーが表示されます。設定 ':app:_debugApkCopy'の依存関係をすべて解決できませんでした。 com.google.android.gmsが見つかりませんでした:play-services-appindexing:10.0.1

エラー:プロジェクト ':app'の構成中に問題が発生しました。

Could not resolve all dependencies for configuration ':app:_debugApkCopy'. Could not find com.google.android.gms:play-services-appindexing:10.0.1. Required by: WebLearn:app:unspecified

これは私のビルドのGradleです:モジュールのアプリ - >

apply plugin: 'com.android.application' 
//apply plugin: 'com.google.gms.google-services' 
apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.1" 
    defaultConfig { 
     applicationId "com.beta.android.aakashresearchlabs.weblearn" 
     minSdkVersion 22 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.0.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4' 
    compile 'com.google.android.gms:play-services:10.0.1' 
    compile 'com.google.android.gms:play-services-auth:10.0.1' 
    compile 'com.google.android.gms:play-services-appindexing:10.0.1' 
    compile 'com.android.support:design:25.0.1' 
    testCompile 'junit:junit:4.12' 
    compile 'com.google.android.gms:play-services-appindexing:10.0.1' 
    compile 'com.android.support:support-annotations:25.0.1' 
    compile 'com.android.support:support-v4:25.0.0' 
} 

は、これは私のMainActivity JAVAコードです:

package com.beta.android.aakashresearchlabs.weblearn; 

import android.net.Uri; 
import android.os.Bundle; 
import android.support.design.widget.FloatingActionButton; 
import android.support.design.widget.NavigationView; 
import android.support.design.widget.Snackbar; 
import android.support.v4.view.GravityCompat; 
import android.support.v4.widget.DrawerLayout; 
import android.support.v7.app.ActionBarDrawerToggle; 
import android.support.v7.app.AppCompatActivity; 
import android.support.v7.widget.Toolbar; 
import android.view.Menu; 
import android.view.MenuItem; 
import android.view.View; 

import com.google.android.gms.appindexing.Action; 
import com.google.android.gms.appindexing.AppIndex; 
import com.google.android.gms.appindexing.Thing; 
import com.google.android.gms.common.api.GoogleApiClient; 

public class MainActivity extends AppCompatActivity 
     implements NavigationView.OnNavigationItemSelectedListener { 

    /** 
    * ATTENTION: This was auto-generated to implement the App Indexing API. 
    * See https://g.co/AppIndexing/AndroidStudio for more information. 
    */ 
    private GoogleApiClient client; 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_main); 
     Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 
     setSupportActionBar(toolbar); 

     FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); 
     fab.setOnClickListener(new View.OnClickListener() { 
      @Override 
      public void onClick(View view) { 
       Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) 
         .setAction("Action", null).show(); 
      } 
     }); 

     DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); 
     ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
       this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); 
     drawer.setDrawerListener(toggle); 
     toggle.syncState(); 

     NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); 
     navigationView.setNavigationItemSelectedListener(this); 
     // ATTENTION: This was auto-generated to implement the App Indexing API. 
     // See https://g.co/AppIndexing/AndroidStudio for more information. 
     client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build(); 
    } 

    @Override 
    public void onBackPressed() { 
     DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); 
     if (drawer.isDrawerOpen(GravityCompat.START)) { 
      drawer.closeDrawer(GravityCompat.START); 
     } else { 
      super.onBackPressed(); 
     } 
    } 

    @Override 
    public boolean onCreateOptionsMenu(Menu menu) { 
     // Inflate the menu; this adds items to the action bar if it is present. 
     getMenuInflater().inflate(R.menu.main, menu); 
     return true; 
    } 

    @Override 
    public boolean onOptionsItemSelected(MenuItem item) { 
     // Handle action bar item clicks here. The action bar will 
     // automatically handle clicks on the Home/Up button, so long 
     // as you specify a parent activity in AndroidManifest.xml. 
     int id = item.getItemId(); 

     //noinspection SimplifiableIfStatement 
     if (id == R.id.action_settings) { 
      return true; 
     } 

     return super.onOptionsItemSelected(item); 
    } 

    @SuppressWarnings("StatementWithEmptyBody") 
    @Override 
    public boolean onNavigationItemSelected(MenuItem item) { 
     // Handle navigation view item clicks here. 
     int id = item.getItemId(); 
     android.app.FragmentManager fragmentManager = getFragmentManager(); 
     if (id == R.id.nav_camera) { 

      fragmentManager.beginTransaction() 
        .replace(R.id.content_frame, new FirstFragment()).commit(); 
      // Handle the camera action 
     } else if (id == R.id.nav_gallery) { 
      fragmentManager.beginTransaction() 
        .replace(R.id.content_frame, new SecondFragment()).commit(); 

     } else if (id == R.id.nav_slideshow) { 
      fragmentManager.beginTransaction() 
        .replace(R.id.content_frame, new ThirdFragment()).commit(); 

     } else if (id == R.id.nav_manage) { 

     } else if (id == R.id.nav_share) { 

     } else if (id == R.id.nav_send) { 

     } 

     DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); 
     drawer.closeDrawer(GravityCompat.START); 
     return true; 
    } 

    /** 
    * ATTENTION: This was auto-generated to implement the App Indexing API. 
    * See https://g.co/AppIndexing/AndroidStudio for more information. 
    */ 
    public Action getIndexApiAction() { 
     Thing object = new Thing.Builder() 
       .setName("Main Page") // TODO: Define a title for the content shown. 
       // TODO: Make sure this auto-generated URL is correct. 
       .setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]")) 
       .build(); 
     return new Action.Builder(Action.TYPE_VIEW) 
       .setObject(object) 
       .setActionStatus(Action.STATUS_TYPE_COMPLETED) 
       .build(); 
    } 

    @Override 
    public void onStart() { 
     super.onStart(); 

     // ATTENTION: This was auto-generated to implement the App Indexing API. 
     // See https://g.co/AppIndexing/AndroidStudio for more information. 
     client.connect(); 
     AppIndex.AppIndexApi.start(client, getIndexApiAction()); 
    } 

    @Override 
    public void onStop() { 
     super.onStop(); 

     // ATTENTION: This was auto-generated to implement the App Indexing API. 
     // See https://g.co/AppIndexing/AndroidStudio for more information. 
     AppIndex.AppIndexApi.end(client, getIndexApiAction()); 
     client.disconnect(); 
    } 
} 

これは私のAndroidManifestのXMLファイルです - >

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

    <!-- 
     The ACCESS_COARSE/FINE_LOCATION permissions are not required to use 
     Google Maps Android API v2, but you must specify either coarse or fine 
     location permissions for the 'MyLocation' functionality. 
    --> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 

    <!-- To auto-complete the email text field in the login form with the user's emails --> 
    <uses-permission android:name="android.permission.GET_ACCOUNTS" /> 
    <uses-permission android:name="android.permission.READ_PROFILE" /> 
    <uses-permission android:name="android.permission.READ_CONTACTS" /> 

    <application 
     android:allowBackup="true" 
     android:label="@string/app_name" 
     android:supportsRtl="true" 
     android:theme="@style/Theme.AppCompat.Light.NoActionBar"> 
     <activity android:name=".HomeScreen"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity android:name=".Basics1" /> 
     <activity 
      android:name=".MainActivity" 
      android:label="@string/title_activity_main" 
      android:theme="@style/Theme.AppCompat.Light.NoActionBar"></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" /> 
    </application> 

</manifest> 

エラーの原因を見つけるためにさらに詳しい情報やファイルが必要な場合は、私にお知らせください。私のAndroidリポジトリは最新です。

+0

問題を解決しましたか?私は今同じ問題に直面しています。任意のヘルプ –

答えて

0

解決策がまだ見つからない場合は、hereを参照してください。 ConstraintLayoutのサポートライブラリをインストールする必要があります。

0

私は同じ問題に直面しており、ルートレベルの依存関係を変更して解決しました。

dependencies { 
    classpath 'com.android.tools.build:gradle:2.2.2' 
    classpath 'com.google.gms:google-services:3.0.0' 
} 
関連する問題