React-native(android)AAPT:错误:未找到资源android:attr / dialogCornerRadius

Yin*_*nka 5 android gradle android-studio react-native

运行react-native run-android之后

我明白了

JS server already running.
Building and installing the app on the device (cd android && gradlew.bat 
installDebug)...
C:\Users\Dd\.gradle\caches\transforms-1\files-1.1\appcompat-v7- 
28.0.0.aar\5f8d067ae17f4050cbc3c86889ab0be8\res\values-v28\values- 
v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not 
found.
Run Code Online (Sandbox Code Playgroud)

c:\react\diagnoseme\android\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.

C:\Users\Dd\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\5f8d067ae17f4050cbc3c86889ab0be8\res\values\values.xml:1304:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.

C:\Users\Dd\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\5f8d067ae17f4050cbc3c86889ab0be8\res\values\values.xml:1304:5-69: AAPT: error: resource android:attr/ttcIndex not found.

error: failed linking references.

FAILURE: Build failed with an exception.

* What went wrong:
Run Code Online (Sandbox Code Playgroud)

任务':app:processDebugResources'的执行失败。无法处理资源,有关详细信息,请参见上面的aapt输出。

* Try:
Run Code Online (Sandbox Code Playgroud)

使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。与--scan一起运行以获取完整的见解。

* Get more help at https://help.gradle.org
Run Code Online (Sandbox Code Playgroud)

22秒内失败,执行61项可执行的任务:执行1项,更新60项无法在设备上安装该应用程序,有关详细信息,请阅读上面的错误。确保已运行Android模拟器或已连接设备,并已设置Android开发环境:https : //facebook.github.io/react-native/docs/getting-started.html

Command failed: gradlew.bat installDebug

Error: Command failed: gradlew.bat installDebug
at checkExecSyncError (child_process.js:616:11)
at Object.execFileSync (child_process.js:634:13)
at runOnAllDevices (C:\react\diagnoseme\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)
at buildAndRun (C:\react\diagnoseme\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)
at isPackagerRunning.then.result (C:\react\diagnoseme\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)
at process._tickCallback (internal/process/next_tick.js:68:7)
Run Code Online (Sandbox Code Playgroud)

Iza*_*ska 6

这是因为您使用的是appcompat-v7-28.0.0和不匹配的编译SDK版本(很可能是27)。降级库以匹配您的SDK或升级SDK来匹配您的库。