Android не импортирует / не синхронизирует внешние библиотеки - PullRequest
0 голосов
/ 05 июля 2018

Я недавно сменил операционную систему Windows и недавно установленную Android Studio. Я клонировал свой проект Android от Git, который работает отлично. Но теперь в последней вещи его не работает. Я не знаю, чего не хватает. импортировать классы с ошибкой
Я не менял файлы Gradle. Файл Gradle уровня моего проекта.

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven {
           url 'https://maven.google.com/'
           name 'Google'
       }
      //maven { url "http://jcenter.bintray.com"}
      google()
   }
   dependencies {
      classpath 'com.android.tools.build:gradle:3.1.3'
      classpath 'com.google.gms:google-services:4.0.1'
      // NOTE: Do not place your application dependencies here; they belong
      // in the individual module build.gradle files
   }
  }
  allprojects {
   repositories {
      jcenter()
      // maven { url "http://jcenter.bintray.com"}
      mavenCentral()
      google()
      maven { url 'https://jitpack.io' }
   }
 }
 task clean(type: Delete) {
   delete rootProject.buildDir
 }

Файл Gradle уровня моего приложения

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
         classpath 'io.fabric.tools:gradle:1.25.4'
    }
}
 apply plugin: 'com.android.application'
 apply plugin: 'io.fabric'

 repositories {
    maven { url 'https://maven.fabric.io/public' }
    google()
    jcenter()
 }

 android {
     compileSdkVersion 27
     buildToolsVersion '27.0.3'
     useLibrary 'org.apache.http.legacy'
     defaultConfig {
         applicationId "com.cir****.d********"
         vectorDrawables.useSupportLibrary = true
         minSdkVersion 16
         targetSdkVersion 27
         versionCode 40
         versionName "6.1.0"
         multiDexEnabled true
     }

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

packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'
    exclude 'META-INF/services/javax.ws.rs.ext.MessageBodyReader'
    exclude 'META-INF/services/javax.ws.rs.ext.MessageBodyWriter'
    exclude 'META-INF/jersey-module-version'
    exclude 'META-INF/services/com.sun.jersey.spi.inject.InjectableProvider'
}
dexOptions {
    javaMaxHeapSize "4g"
}
lintOptions {
    checkReleaseBuilds false
    abortOnError false
}
aaptOptions
        {
            cruncherEnabled = false
        }
}

dependencies {
    implementation 'com.google.firebase:firebase-crash:16.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-storage:16.0.1'
    implementation 'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.google.firebase:firebase-messaging:17.1.0'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation files('libs/gson-2.2.4.jar')
    implementation files('libs/json-simple-1.1.jar')
    implementation files('libs/httpmime-4.0.1.jar')
    implementation files('libs/PGSDK_V2.1')
    implementation files('libs/apache-mime4j-0.6.jar')
    implementation files('libs/hibernate-jpa-2.0-api-1.0.1.Final.jar')
    implementation 'com.makeramen:roundedimageview:2.3.0'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services-gcm:15.0.1'
    implementation 'com.google.android.gms:play-services-vision:15.0.2'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'me.leolin:ShortcutBadger:1.1.4@aar'
    implementation 'com.edwardvanraak:MaterialBarcodeScanner:0.0.6-ALPHA'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.razorpay:checkout:1.4.7'
    implementation 'com.msg91.sendotp.library:library:2.8'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.android.volley:volley:1.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
       transitive = true
    }
   implementation 'com.wang.avi:library:2.1.3'
   implementation 'com.github.amlcurran.showcaseview:library:5.4.3'
   implementation 'gun0912.ted:tedbottompicker:1.1.0'
   implementation 'com.kofigyan.stateprogressbar:stateprogressbar:0.0.6'
   implementation 'com.google.android.gms:play-services-analytics:16.0.1'
}
apply plugin: 'com.google.gms.google-services'

Я сделал Очистить, Восстановить, аннулировать кэши / Перезапустить, синхронизировать проект с файлами Gradle, удалил папку .gradle и потратил впустую 1 день, пытаясь решить эту проблему. Я готов поделиться дальнейшим кодом, если требуется.

1 Ответ

0 голосов
/ 08 июля 2018

После нескольких дней чесания головы я решил эту головную боль по-другому. Выдает вышеуказанную ошибку, если я клонирую основную ветку через ключ SSH. Так что за след я слил все развивающиеся ветки и клонировал. Головная боль все еще там.
Поэтому я открыл Git Bash и клонировал определенную ветку (не master), которая принадлежит мне, с помощью следующей команды.
git clone --single-branch -b sub_branch_name url
Проблема решена на данный момент. Я не знаю, в чем проблема с основной веткой.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...