androidannotation with proguard - proguard

if I set the "minifyEnabled false" in proguard file on AndroidStudio IDE,It worked fine;But if I changed minifyEnabled true,it crashed when launched;The logs shows that some view throws nullpointerException;
Anybody knows why and how fix it?

Related

intellij accessing invalid virtual file

Please help me I am stuck due to below weird behavior of Intellij 2021.2.4(Ultimate Edition)
I am getting error after opening project in Intellij as below :
"Accessing invalid virtual file: file://; original:12323; found:12333; File.exists()=true.
I restarted my machine on weekend and then opened the Intellij Idea today morning .
I have tried below solutions but in vain
1.Invalid Caches
2.Remove idea64.exe.vmoptions
Thanks in advance .
I had this same issue just now. For me, I was running our app via JavaScript Debug task and the app would immediately fail; I'd get the error message in a "red balloon" above my Debug tool window tab.
Following the advice of #Andrey I checked the logs. Sure enough, there was a hint:
com.intellij.openapi.vfs.InvalidVirtualFileAccessException: Accessing invalid virtual file: file:///Users/randy/projects/..../.../notifications; original:804838; found:805846; File.exists()=true
at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.handleInvalidDirectory(VirtualDirectoryImpl.java:190)
at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.doFindChild(VirtualDirectoryImpl.java:111)
at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.findChild(VirtualDirectoryImpl.java:77)
at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.findChild(VirtualDirectoryImpl.java:500)
at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.findChild(VirtualDirectoryImpl.java:44)
at com.intellij.javascript.debugger.JavaScriptDebugProcess.isMeteorClientScript(JavaScriptDebugProcess.kt:587)
at com.intellij.javascript.debugger.JavaScriptDebugProcess.getLocationsForBreakpoint(JavaScriptDebugProcess.kt:538)
at com.intellij.javascript.debugger.JSLineBreakpointManagerBase.setBreakpoint(JSLineBreakpointManagerBase.kt:36)
at com.intellij.javascript.debugger.breakpoints.JSLineBreakpointHandler.registerBreakpoint(JSLineBreakpointHandler.kt:17)
at com.intellij.javascript.debugger.breakpoints.JSLineBreakpointHandler.registerBreakpoint(JSLineBreakpointHandler.kt:12)
IntelliJ was trying to register breakpoints when it crashed. From there, I simply opened the Breakpoints dialog and trashed everything since they were all recent and moot anyway.
After that, I just closed the debug browser window that was left from my last failed attempt, then reran the Debug config. Everything worked as expected.

react native problem with creating apk: gradle mergeDexRelease

My app works well on react-native-run-android and on gradlew clean provide me build success.
I used to check and creating the apk by using gradlew assembleRelease.
Recently, I faced an error while trying to create the APK and I cant find the right solution.
as far as I understand, some problem with the build.gradle or any gradle settings - the last feature I put was the mauron background geolocation (im not sure if that cause the problem).
I tried:
on gradle.properties :
android.useAndroidX=true
android.enableJetifier=true
org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx4608m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
in build.gradle I added: implementation 'androidx.multidex:multidex:2.0.1' in the dependencies.
3.
defaultConfig {
...
multiDexEnabled true
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
// multiDexEnabled true
}
The gradle I used was 6.3. So I upgraded (downloaded from their website v7 but I think the project is still under 6.3).
My question is:
If the app works and build successfuly, was the error because of my code or the gradle settings?
Im over a week with that problem and out of any clue how to get it work.
the error I get:
> Task :app:mergeDexRelease FAILED
D8: Program type already present: org.apache.commons.io.Charsets
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Program type already present: org.apache.commons.io.Charsets
full picture: https://ibb.co/87pFnv1 , https://ibb.co/FxB8PWX
could anyone help me with it?
The error is not about multidex. It clearly says that one of your package is trying to add a library which is already there.
Since you have the name of the library you can put conditional implementation in your build.gradle to avoid redundant implementation.
for example
Implementation('new package that has module'){
exclude module: 'module to exclude'
}
Finally I solved the problem, Thanks Shashank Shekhar for directing me to the correct problem.
I used mauron85/react-native-background-geolocation package, was working fine until I tried to create apk.
in mauron85 issue #505 there was similar problem and someone fixed it by forking and maintaining the repo.
if anyone face that issue in future, I recommend to use #darron1217/react-native-background-geolocation as it solved the error.
Resolved: I have two packages #react-native-masked-view/masked-view (from previous developer) and #react-native-community/masked-view. Just remove #react-native-masked-view/masked-view package and try build.
https://github.com/react-native-masked-view/masked-view/issues/100#issuecomment-841634389 Thanks to: Navipro70

Using #Slf4j Annotation from lombok, but still have error that method log is unknown

I have a very strange behaviour of Intellij.
I had a single project before, I converted it to a multi module pom and everything seemd to work.
But now I see in my sourcecode the error, that the method log is undefined in spite of the fact that I have annotated the class with #Slf4j from lombok.
And the strange thing is, that I'm able to compile and run the project and I see all the log messages. but I still see this error shown in IntelliJ.
Look at my screenshot:
enter image description here
hmm, no unfortunatly deleting the cashes doesn't solve the problem.
But I finally solved it.
I have done two things (so I dont know if both were required ^^):
I activated the "enable the annotation processing"
I installed the Lombok Plug in and activated all options (Builder Support and so on

Intelij IDEA scala test - compilation error, but ok in sbt

I'm getting following compilation error in Intelij Idea when running scalatests in my play framework application:
Error:(41, 54) Cannot find an instance of play.api.libs.json.JsObject
to WSBody. Define a BodyWritable[play.api.libs.json.JsObject] or
extend play.api.libs.ws.ahc.DefaultBodyWritables
val response = await(wsClient.url(testUrl).post(data))
Though when running sbt test it compiles and runs fine.
I've tried to clear Intelij cache and restart, didn't help.
What can be an issue?
I could resolve this issue by deleting .idea folder and re-importing the project.

How to disable react native warning message at the bottom

I'm working on a react-native IOS app, and this app sometimes will raise a Warning message "setState(...) Can only update a mounted or mounting component. ...", I understand what the message is about, it is caused by the long time AJAX call.
Considering this warning will not cause any serious issue for the APP, I don't want to spend much time to fix it at this moment, this warning message will show up in both simulator and cellphone while loading from development server. My question is whether the warning message will still prompt in product mode (Load from pre-bundled file)? If it will still show up, how to disable this Warning message from configuration?
Thanks.
the better solution is to write this in your index file:
console.disableYellowBox = true;
To disable only this warning message use the following code on possible files
console.ignoredYellowBox = ['Warning: setState(...)'];
To disable only the setState message
The "setState(...) Can only update a mounted or mounting component." is thrown from 4 possible files :
node_modules/react/dist/react-with-addons.js
node_modules/react/dist/react.js
node_modules/react/lib/ReactNoopUpdateQueue.js
node_modules/react/lib/ReactUpdateQueue.js
I don't know which one triggered yours, but you can modify those files to not show the warning. If your concern is for your users, that is to say in release mode, then the dev flag is false which means that will not see any warning messages.
To disable all warnings
To disable the warnings, just change this in your AppDelegate.m :
jsCodeLocation = [NSURL URLWithString:#"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
to
jsCodeLocation = [NSURL URLWithString:#"http://localhost:8081/index.ios.bundle?platform=ios&dev=false"];
If you're using the pre-bundled file you'll have to specify dev as false when bundling :
react-native bundle --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle --platform ios
Just to answer to question you asked, no, the warning will not show up when you load from a pre-bundled file (like when testing with TestFlight).
I edited my App.js file and added this:
console.ignoredYellowBox = ['Warning: Can only update a mounted', '-[EXCamera updateFocusDepth'];
You can provide an array of things you want to ignore. Simply provide a prefix of ones you want to ignore, no '*' or other wildcard required.
For Remote debugger
console.ignoredYellowBox = ['Remote debugger'];
and for all warning
console.disableYellowBox = true;