• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
1

Using updated Android AppCompat resources

Explorer ,
Sep 10, 2016 Sep 10, 2016

Copy link to clipboard

Copied

Hi,

AIR SDK 22 packages outdated AppCompat resources, and packaging updated resources causes conflicts. This prevents us from building extensions for libraries that require newer AppCompat resources.

We managed to avoid the conflict by removing the outdated resources from runtimeClasses.jar and packaging our own but obviously this is a hacky workaround rather than a good solution.

Is there a cleaner way to package newer AppCompat resources with current AIR SDK? If there is no way to fix it using regular ANE approach then maybe it would be a good idea for the AIR dev team to update the resources.

Thanks

TOPICS
Development

Views

2.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 15, 2016 Sep 15, 2016

Copy link to clipboard

Copied

Bug report for this issue can be found here: Bug#4189538 - Outdated Android AppCompat resources

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 16, 2016 Sep 16, 2016

Copy link to clipboard

Copied

Hi chris.campbell, Pahup​, deesharm

We're trying to support the development of Adobe AIR platform. We've developed new Adobe Native Extensions. Moreover they're distributed under Apache 2.0 License. Please help us to support your AIR platform. Fix this bug in upcoming release.

We're looking forward for you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 01, 2016 Nov 01, 2016

Copy link to clipboard

Copied

Hi Marcel,

Please try this out with our latest AIR 24 Beta release:

http://labs.adobe.com/downloads/air.html

In order to resolve this bug, you need to recompile the ANE with the latest SDK. I have attached the resources with below bug logged for this issue in BugBase:

Bug#4189538 - Outdated Android AppCompat resources

Please let us know if you face any further problem.

Thanks,

Adobe AIR Team

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 02, 2016 Nov 02, 2016

Copy link to clipboard

Copied

Hi,

Thank you, I will check it out and report back.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

Hi deesharm,

I finally got around to try AIR 24 with AccountKit ANE. I recompiled the ANE with AIR 24 but it does not fix the original problem with missing appcompat resources.

I looked at the files you uploaded to the reported bug but your ANE is missing android resources for AccountKit - those resources are the reason why we cannot package the APK in the first place.

If I try to package APK (using AIR 24) without custom appcompat library then I get the following errors (and more):

[exec] /private/var/folders/8t/mrsp4nmx1w33jnjvrnlwp1w40000gn/T/19d66045-adf6-487a-9bd9-eac383217261/com.marpies.ane.facebook.accountkit-res/values/values.xml:370: error: Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Small'.

[exec]

[exec] /private/var/folders/8t/mrsp4nmx1w33jnjvrnlwp1w40000gn/T/19d66045-adf6-487a-9bd9-eac383217261/com.marpies.ane.facebook.accountkit-res/values/values.xml:376: error: Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Button'.

[exec]

[exec] /private/var/folders/8t/mrsp4nmx1w33jnjvrnlwp1w40000gn/T/19d66045-adf6-487a-9bd9-eac383217261/com.marpies.ane.facebook.accountkit-res/values/values.xml:406: error: Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Medium'.

[exec]

[exec] /private/var/folders/8t/mrsp4nmx1w33jnjvrnlwp1w40000gn/T/19d66045-adf6-487a-9bd9-eac383217261/com.marpies.ane.facebook.accountkit-res/values/values.xml:415: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ProgressBar'.

[exec]

[exec] /private/var/folders/8t/mrsp4nmx1w33jnjvrnlwp1w40000gn/T/19d66045-adf6-487a-9bd9-eac383217261/com.marpies.ane.facebook.accountkit-res/values/values.xml:418: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Spinner'.

[exec]

[exec] /private/var/folders/8t/mrsp4nmx1w33jnjvrnlwp1w40000gn/T/19d66045-adf6-487a-9bd9-eac383217261/com.marpies.ane.facebook.accountkit-res/values/values.xml:422: error: Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Widget.TextView.SpinnerItem'.

...

If I add separate ANE with appcompat library then I get the following error:

[exec] dx tool failed:

[exec] UNEXPECTED TOP-LEVEL EXCEPTION:

[exec] java.lang.IllegalArgumentException: already added: Landroid/support/v7/appcompat/R$anim;

I have to remove files from runtimeClasses.jar in AIR 24 SDK and use custom ANE with appcompat library to package APK correctly (this is also the workaround for AIR 23 and older).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 15, 2016 Dec 15, 2016

Copy link to clipboard

Copied

Hi mar.pies​,

I have removed "android.support.*" from runtimeClasses.jar of AIR SDK 24 and I packaged my ANE using AIR SDK 24 ADT including all the dependencies (appcompat, design, support-compat and it's internally used inline-compat.jar, recyclerview) jars.  Finally I able to build my project using Animate CC 2017 (using AIR SDK 24) without any error.

But when I launch the app and invoke ANE's activity, art throws "Info" message but no activity is launched.

art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatActivity>

Could you help me understand what's happening here.  There is not error message thrown in the log. Everyting is quite

but no activity is getting launched.

Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 16, 2016 Dec 16, 2016

Copy link to clipboard

Copied

Hi Appearance​,

Well, your error says that you have failed to add AppCompatActivity class to your APK.

I have updated the repository with patched files for AIR 24, so feel free to give it a try. The list of dependency ANEs that are needed is the same, see the README on the github. When I include everything as stated in the README then it works fine for me.

Let me know if you still have trouble getting it to work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2016 Dec 17, 2016

Copy link to clipboard

Copied

Hi mar.pies​,

I haved tried with your patched AIR 24 (runtimeClasses.jar & adt.jar).  I have added dependency anes (support, appcompat, design and recyclerview). It gives an error at compile time:

C:\Users\xyz\AppData\Local\Temp\xx-xxx-xxx-xx\AndroidManifest.xml:66: error: Error: No resource found that matches the given name (at 'resource' with value '@xml/provider_paths').

I am sure that I am not using <meta> tags with any kind of providers. 

Please help me solve this and tell me what causes this error.

Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2016 Dec 17, 2016

Copy link to clipboard

Copied

I further looked into this. It's coming from AndroidManifest-template.xml modified with adt.jar by you.  Can you tell me how can I fix this issue?

Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2016 Dec 17, 2016

Copy link to clipboard

Copied

LATEST

Hi mar.pies​,

I created a file in my resources named "provider_paths.xml" and finally it compiled without error.

But when the app is launched and Activity is launched I got following error:

12-17 16:48:27.362 21469-21469/? E/AndroidRuntime: FATAL EXCEPTION: main

                                                   Process: air.mazhar.testane.android, PID: 21469

                                                   java.lang.NoSuchFieldError: No static field AppCompatTheme of type [I in class Landroid/support/v7/appcompat/R$styleable; or its superclasses (declaration of 'android.support.v7.appcompat.R$styleable' appears in /data/app/air.mazhar.testane.android-1/base.apk)

                                                       at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:339)

                                                       at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:312)

                                                       at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:277)

                                                       at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)

                                                       at com.trendyworks.ane.SugarMaths.TestActivity.onCreate(TestActivity.java:16)

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

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

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

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

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

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

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

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

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

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

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

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

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

Here's the xml for TestActivity (activity_test.xml):

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:app="http://schemas.android.com/apk/res-auto"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:fitsSystemWindows="true"
   tools:context="com.trendyworks.ane.SugarMaths.TestActivity">

  <android.support.design.widget.AppBarLayout
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:theme="@style/SM_AppTheme.AppBarOverlay">

  <android.support.v7.widget.Toolbar
   android:id="@+id/toolbar"
   android:layout_width="match_parent"
   android:layout_height="?attr/actionBarSize"
   android:background="?attr/colorPrimary"
   app:popupTheme="@style/SM_AppTheme.PopupOverlay"/>

  </android.support.design.widget.AppBarLayout>

  <include layout="@layout/content_test"/>

  <android.support.design.widget.FloatingActionButton
   android:id="@+id/fab"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_gravity="bottom|end"
   android:layout_margin="@dimen/fab_margin"
   app:srcCompat="@android:drawable/ic_dialog_email"/>

</android.support.design.widget.CoordinatorLayout>

-------------------------------------------------------------------------------------------------

Here's the xml for fragment (content_test.xml):

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
   android:id="@+id/content_test"
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:app="http://schemas.android.com/apk/res-auto"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:paddingBottom="@dimen/activity_vertical_margin"
   android:paddingLeft="@dimen/activity_horizontal_margin"
   android:paddingRight="@dimen/activity_horizontal_margin"
   android:paddingTop="@dimen/activity_vertical_margin"
   app:layout_behavior="@string/appbar_scrolling_view_behavior"
   tools:context="com.trendyworks.ane.SugarMaths.TestActivity"
   tools:showIn="@layout/activity_test">

  <TextView
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:textAppearance="?android:attr/textAppearanceLarge"
   android:text="@string/app_name"
   android:gravity="center"
   android:layout_centerInParent="true"
   android:textSize="30sp"
   android:textStyle="bold"
   />

</RelativeLayout>

-----------------------------------------------------------------------------------------

Here's the TestActivity.java:

package com.trendyworks.ane.SugarMaths;

import android.os.Bundle;

import android.support.design.widget.FloatingActionButton;

import android.support.design.widget.Snackbar;

import android.support.v7.app.AppCompatActivity;

import android.support.v7.widget.Toolbar;

import android.view.View;

public class TestActivity extends AppCompatActivity {

   @Override
   protected void onCreate (Bundle savedInstanceState) {

        super.onCreate (savedInstanceState);

       setContentView (R.layout.activity_test);

       Toolbar toolbar = (Toolbar) findViewById (R.id.toolbar);

       setSupportActionBar (toolbar);

       FloatingActionButton fab = (FloatingActionButton) findViewById (R.id.fab);

       fab.setOnClickListener (new View.OnClickListener () {

             @Override
             public void onClick (View view) {

                 Snackbar.make (view, "Replace with your own action", Snackbar.LENGTH_LONG)

                      .setAction ("Action", null).show ();

                 }

            });

       }

}

--------------------------------------------------------------------------------

I have used your PATCHED AIR SDK 24.  I have bundled my ane with same sdk's adt command.

Kindly tell me what's causing this error.

Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 15, 2016 Dec 15, 2016

Copy link to clipboard

Copied

Hi Marcel,

Thanks for sharing the information.

We are investigating it further at our end.

Thanks,

Adobe AIR Team

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

Hi mar.pies​

I have checked the solution of AIR24 beta. It's not working and still gives errors of either duplicate resources or resource not found. Have you checked this?

What's the Adobe fix for this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

Hi Mazhar,

Have you re-compiled the ANE using our latest AIR 24 SDK.

The problem shouldn't occur after re-compiling the ANE and using it in the actionscript project.

Thanks,

Adobe AIR Team

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

Hi deesharm​

Yes, I have recompiled the ANE using LATEST AIR SDK 24 BETA. I am still getting "already added: Landroid/support/v7//appcompat/R$anim;" error.

By the way, can you elaborate on "recompile the ANE using our latest AIR 24 SDK" ? I am using "ADT" command to compile the ANE.

Can you please explain me steps of doing that, in case if I am missing any step. 

(Note: I am building the android native library (.jar) using Android Studio 2.2.3)

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

Hi Mazhar,

Yes, re-compiling means packaging .ane using latest adt.

Could you please share your .jar file with us or the resources to compile .ane ?

It will be very helpful for us in further investigation.

Thanks,

Adobe AIR Team

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

Hi deesharm​

Yes sure. In fact I can give the .aar so that you can have a look into the resources too.  Please advice me how can I provide the .aar to you not publicly visible.

Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

Hi Mazhar,

If you feel fine sharing its link here, You can do it through Dropbox.

Else, PM me.

Thanks,

Adobe AIR Team

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

Hi deesharm​,

I sent you PM/email yesterday.  Please reply back with a working solution.

Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines