Android Question Problem with Integrating Firebase Services

catyinwong

Active Member
Licensed User
Longtime User
I found that there might be some problem with the codes in the Manifest Snippets Repository for the firebase services since they make my phone unable to recognize and install the app. I have tried opening a blank project only with the edited Manifest Snippets Repository and with the firebase library (with the jason file from admob as well).

Here is what listed in the unfiltered log:

Installing file.
** Activity (main) Pause, UserClosed = false **
updateVisibility : ActivityRecord{86bd645 token=android.os.BinderProxy@d622d13 {anywheresoftware.b4a.b4abridge/anywheresoftware.b4a.b4abridge.main}} show : false
** Activity (main) Resume **
Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.
Timeline: Activity_idle id: android.os.BinderProxy@d622d13 time:1110728640

May I ask why and how to solve this problem?
 

KMatle

Expert
Licensed User
Longtime User
Upvote 0

catyinwong

Active Member
Licensed User
Longtime User
Firebase Services will not cause that (otherwise 50% of my apps can't be installed)

Most likely: Did you set a new & proper package name? (not b4a.example for all 6 the apps you probably tried) :)

That's why I am asking here. I have tried two different B4A projects - one with editted Manifest Snippets Repository, one without. All the other things are the same. And the one with the editted Manifest Snippets Repository cannot be installed; the other one is totally fine - can be installed and works well. And the above are the unfiltered log (which I don't understand at all). Can anyone help me explain what the log says about the problem?
 
Upvote 0

catyinwong

Active Member
Licensed User
Longtime User
These logs are not relevant. Are you connected in USB debug mode? Have you unchecked the filter checkbox?

I am connected with the Wifi mode. Here are the logs with the filter checkbox unchecked:

LogCat connected to: B4A-Bridge: samsung SM-G5700
--------- beginning of main
SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=anywheresoftware.b4a.b4abridge
TimaSignature is unavailable
Added TimaKeyStore provider
ClassLoader referenced unknown path: /data/app/anywheresoftware.b4a.b4abridge-1/lib/arm
garbageCollect()
garbageCollect()
#1 mView = com.android.internal.policy.PhoneWindow$DecorView{c3b2b50 I.E...... R.....ID 0,0-0,0}
Use EGL_SWAP_BEHAVIOR_PRESERVED: true
garbageCollect()
** Service (starter) Create **
** Service (starter) Start **
QUALCOMM build : ae8bf93, Ib4cc3153fd
Build Date : 06/28/16
OpenGL ES Shader Compiler Version: XE031.06.00.02
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.BR.1.3.3.C2.06.00.01.205.077
Remote Branch : NONE
Reconstruct Branch : NOTHING
Initialized EGL, version 1.4
** Activity (main) Create, isFirst = true **
setTypeface with style : 0
setTypeface with style : 0
setTypeface with style : 0
setTypeface with style : 0
setTypeface with style : 0
setTypeface with style : 0
setTypeface with style : 0
** Activity (main) Resume **
Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.
MSG_RESIZED_REPORT: ci=Rect(0, 48 - 0, 0) vi=Rect(0, 48 - 0, 0) or=1
DTS_GLAPI : DTS is not allowed for Package : anywheresoftware.b4a.b4abridge
HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
garbageCollect()
** Service (service1) Create **
** Service (service1) Start **
HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
Timeline: Activity_idle id: android.os.BinderProxy@d622d13 time:1269465053
ViewPostImeInputStage processPointer 0
ViewPostImeInputStage processPointer 1
** Service (service1) Destroy **
garbageCollect()
** Service (service1) Create **
** Service (service1) Start **
HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
ViewPostImeInputStage processPointer 0
ViewPostImeInputStage processPointer 1
** Service (service1) Destroy **
garbageCollect()
** Service (service1) Create **
** Service (service1) Start **
ViewPostImeInputStage processPointer 0
ViewPostImeInputStage processPointer 1
** Service (service1) Destroy **
garbageCollect()
** Service (service1) Create **
** Service (service1) Start **
Connected to B4A-Bridge (Wifi)
ViewPostImeInputStage processKey 0
ViewPostImeInputStage processKey 1
** Activity (main) Pause, UserClosed = true **
#3 mView = null
Installing file.
 
Upvote 0

catyinwong

Active Member
Licensed User
Longtime User
You will not be able to see the relevant logs with B4A-Bridge as it happens during installation. You will need to enable USB debug mode and connect to the device without B4A-Bridge.

Here is the codes on the Compile and Debug window:

B4A version: 6.50
Parsing code. (0.68s)
Compiling code. (1.61s)
Compiling layouts code. (0.15s)
Organizing libraries. (0.00s)
Generating R file. (0.50s)
Compiling generated Java code. (9.09s)
Convert byte code - optimized dex. (8.75s)
Packaging files. (1.80s)
Copying libraries resources (0.06s)
Found 1 resource files.
Signing package file (debug key). (1.71s)
ZipAlign file. (0.11s)
Installing file to device. Error
[ 1%] /data/local/tmp/HKJupas_DEBUG.apk
[ 3%] /data/local/tmp/HKJupas_DEBUG.apk
[ 5%] /data/local/tmp/HKJupas_DEBUG.apk
[ 7%] /data/local/tmp/HKJupas_DEBUG.apk
[ 9%] /data/local/tmp/HKJupas_DEBUG.apk
[ 11%] /data/local/tmp/HKJupas_DEBUG.apk
[ 12%] /data/local/tmp/HKJupas_DEBUG.apk
[ 14%] /data/local/tmp/HKJupas_DEBUG.apk
[ 16%] /data/local/tmp/HKJupas_DEBUG.apk
[ 18%] /data/local/tmp/HKJupas_DEBUG.apk
[ 20%] /data/local/tmp/HKJupas_DEBUG.apk
[ 22%] /data/local/tmp/HKJupas_DEBUG.apk
[ 23%] /data/local/tmp/HKJupas_DEBUG.apk
[ 25%] /data/local/tmp/HKJupas_DEBUG.apk
[ 27%] /data/local/tmp/HKJupas_DEBUG.apk
[ 29%] /data/local/tmp/HKJupas_DEBUG.apk
[ 31%] /data/local/tmp/HKJupas_DEBUG.apk
[ 33%] /data/local/tmp/HKJupas_DEBUG.apk
[ 34%] /data/local/tmp/HKJupas_DEBUG.apk
[ 36%] /data/local/tmp/HKJupas_DEBUG.apk
[ 38%] /data/local/tmp/HKJupas_DEBUG.apk
[ 40%] /data/local/tmp/HKJupas_DEBUG.apk
[ 42%] /data/local/tmp/HKJupas_DEBUG.apk
[ 44%] /data/local/tmp/HKJupas_DEBUG.apk
[ 46%] /data/local/tmp/HKJupas_DEBUG.apk
[ 47%] /data/local/tmp/HKJupas_DEBUG.apk
[ 49%] /data/local/tmp/HKJupas_DEBUG.apk
[ 51%] /data/local/tmp/HKJupas_DEBUG.apk
[ 53%] /data/local/tmp/HKJupas_DEBUG.apk
[ 55%] /data/local/tmp/HKJupas_DEBUG.apk
[ 57%] /data/local/tmp/HKJupas_DEBUG.apk
[ 58%] /data/local/tmp/HKJupas_DEBUG.apk
[ 60%] /data/local/tmp/HKJupas_DEBUG.apk
[ 62%] /data/local/tmp/HKJupas_DEBUG.apk
[ 64%] /data/local/tmp/HKJupas_DEBUG.apk
[ 66%] /data/local/tmp/HKJupas_DEBUG.apk
[ 68%] /data/local/tmp/HKJupas_DEBUG.apk
[ 69%] /data/local/tmp/HKJupas_DEBUG.apk
[ 71%] /data/local/tmp/HKJupas_DEBUG.apk
[ 73%] /data/local/tmp/HKJupas_DEBUG.apk
[ 75%] /data/local/tmp/HKJupas_DEBUG.apk
[ 77%] /data/local/tmp/HKJupas_DEBUG.apk
[ 79%] /data/local/tmp/HKJupas_DEBUG.apk
[ 81%] /data/local/tmp/HKJupas_DEBUG.apk
[ 82%] /data/local/tmp/HKJupas_DEBUG.apk
[ 84%] /data/local/tmp/HKJupas_DEBUG.apk
[ 86%] /data/local/tmp/HKJupas_DEBUG.apk
[ 88%] /data/local/tmp/HKJupas_DEBUG.apk
[ 90%] /data/local/tmp/HKJupas_DEBUG.apk
[ 92%] /data/local/tmp/HKJupas_DEBUG.apk
[ 93%] /data/local/tmp/HKJupas_DEBUG.apk
[ 95%] /data/local/tmp/HKJupas_DEBUG.apk
[ 97%] /data/local/tmp/HKJupas_DEBUG.apk
[ 99%] /data/local/tmp/HKJupas_DEBUG.apk
[100%] /data/local/tmp/HKJupas_DEBUG.apk
pkg: /data/local/tmp/HKJupas_DEBUG.apk
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]


Does it tell the problem?
 
Upvote 0

catyinwong

Active Member
Licensed User
Longtime User
You should upload or copy your manifest here. Probably there is something wrong in it.

'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")
'End of default text.


'************ Google Play Services Base ************
AddApplicationText(
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="false"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version" />
)
'************ Google Play Services Base (end) ************

'************ Firebase Base ************
CreateResourceFromFile("google-services", "google-services.json")
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(com.google.android.c2dm.permission.RECEIVE)
AddPermission(${applicationId}.permission.C2D_MESSAGE)
AddManifestText( <permission android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature" />)
AddApplicationText(
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.measurement.UPLOAD"/>
</intent-filter>
</receiver>

<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false"/>
<provider
android:authorities="${applicationId}.firebaseinitprovider"
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:exported="false"
android:initOrder="100" />
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.measurement.UPLOAD"/>
</intent-filter>
</receiver>

<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false"/>
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
android:exported="false" />


<service
android:name="com.google.firebase.iid.FirebaseInstanceIdService"
android:exported="true">
<intent-filter android:priority="-500">
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
)
'************ Firebase Base (end) ************

'************ Firebase Notifications ************
AddApplicationText(
<service
android:name="com.google.firebase.messaging.FirebaseMessagingService"
android:exported="true">
<intent-filter android:priority="-500">
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="anywheresoftware.b4a.objects.FirebaseNotificationsService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
)
'************ Firebase Notifications (end)************

'************ Firebase Analytics ************
AddApplicationText(
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.measurement.UPLOAD"/>
</intent-filter>
</receiver>

<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false"/>

<service android:name="com.google.firebase.crash.internal.service.FirebaseCrashReceiverService"
android:process=":background_crash"/>

<service android:name="com.google.firebase.crash.internal.service.FirebaseCrashSenderService"
android:process=":background_crash"/>
)
'************ Firebase Analytics (end) ************

'************ Firebase Ads ************
AddApplicationText(
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
<activity android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
android:theme="@style/Theme.IAPTheme"/>
)
'************ Firebase Ads (end) ************

'************ Firebase Auth ************
AddApplicationText(
<activity android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:excludeFromRecents="true"
android:exported="false" />

<service
android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
android:exported="true"
android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
)
'************ Firebase Auth (end) ************
 
Upvote 0

catyinwong

Active Member
Licensed User
Longtime User
I have created a small project, and the following errors occur when it proceeds. Does it tell anything new?

LogCat connected to: B4A-Bridge: samsung SM-G5700
--------- beginning of main
--------- beginning of system
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (service1) Create **
** Service (service1) Start **
** Service (service1) Destroy **
** Service (service1) Create **
** Service (service1) Start **
Connected to B4A-Bridge (Wifi)
Installing file.
** Activity (main) Pause, UserClosed = false **
PackageAdded: package:Aone.HK.Jupas
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (B4A line: 35)
BannerAd.LoadAd
java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@Integer/google_play_services_version" />
at com.google.android.gms.common.zze.zzap(Unknown Source)
at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.common.zzc.isGooglePlayServicesAvailable(Unknown Source)
at com.google.android.gms.internal.zzpx.zzP(Unknown Source)
at com.google.android.gms.internal.zzeg.zza(Unknown Source)
at com.google.android.gms.internal.zzeg.zza(Unknown Source)
at com.google.android.gms.internal.zzez.zzfe(Unknown Source)
at com.google.android.gms.internal.zzez.zzfd(Unknown Source)
at com.google.android.gms.internal.zzez.zza(Unknown Source)
at com.google.android.gms.ads.BaseAdView.loadAd(Unknown Source)
at com.google.android.gms.ads.AdView.loadAd(Unknown Source)
at anywheresoftware.b4a.admobwrapper.AdViewWrapper.LoadAd(AdViewWrapper.java:119)
at Aone.HK.Jupas.main._activity_create(main.java:413)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at Aone.HK.Jupas.main.afterFirstLayout(main.java:102)
at Aone.HK.Jupas.main.access$000(main.java:17)
at Aone.HK.Jupas.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7326)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
 

Attachments

  • Testing.zip
    6.8 KB · Views: 359
Upvote 0

catyinwong

Active Member
Licensed User
Longtime User

Attachments

  • Testing.zip
    8.6 KB · Views: 374
Upvote 0

catyinwong

Active Member
Licensed User
Longtime User
My guess is that the error is related to the not-lower cased package name. Try to change the package name to all lower case.

Problem solved. Now the app can be installed! Thanks a lot.

Another question, when I try to loadad, it returns the error code: 0. What does the error mean? (The ad set was created before and thus I assume there should be enough time. )
 
Upvote 0
Top