android - React-native 找不到包 android.support.v7.app
问题描述
我遇到了这个非常烦人的错误,它不会让我构建......它说它找不到包 android.support.v7.app 错误遍布我的 SplashScreen js 文件
error: package android.support.v7.app does not exist
import android.support.v7.app.AppCompatActivity;
^
D:\FifaLeagueApp\FifaIL\android\app\src\main\java\com\fifail\SplashActivity.java:7: error: cannot find symbol
public class SplashActivity extends AppCompatActivity {
^
我会提供我的 gradles(我认为问题来自他们,但我不知道究竟是什么原因造成的)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:3.4.2')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
}
...
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
...
defaultConfig {
applicationId "com.fifail"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
...
dependencies {
implementation project(':react-native-vector-icons')
implementation project(':react-native-splash-screen')
implementation project(':react-native-restart')
implementation project(':react-native-gesture-handler')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "com.facebook.react:react-native:+" // From node_modules
}
....
}
解决方案
推荐阅读
- javascript - AWS 扩大认知用户
- c++ - 二进制加法从左到右携带
- python-3.x - 嵌套循环中未定义的全局变量
- jestjs - Vuetify Jest 测试简单
- reactjs - 具有相对路径部署的 React Router
- java - Jide DockableFrame:如何将 WindowListener 用于我的对接框架?
- android - 更改区域设置时,来自应用程序的 getResources 未更新。只有 Activity getResources 正确更新
- spring-boot - 使用 Hikari 连接池的 Spring Boot 不起作用
- android - 在 XML 中使用 onClick 时,Google SignInButton 不会触发
- javascript - 在条形图中从底部向上提起条形