我下载了LeafPic-master项目(这是Android Studio的画廊源代码),并尝试将minsdkversion和targetSdkVersion(我将在Android 4.4上安装应用程序的内容更改为最新的android api),但是我遇到了一些我可以解决的错误无法解决它们。什么是解决方案?
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}
apply plugin: 'com.android.library'
repositories {
jcenter()
maven { url "http://repo1.maven.org/maven2" }
maven { url "http://dl.bintray.com/dasar/maven" }
}
android {
compileSdkVersion 29
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0.0"
}
lintOptions {
disable 'MissingTranslation'
disable 'ExtraTranslation'
}
// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
additionalParameters "--no-version-vectors"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:palette-v7:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.koushikdutta.ion:ion:2.1.7'
implementation 'com.mikepenz:iconics-core:3.0.3@aar'
implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar'
implementation 'com.mikepenz:community-material-typeface:2.0.46.1@aar'
implementation 'com.mikepenz:fontawesome-typeface:4.7.0.2@aar'
implementation "com.mikepenz:iconics-views:3.0.3@aar"
implementation 'com.github.paolorotolo:appintro:3.4.0'
implementation 'com.yalantis:ucrop:1.5.0'
implementation 'uz.shift:colorpicker:0.5@aar'
implementation 'com.balysv:material-ripple:1.0.2'
implementation 'com.commit451:PhotoView:1.2.5'
implementation 'com.google.android.exoplayer:exoplayer:r1.5.7'
implementation 'de.psdev.licensesdialog:licensesdialog:1.8.3'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.drewnoakes:metadata-extractor:2.11.0'
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'co.ronash.android:pushe-base:1.3.3'
api 'com.google.android.gms:play-services-gcm:17.0.0
错误:
Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that matches com.google.android.gms:play-services-iid:[17.0.0].
Open File
Show Details
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not find any version that matches com.google.android.gms:play-services-iid:[17.0.0].
Open File
Show Details
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not find any version that matches com.google.android.gms:play-services-iid:[17.0.0].
Open File
Show Details
Unable to resolve dependency for ':app@release/compileClasspath': Could not find any version that matches com.google.android.gms:play-services-iid:[17.0.0].
Open File
Show Details
Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not find any version that matches com.google.android.gms:play-services-iid:[17.0.0].
Open File
Show Details
和Manifest.xml文件是:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.farasource.gallery">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission
android:name="com.farasource.gallery.permission.C2D_MESSAGE" />
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission
android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission
android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION"/>
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/Theme.AppCompat"
tools:replace="android:appComponentFactory"
android:appComponentFactory="whateverString">
<activity
android:name=".PlayerActivity"
android:configChanges="orientation|screenSize"
android:label="@string/video_player"
android:launchMode="singleInstance"
android:theme="@style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="content" />
<data android:scheme="asset" />
<data android:scheme="file" />
<data android:mimeType="video/*" />
</intent-filter>
</activity>
<activity
android:name=".IntroActivity"
android:label="Intro Activity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen" />
<activity
android:name=".SplashScreen"
android:theme="@style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.APP_GALLERY" />
</intent-filter>
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
</intent-filter>
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
</intent-filter>
<intent-filter>
<action android:name="com.farasource.gallery.OPEN_ALBUM" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.albumsAct" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".PhotoPagerActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:parentActivityName=".MainActivity"
android:theme="@style/Theme.AppCompat.NoActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
<intent-filter>
<action android:name="android.intent.action.albumPhoto" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="com.android.camera.action.REVIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
</intent-filter>
</activity>
<activity
android:name=".SettingsActivity"
android:theme="@style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.SETTING" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".AboutActivity"
android:theme="@style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.ABOUT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".SecurityActivity"
android:label="@string/security"
android:theme="@style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.SECURITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ExcludedAlbumsActivity"
android:label="@string/excluded_albums"
android:theme="@style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.ExcludedAlbums" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar" />
<meta-data
android:name="com.farasource.gallery.CustomGlideModule"
android:value="GlideModule" />
<activity android:name=".About" />
<activity android:name=".OtherActivity"></activity>
<receiver android:name="co.ronash.pushe.receiver.UpdateReceiver" >
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<data
android:path="com.farasource.gallery"
android:scheme="package" />
</intent-filter>
</receiver>
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
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" />
<category android:name="com.farasource.gallery" />
</intent-filter>
</receiver>
<meta-data android:name="co.ronash.pushe.token" android:value="PUSHE_375572161916"/>
<meta-data android:name="co.ronash.pushe.cr" android:value="aHR0cDovLzdmOWRlNWQ0NzMyOTRhOTliNzU3ODk1MjMwYmQ4N2VkOjBkMmY2YWFiZjVmMjQ3YjdiY2NhOTJiMjBlYjdlN2FlQGNhLnB1c2hlLmlyLzYxNQ=="/>
</application>
</manifest>
答案 0 :(得分:0)
在google()
块中添加repositories
仓库:
repositories {
google() //<---
jcenter()
maven { url "http://repo1.maven.org/maven2" }
maven { url "http://dl.bintray.com/dasar/maven" }
}