android项目它得到一些与ANDROID_SDK_HOME相关的错误
Posted
技术标签:
【中文标题】android项目它得到一些与ANDROID_SDK_HOME相关的错误【英文标题】:android project its getting some error related to ANDROID_SDK_HOME 【发布时间】:2021-11-03 09:22:12 【问题描述】:(当我尝试运行项目时)错误是 构建文件 'C:\Users\jupun\Desktop\trid-7\codecanyon-22842942-trid-city-guide-android-native -with-admin-panel-firebase\Trid-Android-Package\Android 代码\Trid-CityGuide_v7\app\build.gradle' 行:1
评估项目 ':app' 时出现问题。
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。未能应用插件“com.android.internal.application”。 ANDROID_SDK_HOME 设置为 SDK 的根目录:C:\Users\jupun\AppData\Local\Android\Sdk ANDROID_SDK_HOME 是 Android 工具所期望的首选项文件夹的父路径。 现在已弃用。
gradle.build
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'realm-android'
buildscript
repositories
jcenter()
google()
dependencies
classpath 'com.android.tools.build:gradle:7.0.1'
// classpath 'io.fabric.tools:gradle:1.+'
// classpath "io.realm:realm-gradle-plugin:4.2.0"
classpath "io.realm:realm-gradle-plugin:5.11.0"
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
repositories
mavenCentral()
jcenter()
google()
maven url 'https://maven.fabric.io/public'
maven
url "https://oss.sonatype.org/content/repositories/snapshots"
android
compileSdkVersion 28
buildToolsVersion '31.0.0'
defaultConfig
applicationId "com.tripeka.travel" // "com.bpackingapp.vietnam.travel"// "com.traveeva.android"//"com.rwandadestinations.android"
// "com.traveeva.android"// "com.rhodes.guide" "com.rwandadestinations.android"
// com.bpackingapp.vietnam.travel
minSdkVersion 21
targetSdkVersion 28
versionCode 21
versionName "1.14"
multiDexEnabled true
resValue "string", "google_maps_key", (project.findProperty("GOOGLE_MAPS_API_KEY") ?: "")
dexOptions
jumboMode = true
javaMaxHeapSize "4g" //specify the heap size for the dex process
buildTypes
release
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt')
splits
abi
enable true
reset()
include 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'arm64-v8a'
universalApk false
packagingOptions
// exclude "lib/arm64-v8a/librealm-jni.so"
// exclude "lib/armeabi/librealm-jni.so"
// exclude "lib/mips/librealm-jni.so"
// exclude "lib/x86_64/librealm-jni.so"
// exclude "lib/x86/librealm-jni.so"
lintOptions
checkReleaseBuilds false
abortOnError false
configurations.all
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
dependencies
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
implementation 'com.google.firebase:firebase-analytics:17.5.0'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0',
exclude group: 'com.android.support', module: 'support-annotations'
)
// List view animation
// Slider Image
// compile 'com.firebase:firebase-client-android:2.0.3+'
// compile('com.facebook.android:facebook-android-sdk:4.23.0')
//noinspection GradleCompatible
implementation 'androidx.appcompat:appcompat:1.0.0'
//
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
//
implementation 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
//
implementation 'com.nhaarman.listviewanimations:lib-core-slh:3.1.0@aar'
//
implementation 'com.google.android.gms:play-services:11.6.2'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.google.firebase:firebase-core:11.6.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5@aar'
implementation 'com.google.firebase:firebase-auth:11.6.2'
implementation 'com.facebook.android:facebook-android-sdk:4.23.+'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
implementation 'pl.charmas.android:android-reactive-location:0.10@aar'
implementation 'com.google.android.gms:play-services-location:11.6.2'
implementation 'com.google.android.gms:play-services-places:11.6.2'
implementation 'io.reactivex:rxjava:1.2.0'
implementation 'com.github.zurche:open-weather-map-android-wrapper:v0.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// compile 'io.realm:realm-android:4.2.0'
implementation 'com.timehop.stickyheadersrecyclerview:library:[0.4.3]@aar'
implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
testImplementation 'junit:junit:4.12'
implementation 'org.solovyev.android.views:linear-layout-manager:0.5@aar'
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation 'com.google.android.gms:play-services-ads:11.6.2'
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
【问题讨论】:
【参考方案1】:Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
当您更新 gradle.build 中的任何库时,通常会发生此错误 尝试回滚您更新的任何最新库。
【讨论】:
我修复了,但又出现了一个错误系统找不到指定的路径 我期待解决这个问题。在那之前尝试 => ***.com/questions/37086806/…【参考方案2】:在我的情况下,我不得不更改为类似的东西:
export ANDROID_HOME=/home/$USER/Android
export ANDROID_SDK_ROOT=$ANDROID_HOME/Sdk
而android sdk位于:/home/$USER/Android/Sdk
操作系统:Ubuntu 20.04
【讨论】:
以上是关于android项目它得到一些与ANDROID_SDK_HOME相关的错误的主要内容,如果未能解决你的问题,请参考以下文章