{"action":"created","issue":{"url":"https://api.github.com/repos/typetools/checker-framework/issues/1316","repository_url":"https://api.github.com/repos/typetools/checker-framework","labels_url":"https://api.github.com/repos/typetools/checker-framework/issues/1316/labels{/name}","comments_url":"https://api.github.com/repos/typetools/checker-framework/issues/1316/comments","events_url":"https://api.github.com/repos/typetools/checker-framework/issues/1316/events","html_url":"https://github.com/typetools/checker-framework/issues/1316","id":233413544,"number":1316,"title":"[Android] - Dex: Error converting bytecode to dex: Cause: Dex cannot parse version 52 byte code.","user":{"login":"jaredsburrows","id":1739848,"avatar_url":"https://avatars0.githubusercontent.com/u/1739848?v=4","gravatar_id":"","url":"https://api.github.com/users/jaredsburrows","html_url":"https://github.com/jaredsburrows","followers_url":"https://api.github.com/users/jaredsburrows/followers","following_url":"https://api.github.com/users/jaredsburrows/following{/other_user}","gists_url":"https://api.github.com/users/jaredsburrows/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredsburrows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredsburrows/subscriptions","organizations_url":"https://api.github.com/users/jaredsburrows/orgs","repos_url":"https://api.github.com/users/jaredsburrows/repos","events_url":"https://api.github.com/users/jaredsburrows/events{/privacy}","received_events_url":"https://api.github.com/users/jaredsburrows/received_events","type":"User","site_admin":false},"labels":[{"id":576582535,"url":"https://api.github.com/repos/typetools/checker-framework/labels/Android","name":"Android","color":"c2e0c6","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-06-04T05:47:42Z","updated_at":"2017-10-17T12:00:18Z","closed_at":"2017-07-05T19:17:00Z","author_association":"NONE","body":"Trying the example for Android does not work: https://checkerframework.org/manual/#android-gradle and https://github.com/typetools/checker-framework/issues/564.\r\n\r\n## Issue:\r\nIt looks like `Opt` is using Java 8 code: https://github.com/typetools/checker-framework/blob/master/checker/src/org/checkerframework/checker/nullness/Opt.java#L4. This means for Android users targeting Java 7 cannot add this as a `compile` dependency.\r\n\r\n## Error:\r\n```\r\nDex: Error converting bytecode to dex:\r\nCause: Dex cannot parse version 52 byte code.\r\nThis is caused by library dependencies that have been compiled using Java 8 or above.\r\nIf you are using the 'java' gradle plugin in a library submodule add \r\ntargetCompatibility = '1.7'\r\nsourceCompatibility = '1.7'\r\nto that submodule's build.gradle file.\r\n...while parsing org/checkerframework/checker/nullness/Opt.class\r\n    PARSE ERROR:\r\n    unsupported class file version 52.0\r\n    ...while parsing org/checkerframework/checker/nullness/Opt.class\r\n    \r\n1 error; aborting\r\n:transformClassesWithDexForDebug FAILED\r\n\r\nFAILURE: Build failed with an exception.\r\n\r\n* What went wrong:\r\nExecution failed for task ':transformClassesWithDexForDebug'.\r\n> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: Unable to pre-dex '/Users/<>/.gradle/caches/modules-2/files-2.1/org.checkerframework/checker-qual/2.1.12/fe3cbfa020dcd5ccb5d3247fb00bb9f73018a3f5/checker-qual-2.1.12.jar' to '/Users/<>/repo/android-gif-example/build/intermediates/pre-dexed/debug/checker-qual-2.1.12_fdffc3e770dd3be820f08e78d59b8afd90e59220.jar'\r\n\r\n* Try:\r\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\r\n\r\nBUILD FAILED\r\n```\r\n\r\n## Repro:\r\n```\r\n1. git clone https://github.com/jaredsburrows/android-gif-example\r\n2. apply the example code from https://checkerframework.org/manual/#android-gradle\r\n3. gradlew assembleDebug\r\n```"},"comment":{"url":"https://api.github.com/repos/typetools/checker-framework/issues/comments/337208714","html_url":"https://github.com/typetools/checker-framework/issues/1316#issuecomment-337208714","issue_url":"https://api.github.com/repos/typetools/checker-framework/issues/1316","id":337208714,"user":{"login":"Defuera","id":1181883,"avatar_url":"https://avatars1.githubusercontent.com/u/1181883?v=4","gravatar_id":"","url":"https://api.github.com/users/Defuera","html_url":"https://github.com/Defuera","followers_url":"https://api.github.com/users/Defuera/followers","following_url":"https://api.github.com/users/Defuera/following{/other_user}","gists_url":"https://api.github.com/users/Defuera/gists{/gist_id}","starred_url":"https://api.github.com/users/Defuera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Defuera/subscriptions","organizations_url":"https://api.github.com/users/Defuera/orgs","repos_url":"https://api.github.com/users/Defuera/repos","events_url":"https://api.github.com/users/Defuera/events{/privacy}","received_events_url":"https://api.github.com/users/Defuera/received_events","type":"User","site_admin":false},"created_at":"2017-10-17T12:00:18Z","updated_at":"2017-10-17T12:00:18Z","author_association":"NONE","body":"I tried `./gradlew clean build`, Invalidating studio cache, restarting machine. But what solved the issue is **turning Instant run off**"}}
{"actor":{"display_login":"Defuera"}}