Blocker "cannot access zzF4 class file for asposewobfuscated.zzF4 not found" issue

Hello.

We catch blocker issue with trying to integrate aspose words for android.

When we try to compile simple logic, like

try
{
    Document document = new Document("//sdcard/1.docx");
    document.save("//sdcard/1.png");
}
catch (Exception e)
{
    e.printStackTrace();
}

we catch

Error:(40, 37) Gradle: error: cannot access zzF4
class file for asposewobfuscated.zzF4 not found
Compile issue is reproduced with IDEA 14.0.2 (compile with gradle) and Android Studio 1.1.0 (compile with gradle), Ubuntu 14.04.1 LTS

Sample project with compile issue: https://www.dropbox.com/s/rt59gw9h88e66no/MyApplication2.zip

Already trying this solution:

<application 
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:name="com.aspose.words.AsposeWordsApplication"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity

no results too

Hi Yury,

Thanks for your inquiry. We are working over your query and will get back to you soon.

Best regards,

JFYI, issue is reproduced with aspose-words-1.12-android-jdk16.jar (in libs) and aspose-words-1.12-libs-android-jdk16.apk (in assets) from Aspose.Words for Android 1.12

Hi Yury,

Thanks for the additional information. Please spare us some time for the investigation of this issue. We will get back to you soon.

Best regards,

The problem occurs because while compiling Gradle cannot find classes from the second .dex file

(we use approach described here )

I guess there are a few ways to solve this problem

  1. Stop Gradle from compiling aspose-words-1.12-android-jdk16.jar

  2. Second is

a) Extract classes.dex file from app\src\main\assets\aspose-words-1.12-libs-android-jdk16.apk.

b) Convert it to a jar file with dex2jar.

c) Add this classes.jar into Gradle as a provided dependency

e.g.

dependencies {
compile files('libs/aspose-words-1.12-android-jdk16.jar')
provided files('libs/aw-classes_dex2jar.jar')
}

Vyacheslav, thanks for the trick, it works!

Dear Friend,

i am having the same problem. i am not getting your solution provided. can you please explain these steps with snapshots.

i will be thankful to you.

Regards,

HK

Hi Haroon,

Thanks for your inquiry. As you know, we had divided the Aspose.Words for Android library into following two archives:

aspose-words-1.12-android-jdk15.jar: The first one includes public API and its auxiliary methods.

aspose-words-1.12-libs-android-jdk15.apk: The second one includes third party jars, basic classes and resources.

However, when you import JAR, Gradle doesn’t see the second part. In this case, you need to extract classes.dex file from ‘app\src\main\assets\aspose-words-1.12-libs-android-jdk16.apk’ and convert it to JAR. Then let Gradle see this new JAR file (as dependency). Please refer to the following articles:

Custom Class Loading in Dalvik

Dependency Management Basics

Please also check Vyacheslav’s reply. Hope, this resolves your problem.

Best regards,

Alright Sir,

now i got it.

i will get back to you soon. thank you so much. Jazakallah.

Yes its worked, now code is compiled successfully.

I want to share something here for others.

  1. you can’t change extension of “aspose-words-1.12-libs-android-jdk15.apk” directly.

  2. you have to put it first in assets folder, rename it within AndroidStudio as “aspose-words-1.12-libs-android-jdk15.zip”.

  3. then you can extract it aand use dex2jar to get .jar file.

  4. put .jar file in libs folder.

  5. Yepiii… Code compiled successfully.

Thank you for providing detail information. It works.