Mic*_*heo 5 android npm kotlin react-native expo
几个小时前,我在 Android 上运行 React Native 应用程序时没有任何问题。甚至它也成功地构建在 Azure DevOps 上。
直到我尝试再次运行该应用程序时,发生了这种情况:
* What went wrong:
Execution failed for task ':expo-splash-screen:compileDebugKotlin'.
> Compilation error. See log for more details
Run Code Online (Sandbox Code Playgroud)
我跟踪日志并显示以下消息:
> Task :expo-splash-screen:compileDebugKotlin FAILED
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
/Users/s000-50105204/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.6.10/e80fe6ac3c3573a80305f5ec43f86b829e8ab53d/kotlin-stdlib-jdk8-1.6.10.jar (version 1.6)
/Users/s000-50105204/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.6.10/e1c380673654a089c4f0c9f83d0ddfdc1efdb498/kotlin-stdlib-jdk7-1.6.10.jar (version 1.6)
/Users/s000-50105204/.gradle/caches/transforms-2/files-2.1/ecefa6f1392695b7079790a9cdc8d4ee/jetified-kotlin-reflect-1.3.50.jar (version 1.3)
/Users/s000-50105204/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.10/b8af3fe6f1ca88526914929add63cf5e7c5049af/kotlin-stdlib-1.6.10.jar (version 1.6)
/Users/s000-50105204/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.6.10/c118700e3a33c8a0d9adc920e9dec0831171925/kotlin-stdlib-common-1.6.10.jar (version 1.6)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
Run Code Online (Sandbox Code Playgroud)
在浏览解决方案后,我通过在 build.gradle 中添加此行以使用 kotlin 1.6.10 找到了解决方案:
dependencies {
classpath 'com.google.gms:google-services:4.3.4'
classpath("com.android.tools.build:gradle:3.5.4")
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10' <==== ADDED THIS LINE
}
Run Code Online (Sandbox Code Playgroud)
但是当我再次运行该应用程序时,它显示不同的错误消息,如下所示:
* What went wrong:
Execution failed for task ':unimodules-react-native-adapter:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Run Code Online (Sandbox Code Playgroud)
我跟踪日志并发现了这一点:
/Users/s000-50105204/Documents/react-native/Mobil88_MobileApps_Estore/node_modules/@unimodules/react-native-adapter/android/src/main/java/org/unimodules/adapters/react/services/CookieManagerModule.java:13: error: CookieManagerModule is not abstract and does not override abstract method invalidate() in NativeModule
public class CookieManagerModule extends ForwardingCookieHandler implements InternalModule, NativeModule {
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Run Code Online (Sandbox Code Playgroud)
这是 build.gradle 中的构建脚本:
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
}
Run Code Online (Sandbox Code Playgroud)
这是项目对 packages.json 的依赖项:
"dependencies": {
"@ptomasroos/react-native-multi-slider": "^2.2.2",
"@react-native-async-storage/async-storage": "^1.15.8",
"@react-native-clipboard/clipboard": "^1.8.4",
"@react-native-community/geolocation": "^2.0.2",
"@react-native-firebase/app": "^14.7.0",
"@react-native-firebase/auth": "^14.7.0",
"@react-native-firebase/crashlytics": "^14.7.0",
"@react-native-firebase/messaging": "^14.7.0",
"@react-native-masked-view/masked-view": "^0.2.6",
"@redux-devtools/extension": "^3.2.2",
"@sentry/react-native": "^2.5.0",
"axios": "^0.21.2",
"expo": "^38.0.0",
"expo-analytics-amplitude": "~8.2.1",
"expo-apple-authentication": "~2.2.1",
"expo-asset": "~8.1.7",
"expo-crypto": "~8.2.1",
"expo-firebase-analytics": "~2.4.1",
"expo-firebase-core": "~1.1.1",
"expo-font": "~8.2.1",
"expo-google-sign-in": "~8.2.1",
"expo-secure-store": "~9.0.1",
"expo-updates": "~0.2.10",
"firebase": "7.9.0",
"install": "^0.13.0",
"jwt-decode": "^3.0.0",
"lodash.isequal": "^4.5.0",
"moment": "^2.22.2",
"npm": "^6.14.13",
"prop-types": "^15.6.1",
"qs": "^6.5.2",
"react": "~16.11.0",
"react-dom": "~16.11.0",
"react-native": "~0.62.2",
"react-native-animatable": "~1.3.0",
"react-native-background-timer": "^2.4.1",
"react-native-camera": "^4.2.1",
"react-native-check-version": "^1.0.16",
"react-native-checkbox": "~2.0.0",
"react-native-collapsible": "^1.6.0",
"react-native-config": "^1.4.2",
"react-native-copilot": "^2.5.1",
"react-native-countdown-component": "^2.7.1",
"react-native-datepicker": "~1.7.2",
"react-native-device-info": "^8.0.8",
"react-native-easy-toast": "~1.1.0",
"react-native-elements": "~0.19.1",
"react-native-email-link": "1.13.1",
"react-native-exit-app": "^1.1.0",
"react-native-fast-image": "^8.5.11",
"react-native-fbsdk-next": "^4.2.0",
"react-native-gesture-handler": "~1.6.0",
"react-native-image-picker": "^4.0.6",
"react-native-image-zoom-viewer": "^3.0.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-maps": "0.27.1",
"react-native-modal-wrapper": "~3.1.1",
"react-native-network-logger": "^1.13.0",
"react-native-picker-select": "~5.1.0",
"react-native-progress": "^5.0.0",
"react-native-reanimated": "~1.9.0",
"react-native-screens": "~2.9.0",
"react-native-shake": "^5.1.1",
"react-native-skeleton-placeholder": "^5.0.0",
"react-native-smooth-pincode-input": "1.0.9",
"react-native-snap-carousel": "3.9.1",
"react-native-status-bar-height": "^2.6.0",
"react-native-svg": "12.1.0",
"react-native-tab-view": "~1.2.0",
"react-native-tip": "0.0.18",
"react-native-tracking-transparency": "^0.1.0",
"react-native-unimodules": "~0.10.1",
"react-native-vector-icons": "~6.6.0",
"react-native-webview": "11.0.0",
"react-navigation": "3.13.0",
"react-redux": "^5.0.7",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"toggle-switch-react-native": "^3.2.0"
}
Run Code Online (Sandbox Code Playgroud)
是kotlin版本吗?还是世博会套餐?
我找不到这个问题的任何解决方案,因为之前很好,没有进行任何更改,突然发生这种情况。卡了2天了,模拟器都跑不了,Azure上构建也没法了
归档时间: |
|
查看次数: |
4347 次 |
最近记录: |