Closed as001622 closed 5 years ago
Same issue.
Same.
kotlin.KotlinNullPointerException
at eu.long1.flutter.i18n.files.FileHelpers.getI18nFile(FileHelpers.kt:20)
at eu.long1.flutter.i18n.workers.I18nFileGenerator.generate(I18nFileGenerator.kt:54)
at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1$lambda$1.compute(actions.kt:64)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:945)
at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1.run(Timer.kt:150)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
The reason is missing misc.xml
in .idea
directory (the project file).
@kika Thanks. It works for me. Is it a bug of AS3.3?
@hiperioncn or, it might become optional. Everything in my flutter project worked perfectly without this file, except for this plugin.
@kika i get the same bug. but, where can i found misc.xml? my project is missing. What is the content of this file ?
@KingWu you can get this file in the example of the plugin : https://github.com/long1eu/flutter_i18n/blob/master/.idea/misc.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="NodePackageJsonFileManager">
<packageJsonPaths />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
@BenoitVerstraete Worked. Thx
Is this still an issue?
@long1eu without the file misc.xml, the issue is still there.
Yes its still an issue, but workaround works!
Still an issue but adding the .idea/misc.xml works.
Duplicate of #43
Is this issue fixed? I got the same error with: Flutter i18n plugin: version 1.0.1, Android Studio: version 3.3.2, Flutter: version 1.5.4
I copied the misc.xml
file to .idea
folder, and this plugin can generate i18n.dart.
But, I still think this is an issue
Greetings, I got exactly the same issue, the only difference is that I am using Intellij IDEA. Adding misc.xml hasn't resolved the issue.
Flutter i18n: 1.0.6-192 Intellij Idea: 2019.2
Stacktrace:
kotlin.KotlinNullPointerException
at eu.long1.flutter.i18n.files.FileHelpers.getI18nFile(FileHelpers.kt:20)
at eu.long1.flutter.i18n.workers.I18nFileGenerator.generate(I18nFileGenerator.kt:54)
at eu.long1.flutter.i18n.actions.RebuildI18nFile$actionPerformed$1.run(RebuildI18nFile.kt:13)
at com.intellij.openapi.command.WriteCommandAction.lambda$runWriteCommandAction$5(WriteCommandAction.java:368)
at com.intellij.openapi.command.WriteCommandAction$BuilderImpl$1.run(WriteCommandAction.java:125)
at com.intellij.openapi.application.RunResult.run(RunResult.java:35)
at com.intellij.openapi.command.WriteCommandAction.lambda$null$1(WriteCommandAction.java:264)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:994)
at com.intellij.openapi.command.WriteCommandAction.lambda$performWriteCommandAction$2(WriteCommandAction.java:263)
at com.intellij.openapi.command.WriteCommandAction.lambda$doExecuteCommand$4(WriteCommandAction.java:320)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:188)
at com.intellij.openapi.command.WriteCommandAction.doExecuteCommand(WriteCommandAction.java:322)
at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:263)
at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:245)
at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.run(WriteCommandAction.java:127)
at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:368)
at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:360)
at eu.long1.flutter.i18n.actions.RebuildI18nFile.actionPerformed(RebuildI18nFile.kt:13)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:265)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:282)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:256)
at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:194)
at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:157)
at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:434)
at java.desktop/java.awt.Component.processEvent(Component.java:6416)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:873)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:818)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:461)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:460)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Please, this is a critically important plugin for our team. What can we do to help to fix it? @noordawod
until this is fixed, let me give you a workaround
git clone https://github.com/long1eu/flutter_i18n.git
pub global activate --source path {ROOT for flutter_i18n}/flutter_l10n/
pub global run l10n_generator:main -w
Keep in mind that this generator produces the code in a new but compatible style.
NOTE: This is an experimental feature meant for quick recover when the plugin doesn't work.
@long1eu Thank you very much, I will try and let you know!
Ok, so actually, accidentally, I have figured out what was my problem.
I have had a problem with the structure of files. At the beginning, I have had
~/FlutterProjects/myapp/root
but at some point, I changed it to
~/FlutterProjects/myapp/myapp/root
however, IntellijIDEA was still using .idea
folder from the previous path. Fixing that, and adding the following misc.xml fixed the issue for me:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="ProjectType">
<option name="id" value="io.flutter" />
</component>
</project>
good to know
Indeed good to know :)
There's a misc.xml in my appfolder/.idea/ but it's a lot different from the one here.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectType">
<option name="id" value="io.flutter" />
</component>
</project>
Also, closing the project and deleting the .idea folder should also fix this problem, right?
Anyway, new projects doesn't work anymore either. Create new flutter project, try extracting any string = Crash.
Problem is that I decided to update the plugin today.
This problem is back with the recent update and adding/changing the misc.xml file doesn't work now. YAY!
This will be fixed after #103 is merged later today.
Plugin v1.1.2 has been published to JetBrains, awaiting approval. It should be available during the day.
I 'm getting following error when my application is started. And i18n file is not generated. kotlin.KotlinNullPointerException at eu.long1.flutter.i18n.files.FileHelpers.getI18nFile(FileHelpers.kt:20) at eu.long1.flutter.i18n.workers.I18nFileGenerator.generate(I18nFileGenerator.kt:54) at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1$lambda$1.compute(actions.kt:64) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:945) at eu.long1.flutter.i18n.workers.Initializer$runActivity$$inlined$scheduleAtFixedRate$1.run(Timer.kt:150) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505)