简体   繁体   中英

Edit AndroidManifest in un-ejected Expo App?

I've been building my RN app directly from Expo ( expo build:ios / expo build:android ) without ejecting, without opening the app in Xcode or Android Studio.

To get KeyboardAwareScrollView to work on Android I need to Set windowSoftInputMode to adjustPan in AndroidManifest.xml.

Is there a way I can do this without ejecting? (Keeping with my build-direct-from-expo workflow)

Ejecting has given me lots of errors in Xcode (fixable with a LOT of work), and I don't have any experience with Android development so I shudder to think what will happen when I open an ejected Android project.

You need to eject/detach the expo project to react-native as expo doesnt provide access to such files. Or you can try react-native-keyboard-spacer.

It is possible to edit AndroidManifest.xml with apktool , followed by using apksigner to re-sign the apk with credentials from expo credentials:manager :

apktool decode myapp-original.apk
vim myapp-original/AndroidManifest.xml

apktool build myapp-original -o myapp.apk
expo credentials:manager -p android
/path/toAndroid/Sdk/build-tools/$VERSION/apksigner sign -ks @username__myapp.bak.jks myapp.apk
/Android/Sdk/platform-tools/adb install myapp.apk

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM