React Native - U -Bundler kann bei Verwendung von Varianten nicht an Android AVD angeschlossen werdenAndroid

Forum für diejenigen, die für Android programmieren
Anonymous
 React Native - U -Bundler kann bei Verwendung von Varianten nicht an Android AVD angeschlossen werden

Post by Anonymous »

Ich habe einige Varianten für meine RN -App in Android erstellt. In App/Build.gradle :

Code: Select all

android {
...

namespace "com.myapp"

flavorDimensions += "default"
productFlavors {
create("production") {
dimension "default"
resValue "string", "build_config_package", "com.myapp"
...
}
create("staging") {
dimension "default"
applicationIdSuffix ".staging"
resValue "string", "build_config_package", "com.myapp"
...
}
create("development") {
dimension "default"
applicationIdSuffix ".development"
resValue "string", "build_config_package", "com.myapp"
...
}
}

defaultConfig {
applicationId "com.myapp"
...
}

buildTypes {
debug {
...
}
release {
...
}
}
}
In package.json :

Code: Select all

"scripts": {
"android:staging": "react-native run-android --mode=stagingDebug --appIdSuffix \"staging\"",
"android:staging-release": "react-native run-android --mode=stagingRelease --appIdSuffix \"staging\"",
"android:dev": "react-native run-android --mode=developmentDebug --appIdSuffix \"development\"",
"android:dev-release": "react-native run-android --mode=developmentRelease --appIdSuffix \"development\"",
"android:prod": "react-native run-android --mode=productionDebug",
"android:prod-release": "react-native run-android --mode=productionRelease",
"android": "react-native run-android",
...
},
Wenn ich beispielsweise Garn Android: Dev , Metro Bundler und AVD ausführen, werden die Metro die App im Emulator erstellen, installieren und starten Schließen und von der App trennen (ich kann nicht debuggen/schnell aktualisieren) ohne eine Nachricht:

Code: Select all

BUILD SUCCESSFUL in 16s
491 actionable tasks: 19 executed, 472 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5554"...
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.myapp.development/com.myapp.MainActivity }
✨  Done in 26.22s.
(Ich denke ?)
Wenn ich die App von Bundler aktualisiere, heißt es:

Code: Select all

info Reloading app...
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
Ich habe bereits ADB Reverse 8081: 8081 , Gradle Cache und Android gelöscht: useCleartextTraffic = "true" . Nichts funktioniert für Android. p> wisst ihr, was es sonst noch sein kann?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post