Migrate to 3.0? - Page 2 - RadaeePDF.com - Results from #6
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF

TOPIC: Migrate to 3.0?

Migrate to 3.0? 5 months 1 week ago #13705

  • arlomedia
  • arlomedia's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 1
Okay, yes, simply deleting the line that tried to import viewlib fixed that. I also removed the jar again.

Now the app won't build because it wants hundreds of string, font and layout resources used in Global.java and PDFLayoutView.java. I'm not using any UI elements from your software; is there a way to avoid including all of those resources in my project? In the old 2.x version, there was only one class that used a lot of image resources, so I just left that class out of my project. But I can't leave out the Global or PDFLayoutView classes.

Additionally, the CaptureSignature class wants a gcacace.signaturepad package from Github. I'm sure I'll never use a signature function in my app. But I can't easily remove that class because PDFLayoutView uses it. I guess I could delete all the code from Global and PDFLayoutView that I won't use, but that could get complicated, and will make it difficult to keep up to date with new versions.

Please Log in or Create an account to join the conversation.

Migrate to 3.0? 5 months 1 week ago #13708

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Karma: 17
  • Thank you received: 65
Hi,
the best way is to include ViewLib as module to your project, so you don't have to copy all the res and files, it will be also easier to upgrade the library next times.
Here you will find an example of how to add ViewLib to your project : www.radaeepdf.com/support/knowledge-base?view=kb&kbartid=41
Otherwise you have to copy all the res and files.

If you don't need any method or functionality you can remove them.

Please Log in or Create an account to join the conversation.

Migrate to 3.0? 5 months 1 week ago #13711

  • arlomedia
  • arlomedia's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 1
Okay, importing ViewLib as a module solved those problems. I did have to make some modifications to ViewLib/build.gradle before my app would build: change buildToolsVersion and the appcompat version to match what I'm using in my own app's build file, and change "api" in the dependencies section to "compile." I also had to add "compile project(':ViewLib')" to the dependencies section. I'm posting these details in case it's helpful to someone else.

Now I'm starting the large task of rewriting my app code to use PDFLayoutView instead of PDFReader. :(

Please Log in or Create an account to join the conversation.

Last edit: by arlomedia.

Migrate to 3.0? 5 months 1 week ago #13712

  • arlomedia
  • arlomedia's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 1
I've finished the first round of rewrites, but now I can't run the project because of this error "Multiple dex files define Lcome/radaee/view/PDFLayout$1."

I'm guessing this is because I had tried adding the jar file directly to my project, then I took it out and added ViewLib as a module instead. But I can't find any trace of the jar now except in the ViewLib module. It's not in the app module's libs directory, and it's not referenced in my build settings. I've also removed all the Radaee source files from my app module, so they are only in the ViewLib module. I've cleaned the project using Android Studio's Clean function, as well as manually deleting the build intermediates and cache files.

Curiously, if I do Build > Rebuild Project, it builds with no errors. But if I do Run > Run or Run > Debug, I get these errors every time.

Do you have any more tips for me? I feel like I'm getting close, but still stuck.

UPDATE: I just tried adding the ViewLib module to a second project, where I had never added the jar file before, and I'm getting the same error message there. So I guess it's not caused by my previous upgrade attempt. Also, the duplicate class shown in the error is PDFLayout, which isn't included in the old 2.x version, so it's not a conflict with older Radaee files. I'm just not getting this new version installed correctly for some reason. As in the first project, the Build command works but the Run command stops with the dex error.
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by arlomedia.

Migrate to 3.0? 5 months 1 week ago #13714

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Karma: 17
  • Thank you received: 65
Hi,
I think you have to enable multidex, please check this : developer.android.com/studio/build/multidex.html

Please Log in or Create an account to join the conversation.

Migrate to 3.0? 5 months 1 week ago #13715

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Karma: 17
  • Thank you received: 65
Hi,
make sure to have only one dependency to the jar file.
Remember that if you use the jar you have to remove view folder and viceversa.

Can you please send us your sample project so we can check it?
Thanks!

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum