ionic, Facebook4 Cordova blank screen crashing - facebook

I am using facebook4 cordova plugin to authenticate my users to firebase. I tested on many devices. In most of them, it is working properly but in some of them I am getting blank screens( I guess its crashing). I think it is from the android version. Some of the crashed devices were Android 4.3 and 4.4.2.
I ran this command: ionic run android --livereload --consolelogs
and got this:
BUILD FAILED
Total time: 3.94 secs
file:/C:/Users/Paul/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
file:/C:/Users/Paul/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.jar
Required by:
:android:unspecified > com.facebook.android:facebook-android-sdk:4.14.1
> Could not find com.android.support:cardview-v7:23.4.0.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.pom
https://repo1.maven.org/maven2/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.jar
file:/C:/Users/Paul/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.pom
file:/C:/Users/Paul/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.jar
file:/C:/Users/Paul/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.pom
file:/C:/Users/Paul/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.jar
Required by:
:android:unspecified > com.facebook.android:facebook-android-sdk:4.14.1
What could be the main cause of this?

Related

Debugging Ionic 4 App in Appium WebdriverIO not working : WebView missing

I am trying to debug an Ionic 4 app using Appium & WebdriverIO. I am receiving feedback that I need to enable Webview in my app in order for this to work. The problem is I cannot find a single reference as to how to do this in Ionic anywhere.
I have also attempted to run my app in Browserstack where for the same reason, it won't run at all.
Can someone from Ionic comment on the correct approach to this, that will work for Android and iOS platforms, based on the same Ionic code.
The solution comes in a few steps.
1 - Enable Webview
In the config.xml file, make sure you set the following:
<preference name="WKWebViewOnly" value="true" />
This has the effect of setting :
<application
android:debuggable="true"
2 - Debug Build
In addition to point 1, note that for a production release build, we use the command :
$ ionic cordova build android --prod --release
However, Android does something clever behind the scenes in that this build can only be debugged locally for security reasons. So, no matter what you do, when you try and run this up in Browserstack, it will not provide webview as a context. We fix this by using the debug build flag:
$ ionic cordova build android --prod --debug
3 - Bonus Bug
Unfortunately, there is a bug in the Android Debug build process. So there is one more step to cover. You have to run zipalign twice when you're working on the debug build. Don't ask me why! You just do...
Debug > "%ANDROID_HOME%\build-tools\28.0.3\zipalign" -f 4 app-debug.apk temp.apk // zip-align
Debug > "%ANDROID_HOME%\build-tools\28.0.3\zipalign" -f 4 temp.apk SensorNode.apk // need to do it twice because of android bug!!!
Debug > "%ANDROID_HOME%\build-tools\28.0.3\apksigner" sign --ks my-release-key.jks --v1-signing-enabled true --v2-signing-enabled true SensorNode.apk

Ionic 4: Issue building for device

Error when building for the device
I am getting an error when I try to build for the device(ionic cordova run android --device). For some reason it is not creating platforms/android/app/build/outputs/apk/debug/app-debug/apk. I have tried removing and adding android different versions. Also, I have tried ionic cordova run android --no-native-run and it loads but with a blank screen.
I found 2 solutions, so if you have a problem with running the device feature:
Update CLI!
Remove Android
ionic cordova platform rm android
Add android#6 and run ionic cordova run android --no-native-run
OR
3.add the latest android#latest and run ionic cordova run android.
Those two worked for me, depending on the version of your projects!

how to resolve installation problem in device ionic 4

I'm trying install .APK in my divece but I get the following error "app was not installed", I'm using ionic v 4 and my divece is android 6.0.1, any idea ?
Use this command for V4 :
ionic cordova build --release android
This will generate unsigned apk file under
platforms/android/build/outputs/apk/your-project-name.apk
And simply download apk file to your phone and install it. More details can be found here
I faced this error before and the cause was that using unsigned APK or the device contains app with same "App Id"
So to Solve it, Please Follow this instructions:
Use this Command
ionic cordova build android --prod
Then Try to remove any other apps from your phone that may have same app id (any old versions or sample apps) or change your app id from config.xml (before build of course)
<widget id="com.android.YOUR_UNIQE_APP_ID" ... >

How can I install my ionic app on my android phone?

I'm trying to install my ionic app on my android phone. I tried
install my ionic app on my android phone
The app ran on my phone, but when I ran the same command to run a different app, the app was replaced on my mobile. How can I keep both? I don't intend to modify any of these apps, they are ready. I tried these commands as well:
ionic cordova build android --prod --release
and
ionic cordova run android --prod --release
I got this error message:
[ERROR] An error occurred while running cordova run android --release
(exit code 1)
By default, it will overwrite the previous version. You can keep the both app using below way:
Check the config.xml file, and change the id of the app.
<widget id="new.app.id" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
Now, it will be considered as a different app and will not replace the previous one.

Iphone - PhoneGap Build failed with 7 errors?

I have xCode 3.2.6 and i have installed phonegap cordova 1.7.0 . I followed the read me instruction and installed. After creating the new app using template i run the application. But the build is failed showing some 7 errors.
/Users/xxx/Desktop/testPGAP/build/testPGAP.build/Debug-iphonesimulator/testPGAP.build/Script-304B58A110DAC018002A0835.sh: line 2: touch: command not found
Command /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
and libCordova.a, cordova.framework , cordovaLibTests.octest and cordovaLibApp.app showing in red color.
What may be the problem. What is the solution to overcome this problem.