Avocarrot / json2view

Update native Android UI on the fly
MIT License
1.51k stars 279 forks source link

ConvertXML2JSON.groovy not working #57

Closed valnenov closed 4 years ago

valnenov commented 4 years ago

I am trying to convert an XML layout to Json but no matter how is specify the -Pxml= path I always get an error:

The input file doesn't exist. Process incomplete | /Users/valeriynenov/.gradle/daemon/5.4.1/./../../json2view-master/sample/src/main/res/layout/notes_doh_a_deer.xml

The XML file is attached.

notes_doh_a_deer.txt

I am not able to go up the directory stack using ../ I tried both in the Android Studio built-in terminal and in the standard MacOS terminal but get the same error. Bellow is part of the log:

`valeriys-imac:json2view-master valeriynenov$ ./gradlew runScript -Pxml=./json2view-master/sample/src/main/res/layout/notes_doh_a_deer.xml

Task :utils:runScript WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/valeriynenov/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.4.15/423a17aeb2f64bc6f76e8e44265a548bec80fd42/groovy-all-2.4.15.jar) to method java.lang.Object.finalize() WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release


ConvertXML2Json Still in experimental mode :(

The input file doesn't exist. Process incomplete | /Users/valeriynenov/.gradle/daemon/5.4.1/././json2view-master/sample/src/main/res/layout/notes_doh_a_deer.xml

BUILD SUCCESSFUL in 2s 2 actionable tasks: 1 executed, 1 up-to-date valeriys-imac:json2view-master valeriynenov$ ./gradlew runScript -Pxml=./sample/src/main/res/layout/notes_doh_a_deer.xml

Task :utils:runScript WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/valeriynenov/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.4.15/423a17aeb2f64bc6f76e8e44265a548bec80fd42/groovy-all-2.4.15.jar) to method java.lang.Object.finalize() WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release


ConvertXML2Json Still in experimental mode :(

The input file doesn't exist. Process incomplete | /Users/valeriynenov/.gradle/daemon/5.4.1/././sample/src/main/res/layout/notes_doh_a_deer.xml

BUILD SUCCESSFUL in 1s 2 actionable tasks: 1 executed, 1 up-to-date valeriys-imac:json2view-master valeriynenov$ `

Can you please help?

Thanks,

Val

valnenov commented 4 years ago

After a lot of experimentation, the solution which I found is to copy the XML layout file in the folder: /Users/valeriynenov/.gradle/daemon/5.4.1/ and execute the command: ./gradlew runScript -Pxml=notes_doh_a_deer.xml in the root directory. Then I get a print out of the resulting .json file on the terminal window. (note: I can not find it saved anywhere). Then I copy and paste the text in a final JSON file. This WORKS!