RN environment configuration problem
Question one
Device USB\VID_22D9&PID_2046\DUKJMRAU9L9D4SDU cannot be migrated due to only a partial or ambiguous match.
Solution: You need to choose to transfer files when clicking the USB debugging button. If you choose to charge, it will show that the device is not connected.
question two
While running the command:
yarn andriod
After reporting an error
Reason: Since the app directory is in 'F:/pig/reactnative/code/myApp', which contains Chinese, changing the Chinese directory to an all-English directory can solve the problem.
question three
While running the command:
yarn andriod
After that, an error is reported:
error Failed to install the app. Please accept all necessary Android SDK licenses using Android SDK Manager: "$ANDROID_HOME/tools/bin/sdkmanager --licenses".
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
- What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;30.0.2 Android SDK Build-Tools 30.0.2
platforms;android-30 Android SDK Platform 30
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
solution:
question four
While running the command:
yarn andriod
After that, an error is reported:
> Task :app:installDebug
[PropertyFetcher]: ShellCommandUnresponsiveException getting properties for device DUKJMRAU9L9D4SDU: null
[PropertyFetcher]: ShellCommandUnresponsiveException getting properties for device DUKJMRAU9L9D4SDU: null
[PropertyFetcher]: ShellCommandUnresponsiveException getting properties for device DUKJMRAU9L9D4SDU: null
Skipping device 'DUKJMRAU9L9D4SDU' for 'app:debug': Unknown API Level
> Task :app:installDebug FAILED
31 actionable tasks: 31 executed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to install on any devices.
solution:
Run the following steps in the current root directory:
1 cd android
2 ./gradlew clean
3 cd …
4 npm cache clean --force
5 yarn android