Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

MVP template not working in android 3.0 #9

Open
mhdtouban opened this issue May 19, 2017 · 4 comments
Open

MVP template not working in android 3.0 #9

mhdtouban opened this issue May 19, 2017 · 4 comments

Comments

@mhdtouban
Copy link

Following the instructions, you have on the homepage. When I copied the MVP activities to the android studio directory the Android Studio Application got damaged. However, when I followed the same instruction on android 2.3 everything went well.

@benoitletondor
Copy link
Owner

Hi there,

Indeed Android Studio 3.0 on macOS changes the way the app is signed and thus you cannot change any file inside the app bundle without breaking the signature.

I have a temporary workaround that consists in un-signing the app:

  • Download this repo: https://github.com/steakknife/unsign
  • Follow the instructions for building the unsign executable (just run make as the doc says).
  • Run the unsign script with Android Studio executable and use the unsign version:
./unsign /Applications/Android\ Studio\ 3.0\ Preview.app/Contents/MacOS/studio
mv /Applications/Android\ Studio\ 3.0\ Preview.app/Contents/MacOS/studio.unsigned /Applications/Android\ Studio\ 3.0\ Preview.app/Contents/MacOS/studio

You can now execute Android Studio 3.0 and it should work !

Note that GateKeeper won't allow you to start AS 3.0 since it's not signed anymore, follow Apple's instructions to run it: https://support.apple.com/kb/PH25088?locale=en_US

@benoitletondor
Copy link
Owner

Note that the method described in my previous answer seems to kinda break the auto update process.

The window tells that update is impossible but it seems to be working, it needs to be examinated

@asrulsibaoel
Copy link

asrulsibaoel commented Nov 27, 2017

I've followed your instruction @benoitletondor
but, still got same error

==> applicationPackage  [in template "root://activities/MVPActivity/root/src/app_package/classes/Activity.java.ftl" at line 6, column 10]

Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)??

The failing instruction:
==> ${applicationPackage}  [in template "root://activities/MVPActivity/root/src/app_package/classes/Activity.java.ftl" at line 6, column 8]
FreeMarker template error:
The following has evaluated to null or missing:
==> applicationPackage  [in template "root://activities/MVPActivity/root/src/app_package/classes/Activity.java.ftl" at line 6, column 10]

Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)??

The failing instruction (FTL stack trace):
----------
==> ${applicationPackage}  [in template "root://activities/MVPActivity/root/src/app_package/classes/Activity.java.ftl" at line 6, column 8]
----------

Java stack trace (for programmers):
----------
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:98)
	at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:382)
	at freemarker.core.Expression.evalAndCoerceToString(Expression.java:115)
	at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
	at freemarker.core.Environment.visit(Environment.java:265)
	at freemarker.core.MixedContent.accept(MixedContent.java:93)
	at freemarker.core.Environment.visit(Environment.java:265)
	at freemarker.core.Environment.process(Environment.java:243)
	at freemarker.template.Template.process(Template.java:277)
	at com.android.tools.idea.templates.FreemarkerUtils.processFreemarkerTemplate(FreemarkerUtils.java:96)```

@benoitletondor
Copy link
Owner

Hi @asrulsibaoel,

I checked your report and made a little fix, it's released with the 2.2.2 tag. You can pull the last code from the repo and it should work ok now.

Thank you for reporting the issue.

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

No branches or pull requests

3 participants