Android Question Problem compiling on 9.8 from 8.8

Status
Not open for further replies.

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Hi, I have an app that compiles and run ok in 8.8
Ive installed 9.8, recompile, install and the app opens and close inmediately withot sendin nothing to the Log.
Tested in debug mode too.
Any idea?
 

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
May be Im not clear.
Ive made all you suggest in your post when I add Admov to my b4a8.0 app
It compiles and run OK
All the Admov stuff is ok
Then I take that app and try with b4a 9.8 , it compiles ok but it does not run on the phone.
I only see the activity a mili sencond and it halts showing nothing in the log.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
May be Im not clear.
Maybe i was not clear

Check the unfiltered log. There is no crash in Android without something in the Log. Post the full error may help us helping you.

Uncheck the FilterCheckbox and check the unfiltered LOG! There is no crash in Android without anything in the log...
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Again: Ive done it and nothing in the Log. The app shows the first activity a milisecond and halts without sending nothing to the log.
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
FWIW Ive compiled and old version, without Admov and it compiles and runs ok in 8.8 and in 9.8
With Admov only 8.8 runs ok.
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Can you post the manifest editor code?
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
    android:xlargeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
     android:versionCode="1"
    android:versionName="2"   
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'SetApplicationAttribute(android:theme, "@android:style/Theme:Holo")
'End of default text.
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo.Light")
'SetApplicationAttribute(android:uiOptions, "splitActionBarWhenNarrow")
AddManifestText(
<uses-feature android:name="android.hardware.telephony"
    android:required="false" />)
AddPermission(android.permission.READ_PHONE_STATE)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
'CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
'CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)
'CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
 
Upvote 0

asales

Expert
Licensed User
Longtime User
1 - Create a "Starter" service in your project
2 - Follow the instructions to the new Admob:
3 - Put this line in the manifest:
CreateResourceFromFile(Macro, Core.NetworkClearText)
4 - Clear your project
5 - Like @Peter Simpson says: "now delete your code"

With this instructions the project is run and you see what was the problem.
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
@asales Ive done all you suggest.
Installs all that SDK suggest.
Compile and I had an error saying firebase component does not exists
Back to the sdk and install firebase component, then it ask if Ireplace the new AndroidX, answer Yes.
Back to b4a , clean the project and compile and get this compile errors:
B4X:
Compilando el código Java generado.    (22.75s)
Convirtiendo byte code a dex optimizado.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/AbstractComponentContainer;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/Component;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/Component$$Lambda$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/Component$$Lambda$2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/Component$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/Component$Builder;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/ComponentContainer;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/ComponentDiscovery;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/ComponentDiscovery$1;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:692)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
    at com.android.dx.command.dexer.Main.runDx(Main.java:293)
    at com.android.dx.command.dexer.Main.main(Main.java:249)
    at com.android.dx.command.Main.main(Main.java:94)
Caused by: java.lang.InterruptedException: Too many errors
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:684)
    ... 4 more
 
Upvote 0

asales

Expert
Licensed User
Longtime User
Worked fine here. See the picture:


- Did you jetified your libs?
- Did you put your Admob App Id in the manifest and the code to MobileAds in Starter?

I sent you a PM.
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
@asales Trying your modified code, I get the following error compiling:
B4X:
B4A Version: 9.80
Java Version: 8
Parsing code.    (1.86s)
Building folders structure.    (0.04s)
Compiling code.    (1.64s)
    
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.19s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Generating R file.    (2.53s)
Compiling generated Java code.    (26.41s)
Convert byte code - optimized dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/AbstractComponentContainer;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/Component;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/Component$$Lambda$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/Component$$Lambda$2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/Component$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/Component$Builder;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/ComponentContainer;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/ComponentDiscovery;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/components/ComponentDiscovery$1;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:692)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
    at com.android.dx.command.dexer.Main.runDx(Main.java:293)
    at com.android.dx.command.dexer.Main.main(Main.java:249)
    at com.android.dx.command.Main.main(Main.java:94)
Caused by: java.lang.InterruptedException: Too many errors
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:684)
    ... 4 more
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Erel, Ive made a new instalation in a new machine, Intel i7 W10home, Ive followed your instructions and trying to compile the @asales example, it is taking minutes and minutes and never ends to compile.
Any thing I miss? please see pic.
 

Attachments

  • 1.png
    57.2 KB · Views: 220
Upvote 0
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…