【发布时间】:2021-08-03 18:20:58
【问题描述】:
我在尝试运行 expo run:android 时遇到此错误,但找不到任何解决方案。
> Task :app:compileDebugJavaWithJavac FAILED
/Users/amin/Projects/profishop/taksabad/android/app/src/main/java/com/mapsabad/profishop/generated/BasePackageList.java:1: error: illegal '.'
package com.mapsabad.profishop..generated;
^
/Users/amin/Projects/profishop/taksabad/android/app/src/main/java/com/mapsabad/profishop/MainApplication.java:1: error: <identifier> expected
package com.mapsabad.profishop.;
^
/Users/amin/Projects/profishop/taksabad/android/app/src/main/java/com/mapsabad/profishop/MainApplication.java:14: error: illegal '.'
import com.mapsabad.profishop..generated.BasePackageList;
^
/Users/amin/Projects/profishop/taksabad/android/app/src/main/java/com/mapsabad/profishop/MainActivity.java:1: error: <identifier> expected
package com.mapsabad.profishop.;
^
/Users/amin/Projects/profishop/taksabad/android/app/src/debug/java/com/mapsabad/profishop/ReactNativeFlipper.java:7: error: <identifier> expected
package com.mapsabad.profishop.;
^
5 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 19s
519 actionable tasks: 3 executed, 516 up-to-date
/Users/amin/Projects/profishop/taksabad/android/gradlew exited with non-zero code: 1
Error: /Users/amin/Projects/profishop/taksabad/android/gradlew exited with non-zero code: 1
at ChildProcess.completionListener (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (node:events:472:26)
at ChildProcess.emit (node:events:365:28)
at maybeClose (node:internal/child_process:1067:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
...
at spawnAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
at spawnGradleAsync (/usr/local/lib/node_modules/expo-cli/src/commands/run/android/spawnGradleAsync.ts:44:18)
at actionAsync (/usr/local/lib/node_modules/expo-cli/src/commands/run/android/runAndroid.ts:110:9)
我也尝试过 expo 弹出,然后运行 npx react-native run-android 错误,我又遇到了同样的错误。
反应原生版本:0.63.4
有人想解决这个问题吗?
【问题讨论】:
-
文字
com.mapsabad.profishop.从何而来?这是您指定的值。它显然不应该在末尾有.,所以找到你指定值的位置,并删除.,然后问自己为什么首先在其中放置一个句点。
标签: java react-native gradle expo