[email protected]:~/Desktop/sxtbdemo2$ react-native run-android
Scanning folders for symlinks in /Users/apple/Desktop/sxtbdemo2/node_modules (8ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'sxtbdemo2'.
Could not resolve all files for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 12s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/android-setup.html
Trả lời
Nó thường là một vấn đề với kho lưu trữ của bạn trong tệp gradle của bạn.
cho tôi làm việc để thay đổi build.gradle như thế này:
buildscript {
repositories {
mavenLocal()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
vì vậy khi bạn thêm google() nó sẽ làm việc.
Đoán có lỗi trong mã phản ứng-native-cli –
thêm google() cũng hoạt động đối với tôi –
Xác nhận rằng việc thêm google() hoạt động – Kiavor
buildscript {
repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
Thêm google()
bên trong buildscript()
và Dự án đồng bộ hóa.
tham khảo: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#apply_plugin
Cảm ơn bạn @ketan Ramani đã cứu tôi trong ngày ... –
- 1. Không thể tìm thấy Library.apk!
- 2. Không thể tìm thấy HelloAndroid.apk?
- 3. Không thể tìm thấy Genymotion.app
- 4. Không thể tìm thấy org.json.JSONObject
- 5. không thể tìm thấy -lmysqlclient
- 6. Không thể tìm thấy System.Xaml?
- 7. Không thể tìm thấy Dumpbin.exe
- 8. Không thể tìm thấy com_actionbarsherlock.apk
- 9. Không thể tìm thấy Vagrant
- 10. Không thể tìm thấy microsoft.sqlserver.batchparser.dll
- 11. Không thể tìm thấy SecurityMockMvcConfigurers
- 12. Không thể tìm thấy socket.io.js
- 13. pvk2pfx.exe - không thể tìm thấy
- 14. không thể tìm thấy TemporaryGeneratedFile_GUID
- 15. Không thể tìm thấy system.out.println()
- 16. Không thể tìm thấy giải pháp RollupJS `: Lỗi: Không thể tìm thấy mô-đun 'babel-runtime'`
- 17. git tìm nạp "không thể tìm thấy" "đối tượng ... không tìm thấy" lỗi cho stash
- 18. QT OpenGL QGLWidget không thể tìm thấy
- 19. Android studio không thể tìm thấy aapt
- 20. RestEasy - Không thể tìm thấy MessageBodyReader?
- 21. Tôi không thể tìm thấy tệp debug.keystore
- 22. Không thể tìm thấy phương thức CreateQuery()
- 23. Không thể tìm thấy phương thức InsertOnSubmit()
- 24. không thể tìm thấy Nhà máy: javax.faces.context.FacesContextFactory
- 25. Tham chiếuError: Không thể tìm thấy biến: $
- 26. Javac "không thể tìm thấy biểu tượng"
- 27. MonoDevelop 3.1.1 không thể tìm thấy System.Xml.Linq
- 28. Không thể tìm thấy Eigen3 với CMake
- 29. Phòng không thể tìm thấy thi
- 30. Ionic-3 Không thể tìm thấy ống
xin định dạng câu hỏi của bạn –
bạn sẽ nhớ chọn câu trả lời như giải quyết? cảm ơn bạn. –