ImapNote2 icon indicating copy to clipboard operation
ImapNote2 copied to clipboard

Not really an issue but a question

Open kwhitefoot opened this issue 8 years ago • 6 comments

I don't know how else to contact you to ask for clarification about some of the code.

I am making various changes in my fork to support a different style of notes and conflict resolution. To do this I will need to create some more folders on the IMAP server. So I searched the code to find out how you do it and was surprised to see that the create method of Folder is not used anywhere. But the Notes folder is still created.

How is it done, what have I missed?

By the way, thanks for your version, it has been a very useful platform to build my version on.

kwhitefoot avatar Jan 22 '17 14:01 kwhitefoot

@kwhitefoot

You haven’t missed anything. The app doesn’t create any folder on the IMAP server side, only locally. "Notes" folder is assumed to be existing. It is looked for in Imaper.java at top level, which is not good. Otherwise it stands in a folder "folderoverride" given in account configuration (patch from Axel Strübing)

BTW, I wanted to try your version which includes wasabeef rich editor, but I cannot compile it. I tried with Android studio, and manually (gradlew). In both cases I have errors related to wasabee. Eg: Error: No resource found that matches the given name (at 'src' with value '@drawable/undo'). and some others like this one I’m probably missing something. Can you please tell me how to build the app.

N0ury avatar Jan 22 '17 15:01 N0ury

@nbenm

Aha! Thanks. I was tearing my hair out (not got much left so it's important to avoid this :-) ).

About compiling my version: thanks for trying it and I'm sorry it didn't compile. As usual 'it compiles on my box' turns out not to be sufficient.

I have only done it with Android Studio, I have no idea about gradle; it's a mystery to me.

I'll clone it to a clean directory and see if it works, perhaps there is something that I have neglected to check in.

kwhitefoot avatar Jan 22 '17 18:01 kwhitefoot

A whole directory full of icons for the toolbar of the rich text editor was missing from Github, sorry. It should compile now.

kwhitefoot avatar Jan 22 '17 18:01 kwhitefoot

It compiles with the following error:

:ImapNote2:lintVitalRelease /Users/nb/Dropbox/dev/android/adt/ImapNote2/ImapNote2/src/main/java/com/Pau/ImapNotes2/Sync/StubProvider.java:16: Error: This class should be public (com.Pau.ImapNotes2.Sync.StubProvider) [Instantiatable] class StubProvider extends ContentProvider { ~~~~~~~~~~~~

Explanation for issues of type "Instantiatable": Activities, services, broadcast receivers etc. registered in the manifest file (or for custom views, in a layout file) must be "instantiatable" by the system, which means that the class must be public, it must have an empty public constructor, and if it's an inner class, it must be a static inner class.

At runtime, the app crashes with the following in logcat:

01-22 20:02:05.831 31453 31453 E AndroidRuntime: FATAL EXCEPTION: main 01-22 20:02:05.831 31453 31453 E AndroidRuntime: Process: com.Pau.ImapNotes2, PID: 31453 01-22 20:02:05.831 31453 31453 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.Pau.ImapNotes2.Sync.StubProvider: java.lang.IllegalAccessException: java.lang.Class<com.Pau.ImapNotes2.Sync.StubProvider> is not accessible from java.lang.Class<android.app.ActivityThread> 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6871) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:6463) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6403) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.access$1800(ActivityThread.java:229) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7325) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: Caused by: java.lang.IllegalAccessException: java.lang.Class<com.Pau.ImapNotes2.Sync.StubProvider> is not accessible from java.lang.Class<android.app.ActivityThread> 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at java.lang.Class.newInstance(Native Method) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6856) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: ... 10 more 01-22 20:02:05.841 2624 3406 W ActivityManager: Force finishing activity com.Pau.ImapNotes2/.Listactivity

There are also errors about missing translations in strings.xml to nb (Norwegian Bokmål)

N0ury avatar Jan 22 '17 19:01 N0ury

Hmm, strange. The clean copy I took from Github compiled after I checked in the icons.

But I didn't actually try running it.

Thanks for taking the time to try it.

No time to fix it tonight. I'll have to scratch my head a bit over this later in the week.

On 22/01/17 20:11, nbenm wrote:

It compiles with the following error:

:ImapNote2:lintVitalRelease /Users/nb/Dropbox/dev/android/adt/ImapNote2/ImapNote2/src/main/java/com/Pau/ImapNotes2/Sync/StubProvider.java:16: Error: This class should be public (com.Pau.ImapNotes2.Sync.StubProvider) [Instantiatable] class StubProvider extends ContentProvider { ~

Explanation for issues of type "Instantiatable": Activities, services, broadcast receivers etc. registered in the manifest file (or for custom views, in a layout file) must be "instantiatable" by the system, which means that the class must be public, it must have an empty public constructor, and if it's an inner class, it must be a static inner class.

At runtime, the app crashes with the following in logcat:

01-22 20:02:05.831 31453 31453 E AndroidRuntime: FATAL EXCEPTION: main 01-22 20:02:05.831 31453 31453 E AndroidRuntime: Process: com.Pau.ImapNotes2, PID: 31453 01-22 20:02:05.831 31453 31453 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.Pau.ImapNotes2.Sync.StubProvider: java.lang.IllegalAccessException: java.lang.Class<com.Pau.ImapNotes2.Sync.StubProvider> is not accessible from java.lang.Class<android.app.ActivityThread> 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6871) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:6463) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6403) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.access$1800(ActivityThread.java:229) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7325) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: Caused by: java.lang.IllegalAccessException: java.lang.Class<com.Pau.ImapNotes2.Sync.StubProvider> is not accessible from java.lang.Class<android.app.ActivityThread> 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at java.lang.Class.newInstance(Native Method) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6856) 01-22 20:02:05.831 31453 31453 E AndroidRuntime: ... 10 more 01-22 20:02:05.841 2624 3406 W ActivityManager: Force finishing activity com.Pau.ImapNotes2/.Listactivity

There are also errors about missing translations in strings.xml to nb (Norwegian Bokmål)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/nbenm/ImapNote2/issues/32#issuecomment-274351705, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AALNdx3mBHsB7lYH4Pk72EWT40FWt7Ttks5rU6n0gaJpZM4LqZd_.

kwhitefoot avatar Jan 22 '17 21:01 kwhitefoot

@nbenm I have created an issue on my fork for this bug https://github.com/kwhitefoot/ImapNote2/issues/3.

Unfortunately I can't reproduce it. If you could add a few words saying exactly how you provoked the error perhaps i might get the same exception.

kwhitefoot avatar Jan 23 '17 19:01 kwhitefoot