Closed tangdi0802 closed 6 years ago
It clearly says: Error:Could not find com.android.support:appcompat-v7:27.1.0. try to add this to your project build Gradle:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
you are missing repos in build.gradle. Please follow instructions from here https://github.com/ivpusic/react-native-image-crop-picker#android-1
Use Android SDK >= 26 (android/app/build.gradle) android { compileSdkVersion 27 buildToolsVersion "27.0.3" ...
defaultConfig {
...
targetSdkVersion 27
...
}
...
} Can we change the compileSdkVersion of our project?
this is my gradle version apply plugin: "com.android.application" apply plugin: 'com.neenbedankt.android-apt' import com.android.build.OutputFile
/**
react-native bundle
with the correct arguments during the Android buildapply from: "../../node_modules/react-native/react.gradle"
line.project.ext.react = [ entryFile: "index.js" ]
apply from: "../../node_modules/react-native/react.gradle"
/**
/**
android { signingConfigs { debug { keyAlias 'indu' keyPassword 'indu8888' storeFile file('../induRelease.jks') storePassword 'indu8888' } } compileSdkVersion 27 buildToolsVersion "27.0.3" defaultConfig { applicationId "com.indu" minSdkVersion 16 targetSdkVersion 27 versionCode 1 versionName "1.0.0" ndk { abiFilters "armeabi-v7a", "x86" }
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
manifestPlaceholders = [qqappid: "tencent1106792195"]
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "armeabi"
}
}
/*signingConfigs {
debug {
storeFile file('induRelease')
storePassword "indu8888"
keyAlias "indu"
keyPassword "indu8888"
}
}*/
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
dexOptions {
javaMaxHeapSize "4g"
}
/*----------------------------------渠道包配置------------------------------------*/
productFlavors {
yd001{}
yd002{}
yd003{}
yd004{}
yd005{}
yd006{}
yd007{}
yd008{}
yd009{}
yd010{}
yd011{}
yd012{}
yd013{}
yd014{}
yd015{}
yd016{}
yd017{}
yd018{}
yd019{}
yd020{}
in001{}
in002{}
in003{}
in004{}
in005{}
in006{}
in007{}
in008{}
in009{}
in010{}
in011{}
in012{}
in013{}
in014{}
in015{}
in016{}
in017{}
in018{}
in019{}
in020{}
official{}
}
productFlavors.all { flavor ->
flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName = outputFile.name.replace(".apk", "-${defaultConfig.versionName}.apk")
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
/*----------------------------------渠道包配置------------------------------------*/
}
dependencies { compile project(':react-native-spinkit') compile project(':react-native-fs') compile project(':react-native-image-crop-picker') compile project(':react-native-device-info') compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.facebook.react:react-native:+'
// From node_modules
/*===========================第三方依赖==========================*/
compile 'com.github.hotchemi:permissionsdispatcher:3.0.1'
//apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.3'
apt "com.github.hotchemi:permissionsdispatcher-processor:3.0.1"
//http
//Retrofit
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
//GSON
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
//请求日志
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
//RXjava
compile 'io.reactivex:rxandroid:1.2.0'
//Rxjava专门针对anroid封装的RxAndroid
//compile 'io.reactivex:rxjava:1.1.5'
//七鱼
compile 'com.qiyukf.unicorn:unicorn:+'
//图片加载框架
compile 'com.squareup.picasso:picasso:2.5.2'
//bugly
compile 'com.tencent.bugly:crashreport:latest.release'
//其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如2.1.9
compile 'com.tencent.bugly:nativecrashreport:latest.release'
//其中latest.release指代最新Bugly NDK版本号,也可以指定明确的版本号,例如3.0
/*---------------------------------友盟 推送------------------------------------------*/
//PushSDK必须依赖基础组件库,所以需要加入对应依赖
compile 'com.umeng.sdk:common:1.5.0'
//PushSDK必须依赖utdid库,所以需要加入对应依赖
compile 'com.umeng.sdk:utdid:1.1.5.3'
//PushSDK
compile 'com.umeng.sdk:push:4.1.0'
/*---------------------------------友盟------------------------------------------*/
/*---------------------------------友盟分享------------------------------------------*/
/*---------------------------------友盟------------------------------------------*/
compile project(':react-native-vector-icons')
compile files('src/libs/open_sdk_r5990_lite.jar')
compile files('src/libs/umeng-common-1.5.1.jar')
compile files('src/libs/umeng-debug-1.0.0.jar')
compile files('src/libs/umeng-share-core-6.9.1.jar')
compile files('src/libs/umeng-share-QQ-full-6.9.1.jar')
compile files('src/libs/umeng-share-wechat-full-6.9.1.jar')
compile files('src/libs/umeng-sharetool-6.9.1.jar')
compile files('src/libs/wechat-sdk-android-without-mta-5.1.4.jar')
compile files('src/libs/umeng-share-QQ-simplify-6.9.1.jar')
compile files('src/libs/umeng-share-wechat-simplify-6.9.1.jar')
compile files('src/libs/umeng-shareboard-widget-6.9.1.jar')
}
// Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.compile into 'libs' }
Version
Tell us which versions you are using:
Platform
Tell us to which platform this issue is related
rootProject.name = 'FinancialManager' include ':react-native-image-crop-picker' project(':react-native-image-crop-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-crop-picker/android') include ':react-native-fs' project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android') include ':react-native-spinkit' project(':react-native-spinkit').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-spinkit/android') include ':react-native-device-info' project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':app'
Error:Could not find com.android.support:appcompat-v7:27.1.0. Required by: FinancialManager:app:unspecified FinancialManager:app:unspecified > com.facebook.react:react-native:0.54.0
Please install the Android Support Repository from the Android SDK Manager. Open Android SDK Manager