Android Question [SOLVED] Error after updating B4A from 11.8 to 12

ziomorgan

Active Member
Licensed User
Longtime User
After updating B4A from 11.8 to 12 I cannot longer install the application with B4A-Bridge v 2.65 on the device (Samsung S21+ Android 13).

The error he gives me on the phone is:

"APP NOT INSTALLED BECAUSE THE PACKAGE IS NOT VALID"

I've tried both debug and release version
I've enabled android.jar version 33 on IDE Path
I've tried to deinstall the app and installing again
I've tried to install a simple new application and it works
My PC is Windows 10 64bit
 

AnandGupta

Expert
Licensed User
Longtime User
Create a new empty project and run it. Do you get this error?
I've tried to install a simple new application and it works

So the problem is with your existing project. Maybe it is calling some library which are giving error.
You have to check staring with simple app and adding each library to it, I think.
 
Upvote 0

ziomorgan

Active Member
Licensed User
Longtime User
So the problem is with your existing project. Maybe it is calling some library which are giving error.
You have to check staring with simple app and adding each library to it, I think.
I've tried to create a new project and add one library at a time: at the end with all the same library of the original project in the new project work fine.
Whatelse can I try to solve the problem with my old project?
 
Upvote 0

ziomorgan

Active Member
Licensed User
Longtime User
I've tried to install the app to the emulator with the following error:

Installing file to device. Error
adb: failed to install ACR2008.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1771887071.tmp/base.apk (at Binary XML file line #50): com.dropbox.core.android.AuthActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
com.dropbox.core.android.AuthActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are presen
This is error. It not related to B4A version. It is related to the targetSdkVersion.

Post your manifest editor.
 
Upvote 0

ziomorgan

Active Member
Licensed User
Longtime User
This is error. It not related to B4A version. It is related to the targetSdkVersion.

Post your manifest editor.
Manifest file:
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="31"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo.Light.Panel")
SetApplicationAttribute(android:largeHeap, "true")
'
AddManifestText(<uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    android:maxSdkVersion="18" />
)
'************ Api V2 DROPBOX (start) *********************
AddApplicationText(
    <activity android:name="com.dropbox.core.android.AuthActivity"
     android:configChanges="orientation|keyboard"
     android:launchMode="singleTask" >
    <intent-filter>
      <data android:scheme="xx-xxxxxxxxxxxxxx" />
'my android:scheme obscured'
    <action android:name="android.intent.action.VIEW" />
      <category android:name="android.intent.category.BROWSABLE" />
      <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    </activity>
)
'************ Api V2 DROPBOX (end) ***********************
'************ Google Play Services Base (start) **********
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
AddApplicationText(
<meta-data
  android:name="com.google.android.geo.API_KEY"
  android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
'my API_KEY obscured'
)
AddApplicationText(
<uses-library
      android:name="org.apache.http.legacy"
      android:required="false"/>
)
'************ Google Play Services Base (end) ************
'************ Firebase Base ************
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
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 ************
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
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 ************
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
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) ************
'End of default text.

' Starting from Android 7 (API 24) we pass a file uri using a FileProvider
AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <files-path name="name" path="shared" />
)
AddPermission(android.permission.READ_PHONE_STATE)
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddPermission(android.permission.REQUEST_INSTALL_PACKAGES)
 
Upvote 0

ziomorgan

Active Member
Licensed User
Longtime User
SOLVED
Installing in the emulator the log has given me exactly where was the problem: i've added where required the explicit value "android:exported=true"
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…