Getting Started: Ionic + Capacitor + React + Typescript + Android
2020-10-25
"dependencies": { "@capacitor/android": "^2.4.2", "@capacitor/core": "2.4.2", "@ionic/react": "^5.0.7", "@ionic/react-hooks": "^0.0.8", "@ionic/react-router": "^5.0.7", "ionic": "^5.4.16", "react": "^16.13.0", "typescript": "3.8.3" },
I'm lazy, check official doc instead.
Local Proxy Error
Check below 2 files:
gradle.properties
under current projectC:\Users\Administrator\.gradle\gradle.properties
Delete/comment below 4 lines:
systemProp.https.proxyPort=1080 systemProp.http.proxyHost=127.0.0.1 systemProp.https.proxyHost=127.0.0.1 systemProp.http.proxyPort=1080
Click File--Sync Project With Gradle Files
Error after packed app
Open your file platforms/android/app/src/main/AndroidManifest.xml
and add:
<uses-permission android:name = "android.permission.INTERNET" /> <uses-permission android:name = "android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name = "android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name = "android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name = "android.permission.READ_PHONE_STATE" />
And run debug again
- Activate
Developer Options
and openUSB Debugging
- Connect your android to PC
- Start ionic server:
ionic serve
- Chrome/Edge access
chrome://inspect/#devices
- You will see your device listed but you won't able to see
inspect
link
- You will see your device listed but you won't able to see
- Open the app in your android
- You will see
inspect
link now
- You will see
- Click
inspect
then you can debug it with source
关于本文
文章标题 | Getting Started: Ionic + Capacitor + React + Typescript + Android |
发布日期 | 2020-10-25 |
文章分类 | Tech |
相关标签 | #Ionic #Capacitor #React #Typescript #Android |
留言板
PLACE_HOLDER
PLACE_HOLDER
PLACE_HOLDER
PLACE_HOLDER