Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多渠道打包报错。 #8

Closed
flyuuo9 opened this issue Oct 28, 2017 · 3 comments
Closed

多渠道打包报错。 #8

flyuuo9 opened this issue Oct 28, 2017 · 3 comments

Comments

@flyuuo9
Copy link

flyuuo9 commented Oct 28, 2017

看了源码应该是用到applicationId作生成代码的路径,实际上不存在的路径。
只有manifest里面的package生成R时有个目录。但是和applicationId不一样。导致报错

public void createFogClass(DomainObjectSet<BaseVariant> variants) {
        variants.all { variant ->
            variant.outputs.forEach { output ->
                def processResources = output.processResources
                processResources.doLast {
                    def stringfogDir = variant.applicationId.replace((char)'.', (char)File.separatorChar)
                    def stringfogFile = new File(processResources.sourceOutputDir, stringfogDir + File.separator + "StringFog.java")
                    StringFogClassBuilder.buildStringFogClass(stringfogFile, processResources.sourceOutputDir,
                            variant.applicationId, "StringFog", mKey)
                }
            }
        }
    }

把两者改成一样出现另外一个错误,没显示具体哪个文件出错

:app:mergeXXXDebugAssets
:app:transformClassesWithStringFogForXXXDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithStringFogForXXXDebug'.
> Unexpected internal error near index 1
  \
   ^

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 13.547 secs

@flyuuo9
Copy link
Author

flyuuo9 commented Oct 28, 2017

13:46:51.454 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.util.regex.PatternSyntaxException: Unexpected i
nternal error near index 1
13:46:51.454 [ERROR] [org.gradle.BuildExceptionReporter]
13:46:51.454 [ERROR] [org.gradle.BuildExceptionReporter] ^
13:46:51.454 [ERROR] [org.gradle.BuildExceptionReporter] at com.github.megatronking.stringfog.plugin.WhiteLists.s
hortClassName(WhiteLists.java:114)
13:46:51.454 [ERROR] [org.gradle.BuildExceptionReporter] at com.github.megatronking.stringfog.plugin.WhiteLists.i
nWhiteList(WhiteLists.java:85)
13:46:51.454 [ERROR] [org.gradle.BuildExceptionReporter] at com.github.megatronking.stringfog.plugin.ClassVisitor
Factory.create(ClassVisitorFactory.java:39)
13:46:51.454 [ERROR] [org.gradle.BuildExceptionReporter] at com.github.megatronking.stringfog.plugin.StringFogCla
ssInjector.processClass(StringFogClassInjector.java:106)
13:46:51.454 [ERROR] [org.gradle.BuildExceptionReporter] at com.github.megatronking.stringfog.plugin.StringFogCla
ssInjector.doFog2Class(StringFogClassInjector.java:52)
13:46:51.454 [ERROR] [org.gradle.BuildExceptionReporter] at com.github.megatronking.stringfog.plugin.StringFogCla

@flyuuo9
Copy link
Author

flyuuo9 commented Oct 29, 2017

@MegatronKing
Copy link
Owner

applicationId和manefest包名不一致的问题已经修复,windows分隔符也修复了,详见最新版本v1.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants