Android Question App Crash on starup - Android 4.4

uniplan

Active Member
Licensed User
Longtime User
Hi, my app work fine on android 5 and 6, but crash on startup when i try to open on Android 4.4.
How i can solve it?
I'm using jdk1.8.0_66 and android-25 sdk

This is my project attributes:
B4X:
    #ApplicationLabel: MyApp
    #VersionCode: 9
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
    #AdditionalRes: ..\resource
    #AdditionalRes: ..\resource_tastytoast
    #AdditionalJar: com.google.android.gms:play-services-maps
    #Extends: android.support.v7.app.AppCompatActivity

This is my manifest:
B4X:
'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: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)
SetApplicationAttribute(android:theme, "@style/MyAppTheme")

'Tell the system that we want to draw the SystemBarBackgrounds and
'make the StatusBar transparent.
CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">#2c9240</item>
        <item name="colorPrimaryDark">#2c9240</item>
        <item name="colorAccent">#FF5522</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
    </style>
</resources>
)
'End of default text.
AddManifestText(<uses-feature android:name="android.hardware.location.gps"/>)
'AddApplicationText(
'    <meta-data
'  android:name="com.google.android.gms.version"
'  android:value="@integer/google_play_services_version" />
'  <meta-data
'  android:name="identitytoolkit.show_providers"
'  android:value="Google" />
'  <meta-data
'  android:name="identitytoolkit.use_google_plus"
'  android:value="false" />
'  <meta-data
'  android:name="identitytoolkit.api_key"
'  android:value="******************************" />
'  <meta-data
'  android:name="identitytoolkit.server_client_id"
'  android:value="******************+.apps.googleusercontent.com" />
'  <meta-data
'  android:name="identitytoolkit.server_widget_url"
'  android:value="/" />
')

'************ 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 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) ************

'************ Facebook Login ****************
AddApplicationText(<activity android:name="com.facebook.FacebookActivity"
  android:configChanges=
  "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
  android:theme="@android:style/Theme.Translucent.NoTitleBar" />
      <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>)

'************ Facebook Login (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) ************

'**********google map **********
AddManifestText( <permission
          android:name="$PACKAGE$.permission.MAPS_RECEIVE"
          android:protectionLevel="signature"/>
      <uses-feature android:glEsVersion="0x00020000" android:required="true"/>)
     
AddApplicationText(
<meta-data
  android:name="com.google.android.geo.API_KEY"
  android:value="******************************"/>

<meta-data android:name="com.google.android.gms.version"    
   android:value="@integer/google_play_services_version" /> 
)
'*****google map ********


CreateResource(values, facebook.xml, <resources>
    <string name="facebook_app_id">************************</string>
   </resources>)
 

corwin42

Expert
Licensed User
Longtime User
I guess a version of Android SDK build tools lower than 23.0.3 is installed.
Read the AppCompat library installation instructions and follow them exactly.
 
Upvote 0

uniplan

Active Member
Licensed User
Longtime User
java.lang.RuntimeException: Unable to start activity ComponentInfo{uniplan.greenapp/uniplan.greenapp.main}: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020052

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2338)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)

at android.app.ActivityThread.access$800(ActivityThread.java:151)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)

at android.os.Handler.dispatchMessage(Handler.java:110)

at android.os.Looper.loop(Looper.java:193)

at android.app.ActivityThread.main(ActivityThread.java:5299)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:515)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)

at dalvik.system.NativeStart.main(Native Method)

Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f020052

at android.content.res.Resources.loadDrawable(Resources.java:2152)

at android.content.res.Resources.getDrawable(Resources.java:710)

at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:374)

at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:202)

at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)

at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:711)

at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:195)

at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:81)

at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:131)

at android.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:151)

at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:31)

at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:55)

at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:205)

at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:185)

at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:519)

at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)

at uniplan.greenapp.main.onCreate(main.java:33)

at android.app.Activity.performCreate(Activity.java:5264)

at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302)

... 11 more

Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector

at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933)

at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877)

at android.content.res.Resources.loadDrawable(Resources.java:2148)

... 30 more
 
Upvote 0
Top