Android: ExternalSystemException: String index out of range: -130 building release

て烟熏妆下的殇ゞ 提交于 2019-11-28 00:39:44

If you're using Android Studio, selecting the Gradle Console will show you where the problem lies. In my case, it was duplicate textView identifiers that caused this error.

Worked By adding this in build.gradle

 lintOptions {
        checkReleaseBuilds false
    }

My error is

ExternalSystemException: String index out of range:-

My app support Turkish and English language. My English strings.xml contains

 <string name="hello_world">Hello world!</string>

and my Turkish strings.xml do not contains

<string name="hello_world">Bla bla!</string>

When i add <string name="hello_world">Bla bla!</string> to Turkish strings.xml file the problem solved.

Note: Please look Android Studio's Gradle Console

I had the same problem with Android Studio 1.4 Build on September 28, 2015 What I did was :

  1. Started a build on the main gradle script - that created a run configuration in the menu.

  2. Edited the run configuration by adding ":app:assembleRelease" on the script parameters row. and started it.

  3. The gradle build showed me that I had missing translations in the main strings.xml file.

After fixing this. Generate Signed APK finished without problem.

I had the same problem but with this error:

ExternalSystemException: String index out of range: -119

My problem was that in the string editor i forgot to set a default variable into my translation, after adding it, the problem was solved.

Hope it helps!

So I reverted back to Android Studio 1.3 and the issue went away.

Although this is an old thread, however the following info might be useful for some people. I was getting a bit different message (but similar, googling for the following message redirects me to this thread.)

Execution failed for task ':app:mergeReleaseResources'.
> String index out of range: 0

For me the problem was the string.xml was missing the name for a string resource as mentioned below.

<string name="">Some strings...</string>

Adding the proper resource name resolved the issue.

<string name="some_string">Some strings...</string>

I have same problem. my Android Studio version is ver2.1.1

My strings.xml contains

<string name="title_connecting">connecting...</string>

then I change to the following statement. the problem solved.

<string name="title_connecting">connecting..</string>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!