Reputation: 1371
My Ionic app works perfectly when testing in browser through ionic cordova run browser
, works perfectly when testing on device through ionic cordova run android --device
, but for some reason, when installed from apk (both offline and from Play Store), text inputs simply don't work.
Other inputs like <ion-radio>
and <ion-select>
are working fine, but <ion-input>
inputs don't. The keyboard doesn't appear. I tap, tap, and nothing happens.
Procedures I took:
I've already tried building for Android versions 19, 22 and 23. I'm using SDK only (not Android Studio) and I'm installing packages via command line. Here is the version 23 example:
sdkmanager.bat "platform-tools" "platforms;android-23" "build-tools;23.0.3" "extras;android;m2repository"
For building the app, I'm running the following command:
ionic cordova build android --release --prod
That's my key generation command:
keytool -genkey -v -keystore curso-spring-ionic-key.jks -keyalg RSA -keysize 2048 -validity 100000 -alias curso-spring-ionic
And then I sign the apk using this:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore curso-spring-ionic-key.jks android-release-unsigned.apk curso-spring-ionic
And finally zipalign:
zipalign -v 4 android-release-unsigned.apk SistemaPedidos.apk
That's my home page login form, which works perfectly in debug mode, but its inputs are not working when installed from apk:
<ion-content padding>
<h3>Sistema de pedidos</h3>
<img src="assets/imgs/tela-inicial.png" alt="logo">
<form>
<ion-item>
<ion-label>Email</ion-label>
<ion-input [(ngModel)]="creds.email" name="email" type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label>Senha</ion-label>
<ion-input [(ngModel)]="creds.senha" name="senha" type="password"></ion-input>
</ion-item>
<button ion-button block (click)="login()">Entrar</button>
</form>
<button ion-button block outline (click)="signup()">Registrar</button>
</ion-content>
I really don't know what to do. I've spend the whole day trying different Android versions and input variations with no success. Can anyone help me figure out what is making the inputs not work? Thanks.
Upvotes: 0
Views: 864
Reputation: 21
I found the solution for you.
https://github.com/ionic-team/ionic/issues/13718
You basically need to add : "uglify-es": "3.2.2"
"devDependencies": {
"@ionic/app-scripts": "3.1.2",
"typescript": "2.4.2",
"uglify-es": "3.2.2"
},
Then run : npm install --save
To update the changes
Upvotes: 2