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.
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 :
Otherwise you have to copy all the res and files.
If you don't need any method or functionality you can remove them.
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.
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.