[英]Android gradle version is not updating
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.dk"
minSdkVersion 22
targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
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:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:support-vector-drawable:26.1.0'
implementation 'com.android.support:support-annotations:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.2'
implementation 'com.google.firebase:firebase-storage:16.0.2'
implementation 'com.google.firebase:firebase-messaging:17.3.2'
implementation 'com.google.firebase:firebase-firestore:17.1.0'
//different ui screens
implementation 'com.intuit.sdp:sdp-android:1.0.5'
// circular imageview
implementation 'de.hdodenhof:circleimageview:2.2.0'
// to load image from url
implementation 'com.squareup.picasso:picasso:2.71828'
//to create cardview
implementation 'com.android.support:cardview-v7:26.1.0'
//to implement google map
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.code.gson:gson:2.8.4'
implementation 'com.google.android.gms:play-services-nearby:15.0.1'
//recycler swipe to delete item
implementation "com.daimajia.swipelayout:library:1.2.0@aar"
// country code picker
implementation 'com.github.joielechong:countrycodepicker:2.1.5'
// to load gif
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
}
apply plugin: 'com.google.gms.google-services'
以下是我的 logcat 錯誤,
error: method does not override or implement a method from a supertype
error: cannot find symbol method getWindow()
error: cannot find symbol method getWindow()
error: cannot find symbol method getSupportFragmentManager()
error: incompatible types: OnboardingActivity cannot be converted to Context
error: cannot find symbol method findViewById(int)
error: cannot find symbol method findViewById(int)
error: cannot find symbol method findViewById(int)
error: incompatible types: OnboardingActivity cannot be converted to Context
error: incompatible types: OnboardingActivity cannot be converted to Context
error: cannot find symbol method finish()
error: method does not override or implement a method from a supertype
error: method does not override or implement a method from a supertype
error: method does not override or implement a method from a supertype
error: cannot find symbol method setContentView(int)
error: cannot find symbol method findViewById(int)
error: cannot find symbol method findViewById(int)
error: cannot find symbol method startActivity(Intent)
error: incompatible types: PhoneNumberLogin cannot be converted to Context
error: method does not override or implement a method from a supertype
error: cannot find symbol method getApplicationContext()
error: cannot find symbol method finish()
error: no suitable method found for addOnCompleteListener(PhoneNumberLogin,<anonymous OnCompleteListener<AuthResult>>)
method Task.addOnCompleteListener(Executor,OnCompleteListener<AuthResult>) is not applicable
(argument mismatch; PhoneNumberLogin cannot be converted to Executor)
method Task.addOnCompleteListener(Activity,OnCompleteListener<AuthResult>) is not applicable
(argument mismatch; PhoneNumberLogin cannot be converted to Activity)
error: cannot find symbol method startActivity(Intent)
error: cannot find symbol method getApplicationContext()
error: cannot find symbol method finish()
error: incompatible types: ProgressCircleActivity cannot be converted to Context
error: cannot find symbol method startActivity(Intent)
Gradle 同步失敗。 所有java文件都給出錯誤我試圖更改版本並同步gradle但錯誤保持不變。
在 java 文件上下文中,appCompactActivity、Intent、startActivity、firebaseStorage這些組件對我不起作用。 到目前為止,我一直在努力解決這個問題,我無法找到解決方案。
請幫我修復。
您缺少targetSdkVersion
targetSdkVersion 26
嘗試刪除構建文件夾和 gradle 緩存,然后清理您的項目並運行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.