我的 gradle 一直有问题。这
implementation 'com.android.support:appcompat-v7:28.0.0'
红色下划线
这阻止了我继续我的开发(我对 android 还是很陌生)。我的问题最初始于
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
在红色下划线并导致错误,但将我的导入更改为
import androidx.fragment.app.FragmentActivity;
解决了这个问题,但我的 gradle 仍然有构建问题。我有 android 3.4,我的 gradle 包装器是 5.1.1。我不知道如何阻止错误发生并摆脱我的 gradle 错误。
我已将其更改为 alpha1、rc01 并尝试降级版本但它不起作用。
依赖项是我出现问题的地方:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha7'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
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'
}
我只是希望 gradle 能够充分工作并能够继续前进哈哈,我一直在尝试解决这个问题......
![[1]:https://i.imgur.com/ZYLhZQN.png](https://i.stack.imgur.com/tuZiA.png)